From f6f596f40f3ed176299041c461c2dc838b5b3865 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 14 Jul 2015 22:48:08 -0700 Subject: [PATCH] math.parser: okay time for sleep, maybe this works, sorry git history. --- core/math/parser/parser-tests.factor | 2 +- core/math/parser/parser.factor | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/math/parser/parser-tests.factor b/core/math/parser/parser-tests.factor index f27d9266f3..215137954b 100644 --- a/core/math/parser/parser-tests.factor +++ b/core/math/parser/parser-tests.factor @@ -363,7 +363,7 @@ unit-test ! #1229, float parsing bug, and a regression { -0.5 } [ "-.5" dec> ] unit-test -{ "0" } [ "0" hex> ] 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 c60d60aa78..6c628433e5 100644 --- a/core/math/parser/parser.factor +++ b/core/math/parser/parser.factor @@ -288,19 +288,19 @@ DEFER: @neg-digit { f [ 4drop 0 ] } [ swap call ] } case - ] curry require-next-digit ; inline + ] curry next-digit ; inline : @neg-first-digit-no-radix ( i number-parse n char -- n/f ) { { CHAR: . [ ->required-mantissa ] } - { CHAR: 0 [ [ @neg-digit ] with-no-radix ] } + { CHAR: 0 [ [ @neg-digit-or-punc ] with-no-radix ] } [ @neg-digit ] } case ; inline : @pos-first-digit-no-radix ( i number-parse n char -- n/f ) { { CHAR: . [ ->required-mantissa ] } - { CHAR: 0 [ [ @pos-digit ] with-no-radix ] } + { CHAR: 0 [ [ @pos-digit-or-punc ] with-no-radix ] } [ @pos-digit ] } case ; inline