Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in between function #39

Open
cloudyhug opened this issue Sep 21, 2020 · 0 comments
Open

Bug in between function #39

cloudyhug opened this issue Sep 21, 2020 · 0 comments

Comments

@cloudyhug
Copy link

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"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant