From 69972a8399efe4abb8567526e90262e131f90d26 Mon Sep 17 00:00:00 2001 From: Chouser Date: Sat, 14 Feb 2015 13:40:07 -0500 Subject: forth: Add step 3 --- forth/reader.fs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'forth/reader.fs') 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 -- cgit v1.2.3