parsatron
parsatron copied to clipboard
Bug in `between` function
Hello. I just tried to use the between
function to parse a string literal. However, when comparing the use of between
and a hand-made version of it, between
throws an Unexpected token [...]
error whereas the hand-made version works as intended.
(defparser p-quote [] (char \"))
(println (run (let->> [_ (p-quote)
x (char \a)
_ (p-quote)]
(always x)) "\"a\""))
;=> a
;=> nil
(println (run (between (p-quote)
(char \a)
(p-quote))
"\"a\""))
;=> Unexpected token 'a' at line: 1 column: 2
I don't know if it comes from my file or the library. I use these dependencies:
[[org.clojure/clojure "1.10.1"]
[the/parsatron "0.0.8"]]