]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix unit test failure in math.parser
authorSlava Pestov <slava@shill.local>
Tue, 14 Apr 2009 01:25:55 +0000 (20:25 -0500)
committerSlava Pestov <slava@shill.local>
Tue, 14 Apr 2009 01:25:55 +0000 (20:25 -0500)
core/math/parser/parser.factor

index 0a637c2eabfb5a2848dd5bddfc9e46c001361b69..3fd62e69a03c48ebf084420cc90afe0ee3cd596b 100644 (file)
@@ -50,7 +50,9 @@ SYMBOL: radix
 SYMBOL: negative?
 
 : string>natural ( seq radix -- n/f )
-    [ [ digit> ] dip (digits>integer) ] each-digit ; inline
+    over empty? [ 2drop f ] [
+        [ [ digit> ] dip (digits>integer) ] each-digit
+    ] if ; inline
 
 : sign ( -- str ) negative? get "-" "+" ? ;