fix new bug in reader macros without &builder

This commit is contained in:
2021-11-29 17:06:17 -07:00
parent 67f56aa68d
commit 5706dcaa6b
3 changed files with 9 additions and 8 deletions

View File

@@ -29,10 +29,9 @@
(3 (N num))
(otherwise (throw (+ "Bad facing" facing)))))
(defReaderMacro "" [stream]
(defReaderMacro "" [stream &builder b]
(stream.dropWhitespace)
(if (stream.isEmpty)
null
`(,(ReaderExp.Symbol
(stream.expect "a ship command" (lambda [] (stream.takeChars 1))))
,(ReaderExp.Symbol (stream.expect "a number argument" (lambda [] (stream.takeUntilAndDrop #|"\n"|#)))))))
`(,(b.symbol (stream.expect "a ship command" ->(stream.takeChars 1)))
,(b.symbol (stream.expect "a number argument" ->(stream.takeUntilAndDrop #|"\n"|#))))))