--- gforth/float.fs 1995/11/07 18:06:40 1.18 +++ gforth/float.fs 1997/07/06 16:00:11 1.22 @@ -55,12 +55,12 @@ dofield: lastxt code-address! \ change t : f, ( f -- ) here 1 floats allot f! ; -: fconstant ( r -- ) \ float +: fconstant ( r "name" -- ) \ float Create f, DOES> ( -- r ) f@ ; -: fdepth ( -- n ) f0 @ fp@ - [ 1 floats ] Literal / ; +: fdepth ( -- n ) fp0 @ fp@ - [ 1 floats ] Literal / ; : FLit ( -- r ) r> dup f@ float+ >r ; : FLiteral ( r -- ) @@ -98,30 +98,40 @@ DOES> ( -- r ) scratch over c@ emit '. emit 1 /string type 'E emit . ; -require debugging.fs +require debugs.fs -: sfnumber ( c-addr u -- r / ) - 2dup [CHAR] e scan +: sfnumber ( c-addr u -- r true | false ) + 2dup [CHAR] e scan ( c-addr u c-addr2 u2 ) dup 0= IF - 2drop 2dup [CHAR] E scan + 2drop 2dup [CHAR] E scan ( c-addr u c-addr3 u3 ) THEN nip IF - 2dup >float - IF - 2drop state @ - IF - POSTPONE FLiteral - THEN - EXIT - THEN - THEN - defers notfound ; + >float + ELSE + 2drop false + THEN ; + +:noname ( c-addr u -- ) + 2dup sfnumber + IF + 2drop POSTPONE FLiteral + ELSE + defers compiler-notfound + ENDIF ; +IS compiler-notfound -' sfnumber IS notfound +:noname ( c-addr u -- r ) + 2dup sfnumber + IF + 2drop + ELSE + defers interpreter-notfound + ENDIF ; +IS interpreter-notfound -: fvariable ( -- ) +: fvariable ( "name" -- ) \ float Create 0.0E0 f, ; \ does> ( -- f-addr )