ensure :errors is always a tuple or array, never nil; allows (empty? (scanner :errors)) to work as a test for errors
This commit is contained in:
parent
b0c912b16c
commit
b5d23b26ec
|
@ -327,7 +327,7 @@
|
||||||
(if (at-end? scanner)
|
(if (at-end? scanner)
|
||||||
(let [scanner (add-token (add-token scanner :break) :eof)]
|
(let [scanner (add-token (add-token scanner :break) :eof)]
|
||||||
{:tokens (get scanner :tokens)
|
{:tokens (get scanner :tokens)
|
||||||
:errors (get scanner :errors)})
|
:errors (get scanner :errors [])})
|
||||||
(recur (-> scanner (scan-token) (next-token)))))
|
(recur (-> scanner (scan-token) (next-token)))))
|
||||||
(recur (new-scanner source input)))
|
(recur (new-scanner source input)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user