diff --git a/core/math/parser/parser-tests.factor b/core/math/parser/parser-tests.factor index e885b23278..1705434f6b 100644 --- a/core/math/parser/parser-tests.factor +++ b/core/math/parser/parser-tests.factor @@ -5,6 +5,22 @@ IN: math.parser.tests [ f string>number ] unit-test +[ f ] +[ ";" string>number ] +unit-test + +[ f ] +[ "<>" string>number ] +unit-test + +[ f ] +[ "^" string>number ] +unit-test + +[ f ] +[ "789:;<=>?@" string>number ] +unit-test + [ f ] [ "12345abcdef" string>number ] unit-test diff --git a/core/math/parser/parser.factor b/core/math/parser/parser.factor index 18ccf132cc..ee022b64a4 100644 --- a/core/math/parser/parser.factor +++ b/core/math/parser/parser.factor @@ -5,11 +5,10 @@ IN: math.parser : digit> ( ch -- n ) { - { [ dup CHAR: 9 <= ] [ CHAR: 0 - ] } - { [ dup CHAR: a < ] [ CHAR: A 10 - - ] } - [ CHAR: a 10 - - ] - } cond - dup 0 < [ drop 255 ] when ; inline + { [ dup CHAR: 9 <= ] [ CHAR: 0 - dup 0 < [ drop 255 ] when ] } + { [ dup CHAR: a < ] [ CHAR: A 10 - - dup 10 < [ drop 255 ] when ] } + [ CHAR: a 10 - - dup 10 < [ drop 255 ] when ] + } cond ; inline