The Lambda Lab
/
projects
/
scheme.forth.jl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5d74183
)
Fixed broken realnum? procedure.
author
Tim Vaughan
<tgvaughan@gmail.com>
Wed, 12 Oct 2016 10:20:57 +0000
(23:20 +1300)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Wed, 12 Oct 2016 10:20:57 +0000
(23:20 +1300)
scheme.4th
patch
|
blob
|
history
diff --git
a/scheme.4th
b/scheme.4th
index
bac3283
..
46c2969
100644
(file)
--- a/
scheme.4th
+++ b/
scheme.4th
@@
-513,16
+513,16
@@
parse-idx-stack parse-idx-sp !
;
: realnum? ( -- bool )
;
: 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
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
begin digit? while
inc-parse-idx
repeat
@@
-541,6
+541,10
@@
parse-idx-stack parse-idx-sp !
inc-parse-idx
then
inc-parse-idx
then
+ digit? invert if
+ drop pop-parse-idx false exit
+ then
+
begin digit? while
inc-parse-idx
repeat
begin digit? while
inc-parse-idx
repeat