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