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

Question: parsing multi-line strings #5

Open
maryrosecook opened this issue Jun 8, 2012 · 4 comments
Open

Question: parsing multi-line strings #5

maryrosecook opened this issue Jun 8, 2012 · 4 comments

Comments

@maryrosecook
Copy link

Hiya. Really enjoying using parsley. I've got a grammar up and running that can parse a number of different expressions. However, I'm struggling with defining the rules to allow lists of expressions where each expression is separated by a new line. For example:

"a\na\na\n"

I thought this grammar would parse the string above:

(def parse (parser { :main :block, :space :ws?, :root-tag :root }
:block [#"i" #"\n" :+]
:ws #"[ \t\r]+"
))

But I get a shift/reduce error. Could you offer me any pointers?

Thanks a lot.

@cgrand
Copy link
Owner

cgrand commented Jun 8, 2012

Hi Mary-Rose,
It's #1 on my todo list. Technically Parsley has no lookup so blocks need an end delimiter.
I've got the relevant paper at hand, I just need time.
Sorry for the answer.

@maryrosecook
Copy link
Author

Ah, OK. Thanks. It's good to know I wasn't going crazy! Thank you for the prompt reply.

@dfreeman
Copy link

FWIW, I'd love to see handling for such cases included. I know you've been busy with other projects the last several months, but is there still a chance this will make it into parsley at some point?

Thanks for all your work!

@clojj
Copy link

clojj commented Sep 8, 2013

Is this issue closed ?

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

4 participants