From: Tim Vaughan Date: Tue, 19 Jul 2016 10:39:40 +0000 (+1200) Subject: Fixed fixnum detection in parser. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=c2f2262e11ea022568bc7cbb43f666baf89236e7;p=scheme.forth.jl.git Fixed fixnum detection in parser. --- diff --git a/scheme.4th b/scheme.4th index 23c7f2b..8da2772 100644 --- a/scheme.4th +++ b/scheme.4th @@ -277,7 +277,7 @@ global-env setobj global-env fetchobj define-var ; -: add-prim ( args -- ) +:noname ( args -- ) 2dup nil objeq? if 2drop 0 number-type @@ -286,9 +286,7 @@ global-env setobj -rot car drop + number-type then -; - -' add-prim make-primitive + +; make-primitive + \ }}} @@ -375,9 +373,19 @@ parse-idx-stack parse-idx-sp ! nextchar [char] - = ; : number? ( -- bool ) - digit? minus? or false = if - false - exit + minus? if + inc-parse-idx + + delim? if + dec-parse-idx + false exit + else + dec-parse-idx + then + else + digit? false = if + false exit + then then push-parse-idx