aboutsummaryrefslogtreecommitdiff
path: root/forth/reader.fs
diff options
context:
space:
mode:
authorChouser <chouser@n01se.net>2015-02-07 10:01:31 -0500
committerChouser <chouser@n01se.net>2015-02-21 13:22:44 -0500
commit2e78e94eb894e511e583db03286a3c13b9ecc780 (patch)
treee74193c142d3efd8486329458f7ed639943afc19 /forth/reader.fs
parent168fb5dc56fee6653816ee8236259940e575c7ec (diff)
downloadmal-2e78e94eb894e511e583db03286a3c13b9ecc780.tar.gz
mal-2e78e94eb894e511e583db03286a3c13b9ecc780.zip
forth: Finished step 1
Diffstat (limited to 'forth/reader.fs')
-rw-r--r--forth/reader.fs10
1 files changed, 9 insertions, 1 deletions
diff --git a/forth/reader.fs b/forth/reader.fs
index 57f3e8d..7ff46fd 100644
--- a/forth/reader.fs
+++ b/forth/reader.fs
@@ -126,6 +126,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-list else
dup [char] [ = if [char] ] read-list MalVector new tuck MalVector/list ! else
+ dup [char] { = if [char] } read-list 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 s" deref" read-wrapped else
@@ -137,8 +138,15 @@ defer read-form ( str-addr str-len -- str-addr str-len mal-obj )
else s" unquote" read-wrapped
endif
else
+ dup [char] ^ = if
+ drop adv-str
+ read-form { meta } read-form { obj }
+ meta mal-nil conj
+ obj swap conj
+ s" with-meta" MalSymbol. swap conj
+ else
read-symbol-str MalSymbol.
- endif endif endif endif endif endif endif endif endif
+ endif endif endif endif endif endif endif endif endif endif endif
dup skip-elem =
while drop repeat ;
' read-form2 is read-form