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

Correctly detect failed Apply() parsers #38

Merged
merged 1 commit into from
May 30, 2018

Conversation

nblumhardt
Copy link
Member

This fixes #37 and makes a number of small improvements; spinning it up via the JSON example :-)...

screenshot from 2018-05-30 18-54-44

The number one issue is that Apply() should never backtrack if the applied parser fails. Communicating this out to combinators that make these decisions - particularly Or() - need to see the Apply() parser as having consumed input. This interacts with error location reporting, which makes for some fun juggling of locations, remainders, positions etc.

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.

Apply() failures in token parsers are seen as consuming no input
1 participant