diff options
| author | Chouser <chouser@n01se.net> | 2015-02-14 13:40:07 -0500 |
|---|---|---|
| committer | Chouser <chouser@n01se.net> | 2015-02-21 13:22:44 -0500 |
| commit | 69972a8399efe4abb8567526e90262e131f90d26 (patch) | |
| tree | 5e12e86da119a9c3f4372dab9e04777a746f90d0 /forth/reader.fs | |
| parent | 9da223a35a176d94fbb75cbcc1000871ff5aff0b (diff) | |
| download | mal-69972a8399efe4abb8567526e90262e131f90d26.tar.gz mal-69972a8399efe4abb8567526e90262e131f90d26.zip | |
forth: Add step 3
Diffstat (limited to 'forth/reader.fs')
| -rw-r--r-- | forth/reader.fs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/forth/reader.fs b/forth/reader.fs index edd99fc..8f7e3e3 100644 --- a/forth/reader.fs +++ b/forth/reader.fs @@ -135,9 +135,10 @@ defer read-form ( str-addr str-len -- str-addr str-len mal-obj ) ; : read-wrapped ( buf-addr buf-len quote-char sym-addr sym-len -- buf-addr buf-len char mal-list ) - MalSymbol. { sym } ( buf-addr buf-len char ) - read-form mal-nil conj ( buf-addr buf-len char mal-list ) - sym swap conj ; + here { old-here } + MalSymbol. , ( buf-addr buf-len char ) + read-form , ( buf-addr buf-len char ) + old-here here>MalArray ; : read-form2 ( str-addr str-len char -- str-addr str-len char mal-obj ) begin @@ -145,7 +146,7 @@ defer read-form ( str-addr str-len -- str-addr str-len mal-obj ) dup mal-digit? if read-int else dup [char] ( = if [char] ) read-array else dup [char] [ = if [char] ] read-array MalVector new tuck MalVector/list ! else - dup [char] { = if [char] } read-list MalMap new tuck MalMap/list ! else + dup [char] { = if [char] } read-array MalMap new tuck MalMap/list ! else dup [char] " = if read-string-literal else dup [char] ; = if read-comment else dup [char] : = if drop adv-str read-symbol-str MalKeyword. else |
