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

Fix lookahead #73 #81

Closed
wants to merge 5 commits into from
Closed

Fix lookahead #73 #81

wants to merge 5 commits into from

Conversation

chtenb
Copy link
Member

@chtenb chtenb commented Feb 8, 2022

Fix #73


Checklist:

  • Added the change to the changelog's "Unreleased" section with a link to this PR and your username
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation in the README and/or documentation directory
  • Added a test for the contribution (if applicable)

Copy link
Member

@jamesdbrock jamesdbrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good and your test shows that it does what you want.

But are you sure you want this? Did you read my comments in #73 ? I think there is a reason why Megaparsec and Attoparsec don't backtrack lookAhead on failure. Is it common to use lookAhead in the left branch of an alternative?

Here's some discussion about the usage of lookAhead. https://markkarpov.com/tutorial/megaparsec.html#notfollowedby-and-lookahead

@chtenb
Copy link
Member Author

chtenb commented Feb 15, 2022

Did you read my comments in #73 ?

For some reason that notification slipped past me. I've replied there.

@chtenb
Copy link
Member Author

chtenb commented Feb 17, 2022

Closing per discussion in #73

@chtenb chtenb closed this Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

lookAhead consumes input on failure
2 participants