moar bugfixes
This commit is contained in:
parent
3f16e45204
commit
248e424993
|
@ -186,21 +186,17 @@
|
|||
|
||||
(defn- add-string
|
||||
[scanner]
|
||||
(print "Adding string")
|
||||
(defn recur [scanner buff interpolate?]
|
||||
(let [char (current-char scanner)]
|
||||
(print "scanning current char: " char)
|
||||
(case char
|
||||
"{" (recur (advance scanner) (buffer/push buff char) true)
|
||||
# allow multiline strings
|
||||
"\n" (recur (update (advance scanner) :line inc) (buffer/push buff char) interpolate?)
|
||||
"\"" (add-token (advance scanner) (if interpolate? :interpolated :string)(string buff))
|
||||
"\\" (let [next (next-char scanner)]
|
||||
(print "found slash")
|
||||
(print "next char: " next)
|
||||
(if (= next "{")
|
||||
(do
|
||||
(print "escaped brace")
|
||||
(buffer/push buff char)
|
||||
(buffer/push buff next)
|
||||
(recur (advance (advance scanner)) buff interpolate?))
|
||||
(recur (advance scanner) (buffer/push buff char) interpolate?)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user