]> gitweb.factorcode.org Git - factor.git/commitdiff
math.parser: simplify error types.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 8 Jun 2012 14:32:01 +0000 (07:32 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 8 Jun 2012 14:32:01 +0000 (07:32 -0700)
core/math/parser/parser-tests.factor
core/math/parser/parser.factor

index b1b17e489f4cef8ceb0cdf30e9d60454c382a0e1..529a4fdc1b370af2dbc4daa4bf8306b1c90d9399 100644 (file)
@@ -191,8 +191,8 @@ unit-test
 [ 1 0 >base ] must-fail
 [ 1 -1 >base ] must-fail
 [ 2+1/2 -1 >base ] [ invalid-radix? ] must-fail-with
-[ 123.456 8 >base ] [ invalid-base? ] must-fail-with
-[ 123.456 2 >base ] [ invalid-base? ] must-fail-with
+[ 123.456 8 >base ] [ invalid-radix? ] must-fail-with
+[ 123.456 2 >base ] [ invalid-radix? ] must-fail-with
 
 [ "0/0." ] [ 0.0 0.0 / number>string ] unit-test
 
index 244caf325901a915eadadd44f80fe493e27f7b4c..ccadd376ed48aed83360ae5e4282119d077c61c6 100644 (file)
@@ -13,11 +13,9 @@ IN: math.parser
 
 ERROR: invalid-radix radix ;
 
-ERROR: invalid-base n base ;
-
 <PRIVATE
 
-TUPLE: number-parse 
+TUPLE: number-parse
     { str read-only }
     { length fixnum read-only }
     { radix fixnum read-only } ;
@@ -409,11 +407,11 @@ M: ratio >base
     dup [ 0 = ] find drop head >string
     fix-float ;
 
-: float>base ( n base -- str )
+: float>base ( n radix -- str )
     {
         { 16 [ float>hex ] }
         { 10 [ "%.16g" format-float ] }
-        [ invalid-base ]
+        [ invalid-radix ]
     } case ; inline
 
 PRIVATE>