ref: 22824dad97a68c10ce71cf7e623a12e51be80c43
parent: 6df4ee6319d8c943d766e99f231908831421e403
author: Ori Bernstein <[email protected]>
date: Thu Jan 23 05:43:33 EST 2014
Allow '_' as digit separator within integers.
--- a/libstd/bigint.myr
+++ b/libstd/bigint.myr
@@ -145,6 +145,9 @@
v = mkbigint(1)
while str.len != 0
(c, str) = striter(str)
+ if c == '_'
+ continue
+ ;;
val = charval(c, base)
if val < 0
bigfree(a)
--- a/libstd/intparse.myr
+++ b/libstd/intparse.myr
@@ -50,6 +50,9 @@
v = 0
while s.len != 0
(c, s) = striter(s)
+ if c == '_'
+ continue
+ ;;
cv = charval(c, base)
if cv >= 0
v *= (base castto(@a::(tcint,tcnum,tctest)))