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

Already on GitHub? Sign in to your account

Lazy unconsumed input #68

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

jmettraux commented Sep 12, 2012

see spec/parslet/eager_unconsumed_error_spec.rb for the motivation.

Contributor

jmettraux commented Sep 12, 2012

last commit gets rid of Source#waterline and looks instead at the reparsed cause position to determine if raising UnconsumedInput makes sense. Much closer to the 1.4.0 behaviour, but with the "deepest" flexibility kicking in at will.

Owner

kschiess commented Sep 14, 2012

We've agreed on irc that I would implement a different strategy so that we can compare results. This is currently pending.

@kschiess kschiess added a commit that referenced this pull request Sep 16, 2012

@kschiess kschiess + Rough postfix handling implementation
Relates to issue #68 where jmettraux proposes a new way of handling
input that is not consumed because the parser only matches a prefix.
This commit explores a different strategy where extra input after a
successful parse is treated as parse error in the parse branch it
happens. This generates nice error messages so far.

The implementation is very rough and will probably become neater as time
goes on - but the idea seems to be valid.
4037846

@kschiess kschiess added a commit that referenced this pull request Sep 16, 2012

@kschiess kschiess + Adapted the regression spec from #68
This is more or less the regression spec from #68. It proves that the
last change might be ok.
bf52472
Owner

kschiess commented Sep 16, 2012

John, can you please take a look at this (postfix_handling branch) and verify? I've ran your spec against this implementation successfully, but am guessing that you have other ways of verifying it. If it works out ok, I'll clean up the implementation and merge.

Contributor

jmettraux commented Sep 16, 2012

Hello Kaspar,

I tested it on our application. It works great. Many thanks!

Contributor

floere commented Sep 17, 2012

@jmettraux The Technology Astronauts (ie. me and @kschiess) will be looking forward to your incredibly generous donation to support further development ;)

Contributor

jmettraux commented Sep 17, 2012

Are code donations OK?

Contributor

floere commented Sep 17, 2012

We prefer cold hard cash, but I guess code donations work too ;) Especially if they remove code while still greenlighting the tests.

Contributor

jmettraux commented Sep 17, 2012

You can very easily cut down on the size of Parslet code files by removing trailing white spaces ;-) Funny suggestion for a Welsch nee?

Contributor

jmettraux commented Sep 17, 2012

Contributor

floere commented Sep 17, 2012

Heh, thanks, but no. Kaspar is not there yet, I think. He might or might not arrive there.
I think it's very courteous of people wanting to help the poor Ruby lexer by adding parentheses, so I can sort of understand these people winks to @jmettraux.

Owner

kschiess commented Sep 17, 2012

guys, take this discussion elsewhere.

Owner

kschiess commented Sep 17, 2012

The recent commits on master solve this issue. Again, this has improved parslet a bunch, thanks jmettraux!!

@kschiess kschiess closed this Sep 17, 2012

Contributor

jmettraux commented Sep 17, 2012

Thanks Kaspar, integrated that here, works nicely so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment