fix new bug in reader macros without &builder
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
(defmacro year [num &body body]
|
||||
(defMacro year [num &body body]
|
||||
`(#when ,(symbol (+ "year" (symbolNameValue num)))
|
||||
(print (+ "year " (Std.string ,num)))
|
||||
,@body))
|
||||
|
||||
(defmacro day [num &body body]
|
||||
(defMacro day [num &body body]
|
||||
`(#when ,(symbol (+ "day" (symbolNameValue num)))
|
||||
(print (+ "day " (Std.string ,num)))
|
||||
,@body))
|
||||
|
||||
(defmacro dayTodo [num]
|
||||
(defMacro dayTodo [num]
|
||||
`(day ,num (print "TODO")))
|
||||
|
@@ -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"|#))))))
|
||||
|
Reference in New Issue
Block a user