+: str-equiv? ( str -- bool )
+ push-parse-idx
+
+ true
+
+ swap dup rot + swap
+ do
+ i @ nextchar <> if
+ drop false
+ leave
+ then
+
+ inc-parse-idx
+ loop
+
+ delim? <> if drop false then
+
+ pop-parse-idx
+;
+
+: character? ( -- bool )
+ nextchar [char] # <> if false exit then
+
+ push-parse-idx
+ inc-parse-idx
+
+ nextchar [char] \ <> if pop-parse-idx false exit then
+
+ inc-parse-idx
+
+ S" newline" str-equiv? if true exit then
+ S" space" str-equiv? if true exit then
+ S" tab" str-equiv? if true exit then
+
+ charavailable? false = if pop-parse-idx false exit then
+
+ pop-parse-idx true
+;
+
+: readnum ( -- num-atom )
+ minus? dup if
+ inc-parse-idx
+ then
+
+ 0
+
+ begin digit? while
+ 10 * nextchar [char] 0 - +
+ inc-parse-idx
+ repeat
+
+ swap if negate then
+
+ number-type
+;
+
+: readbool ( -- bool-atom )
+ inc-parse-idx
+
+ nextchar [char] f = if
+ false