X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=scheme.4th;h=72897bedbec770f312f62e273db0b0d9a45b600c;hb=85e14c9d3e9509418125d2a7a6b7fa366a8f31ad;hp=19848b60409e957933ac482f72e87dc803f7a6b2;hpb=af4ada618d8d096645f783f40508a1bd6ad0d95d;p=scheme.forth.jl.git diff --git a/scheme.4th b/scheme.4th index 19848b6..72897be 100644 --- a/scheme.4th +++ b/scheme.4th @@ -377,12 +377,27 @@ parse-idx-stack parse-idx-sp ! nextchar [char] ) = or ; +: commentstart? ( -- bool ) + nextchar [char] ; = ; + : eatspaces + + false \ Indicates whether or not we're eating a comment + begin - whitespace? + dup whitespace? or commentstart? or 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 + drop ; : digit? ( -- bool )