]> gitweb.factorcode.org Git - factor.git/commitdiff
oops, radix prefixes shouldn't chain
authorJoe Groff <arcata@gmail.com>
Thu, 24 Nov 2011 20:39:52 +0000 (12:39 -0800)
committerJoe Groff <arcata@gmail.com>
Thu, 24 Nov 2011 20:39:52 +0000 (12:39 -0800)
core/math/parser/parser-tests.factor
core/math/parser/parser.factor

index 5c44ed2ae518913de8d94ec0742db135086c4972..265f095b9a6b0d6fe13f73953658e62606cf162e 100644 (file)
@@ -262,6 +262,9 @@ unit-test
 [ f ] [ "0o18" string>number ] unit-test
 [ f ] [ "0b12" string>number ] unit-test
 
+[ 11 ] [ "0x0b" string>number ] unit-test
+[ f  ] [ "0x0o0" string>number ] unit-test
+
 [ 0x7FFF,ABCD ] [ "0x7FFF,ABCD" string>number ] unit-test
 
 [ 1.0 ] [ "0x1.0p0" string>number ] unit-test
index 8d006141e3f74c4d9f2082c23a4105ba34a3e461..c0c363877609c20a786bdb31984d5533cede6518 100644 (file)
@@ -228,9 +228,9 @@ DEFER: @neg-digit
 : @pos-first-digit ( i number-parse n char -- n/f )
     {
         { CHAR: . [ ->required-mantissa ] }
-        { CHAR: 0 [ [ @pos-first-digit ] [ @pos-digit-or-punc ] with-radix-char ] }
+        { CHAR: 0 [ [ @pos-digit ] [ @pos-digit-or-punc ] with-radix-char ] }
         [ @pos-digit ]
-    } case ; inline recursive
+    } case ; inline
 
 : @neg-digit-or-punc ( i number-parse n char -- n/f )
     {
@@ -248,9 +248,9 @@ DEFER: @neg-digit
 : @neg-first-digit ( i number-parse n char -- n/f )
     {
         { CHAR: . [ ->required-mantissa ] }
-        { CHAR: 0 [ [ @neg-first-digit ] [ @neg-digit-or-punc ] with-radix-char ] }
+        { CHAR: 0 [ [ @neg-digit ] [ @neg-digit-or-punc ] with-radix-char ] }
         [ @neg-digit ]
-    } case ; inline recursive
+    } case ; inline
 
 : @first-char ( i number-parse n char -- n/f ) 
     {