diff --git a/core/math/parser/parser-tests.factor b/core/math/parser/parser-tests.factor index df9abe7924..f27d9266f3 100644 --- a/core/math/parser/parser-tests.factor +++ b/core/math/parser/parser-tests.factor @@ -361,8 +361,9 @@ unit-test { f } [ "0o0" bin> ] unit-test { f } [ "0x0" bin> ] unit-test -! #1229, float parsing bug +! #1229, float parsing bug, and a regression { -0.5 } [ "-.5" dec> ] unit-test +{ "0" } [ "0" hex> ] unit-test { t } [ most-positive-fixnum number>string string>number fixnum? ] unit-test { t } [ most-negative-fixnum number>string string>number fixnum? ] unit-test diff --git a/core/math/parser/parser.factor b/core/math/parser/parser.factor index 3f1edd5a3a..c60d60aa78 100644 --- a/core/math/parser/parser.factor +++ b/core/math/parser/parser.factor @@ -285,6 +285,7 @@ DEFER: @neg-digit { CHAR: b [ pick radix>> 16 = [ CHAR: b swap call ] [ @abort ] if ] } { CHAR: o [ @abort ] } { CHAR: x [ @abort ] } + { f [ 4drop 0 ] } [ swap call ] } case ] curry require-next-digit ; inline