The Lambda Lab
/
projects
/
scheme.forth.jl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
eatspaces now eats comments
[scheme.forth.jl.git]
/
scheme.4th
diff --git
a/scheme.4th
b/scheme.4th
index
19848b6
..
72897be
100644
(file)
--- a/
scheme.4th
+++ b/
scheme.4th
@@
-377,12
+377,27
@@
parse-idx-stack parse-idx-sp !
nextchar [char] ) = or
;
nextchar [char] ) = or
;
+: commentstart? ( -- bool )
+ nextchar [char] ; = ;
+
: eatspaces
: eatspaces
+
+ false \ Indicates whether or not we're eating a comment
+
begin
begin
- whitespace?
+ dup whitespace? or commentstart? or
while
while
+ dup nextchar '\n' = and if
+ invert \ Stop eating comment
+ else
+ dup false = commentstart? and if
+ invert \ Begin eating comment
+ then
+ then
+
inc-parse-idx
repeat
inc-parse-idx
repeat
+ drop
;
: digit? ( -- bool )
;
: digit? ( -- bool )