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

formality-core parse should permit customizable "commit" point #159

Open
nikomatsakis opened this issue Dec 16, 2023 · 0 comments
Open

formality-core parse should permit customizable "commit" point #159

nikomatsakis opened this issue Dec 16, 2023 · 0 comments

Comments

@nikomatsakis
Copy link
Contributor

If you have a grammar like this...

Expr = Expr . `await`
         | Place 

Place = Id $*Projections

Projections = `.` FieldId

...then a.await will be parsed as a parse error by Place. The reason is that it parses a as an Id (correctly) but when it sees the . it commits to that being followed by a projection. Right now the rule is that we commit if we consumed anything but whitespace. We should let users define the "commit" point.

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

1 participant