: string? ( -- bool )
nextchar [char] " = ;
-: initial? ( -- bool )
- nextchar [char] A >= nextchar [char] Z <= and if true exit then
- nextchar [char] a >= nextchar [char] z <= and if true exit then
- nextchar [char] * = if true exit then
- nextchar [char] / = if true exit then
- nextchar [char] > = if true exit then
- nextchar [char] < = if true exit then
- nextchar [char] = = if true exit then
- nextchar [char] ? = if true exit then
- nextchar [char] ! = if true exit then
- false
-;
-
-: symbol? ( -- bool )
- initial? if true exit then
- nextchar [char] + =
- nextchar [char] - = or if
- inc-parse-idx
- delim? if dec-parse-idx true exit then
- dec-parse-idx
- then
- false
-;
-
: readnum ( -- num-atom )
minus? dup if
inc-parse-idx
exit
then
- symbol? if
- readsymbol charlist>symbol
- exit
- then
-
pair? if
inc-parse-idx
quit
then
- bold fg red ." Error parsing string starting at character '"
- nextchar emit
- ." '. Aborting." reset-term cr
- abort
+ \ Anything else is assumed to be a symbol
+ readsymbol charlist>symbol
; is read