--- gforth/float.fs 2011/10/06 20:04:35 1.59 +++ gforth/float.fs 2011/12/31 15:29:25 1.64 @@ -1,6 +1,6 @@ \ High level floating point 14jan94py -\ Copyright (C) 1995,1997,2003,2004,2005,2006,2007,2009,2010 Free Software Foundation, Inc. +\ Copyright (C) 1995,1997,2003,2004,2005,2006,2007,2009,2010,2011 Free Software Foundation, Inc. \ This file is part of Gforth. @@ -88,7 +88,7 @@ DOES> ( -- r ) \G @code{F.} @code{FE.} and @code{FS.} to @i{u}. to precision ; -: scratch ( r -- addr len ) +: scratch ( -- addr len ) pad precision - precision ; : zeros ( n -- ) 0 max 0 ?DO '0 emit LOOP ; @@ -142,18 +142,25 @@ DOES> ( -- r ) THEN ; [ifdef] recognizer: - ' noop - :noname postpone Fliteral ; + [IFDEF] 2lit, + : flit, postpone Fliteral ; + :noname ['] noop ; + :noname ['] flit, ; + [ELSE] + ' noop + :noname postpone Fliteral ; + [THEN] dup recognizer: r:fnumber - :noname ( addr u -- nt int-table true | addr u false ) - 2dup sfnumber dup - IF - drop 2drop r:fnumber true - THEN ; Constant fnum-recognizer + : fnum-recognizer ( addr u -- float int-table | addr u r:fail ) + 2dup sfnumber + IF + 2drop r:fnumber EXIT + THEN + r:fail ; -fnum-recognizer +' fnum-recognizer forth-recognizer get-recognizers 1+ forth-recognizer set-recognizers [else]