From: Tim Vaughan Date: Wed, 12 Oct 2016 10:20:57 +0000 (+1300) Subject: Fixed broken realnum? procedure. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=scheme.forth.jl.git;a=commitdiff_plain;h=90e92c642041f4a3174c29373d2dc4d366d746e1 Fixed broken realnum? procedure. --- diff --git a/scheme.4th b/scheme.4th index bac3283..46c2969 100644 --- a/scheme.4th +++ b/scheme.4th @@ -513,16 +513,16 @@ parse-idx-stack parse-idx-sp ! ; : realnum? ( -- bool ) - \ Record starting parse idx: - \ Want to detect whether any characters were eaten. - parse-idx @ - push-parse-idx minus? plus? or if inc-parse-idx then + \ Record starting parse idx: + \ Want to detect whether any characters (following +/-) were eaten. + parse-idx @ + begin digit? while inc-parse-idx repeat @@ -541,6 +541,10 @@ parse-idx-stack parse-idx-sp ! inc-parse-idx then + digit? invert if + drop pop-parse-idx false exit + then + begin digit? while inc-parse-idx repeat