aboutsummaryrefslogtreecommitdiff
path: root/forth/reader.fs
diff options
context:
space:
mode:
authorChouser <chouser@n01se.net>2015-02-17 18:47:23 -0500
committerChouser <chouser@n01se.net>2015-02-21 13:22:44 -0500
commit580c4eef9d61f39264813b662fe5335c3c3c4ee5 (patch)
tree0ab0a822f737e307084f8c4b391c3ac9abf44da9 /forth/reader.fs
parente82947d00f700558500e85e22aaf187544769a2e (diff)
downloadmal-580c4eef9d61f39264813b662fe5335c3c3c4ee5.tar.gz
mal-580c4eef9d61f39264813b662fe5335c3c3c4ee5.zip
forth: Add step 9, just try*/throw
- Moved some stuff out of printer into str, to support throwing strings in types.fs - Fixed an apparently completely broken 'nth' - Still failing 120 step9 tests
Diffstat (limited to 'forth/reader.fs')
-rw-r--r--forth/reader.fs8
1 files changed, 4 insertions, 4 deletions
diff --git a/forth/reader.fs b/forth/reader.fs
index 1daa650..134749b 100644
--- a/forth/reader.fs
+++ b/forth/reader.fs
@@ -66,7 +66,7 @@ defer read-form ( str-addr str-len -- str-addr str-len mal-obj )
drop \ drop leading quote
begin ( in-addr in-len )
adv-str over 0= if
- 2drop s\" expected '\"', got EOF\n" safe-type 1 throw
+ 2drop 0 0 s\" expected '\"', got EOF" ...throw-str
endif
dup [char] " <>
while
@@ -87,9 +87,9 @@ defer read-form ( str-addr str-len -- str-addr str-len mal-obj )
begin ( str-addr str-len char )
skip-spaces ( str-addr str-len non-space-char )
over 0= if
- drop 2drop
- s\" expected '" close-char str-append-char
- s\" ', got EOF" str-append safe-type 1 throw
+ drop 2drop 0 0 s" ', got EOF"
+ close-char pad ! pad 1
+ s" expected '" ...throw-str
endif
dup close-char <>
while ( str-addr str-len non-space-non-paren-char )