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

Allow blank lines in the description #11

Merged
merged 3 commits into from
Oct 29, 2014
Merged

Conversation

cbandy
Copy link
Contributor

@cbandy cbandy commented Oct 23, 2014

Fixes #10.

This one took a while to track down. By making UntilLineEnd optional, everything up to ( NL / !. ) was optional. At EOF, LineEnd was repeatedly matching !. without advancing the pointer.

Unfortunately, lookahead assertions are bugged with the -switch option, so I had to drop it to make this work.

- Unused buffer
- Optional, one-or-more matches is zero-or-more.
- Gratuitous trim
@cbandy
Copy link
Contributor Author

cbandy commented Oct 23, 2014

After some more sleep, I have one more idea I'd like try.

@cbandy
Copy link
Contributor Author

cbandy commented Oct 23, 2014

All set. Only one EOF is needed in the grammar, at the very end.

@muhqu
Copy link
Owner

muhqu commented Oct 28, 2014

I don't like the appending of the \n much, but I also don't have the time atm to figure out an alternative.

I'm currently only viewing the PR on my phone, will merge and version bump etc as soon as I get back on my macbook.

Oh and thanks for the contribution! :-)

@cbandy
Copy link
Contributor Author

cbandy commented Oct 29, 2014

IIUC, the GherkinParser is the only exported interface to the PEG grammar/parser. It seems reasonable to me that we ... set/ensure some invariants on the buffer that we pass to the parser.

In this case, ensuring every line has an end character makes the PEG grammar/parser simpler and safer.

@muhqu muhqu merged commit 3547174 into muhqu:master Oct 29, 2014
@muhqu
Copy link
Owner

muhqu commented Oct 29, 2014

@cbandy I don't think a parser should alter the input it gets passed in, eventhough the passed variable is immutable. Anyway, I'm more happier to fix the issue than fighting for my opinion on this. ;-)

Thanks for the contribution.

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

Successfully merging this pull request may close these issues.

Unable to parse description with blank lines
2 participants