about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2024-03-20 22:53:33 -0500
committerCase Duckworth2024-03-20 22:53:33 -0500
commit9bb37432195dcb3d69bc306b76bce61949e1be71 (patch)
tree61534dbb3538a1823eda97805fccb63cea6ca43c
parentSupport dotted lists in reader (diff)
downloadlam-9bb37432195dcb3d69bc306b76bce61949e1be71.tar.gz
lam-9bb37432195dcb3d69bc306b76bce61949e1be71.zip
Correct bugs with whitespace and spurious opening parens
-rw-r--r--read.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/read.lua b/read.lua index 064be61..c3f3f64 100644 --- a/read.lua +++ b/read.lua
@@ -146,6 +146,7 @@ function read.scan (chars)
146 token, chars = consume_symbol(chars) 146 token, chars = consume_symbol(chars)
147 return token, "symbol" 147 return token, "symbol"
148 end 148 end
149 if #chars == 0 then return nil end
149 end 150 end
150 end 151 end
151end 152end
@@ -173,6 +174,7 @@ read.readmacros = {
173 else 174 else
174 table.insert(L, nt) 175 table.insert(L, nt)
175 end 176 end
177 assert(tokens[1], "Unexpected EOF")
176 end 178 end
177 pop(tokens) -- remove final ")" 179 pop(tokens) -- remove final ")"
178 return type.List(L, lt) 180 return type.List(L, lt)