Skip to content

Add --expect keyword to allow user to specify the expected number of conflicts - #575

Open
MatthewDaggitt wants to merge 1 commit into
BNFC:masterfrom
MatthewDaggitt:expect-option
Open

MatthewDaggitt wants to merge 1 commit into
BNFC:masterfrom
MatthewDaggitt:expect-option

Conversation

@MatthewDaggitt

@MatthewDaggitt MatthewDaggitt commented Nov 25, 2026 •

Copy link
Copy Markdown

In Vehicle I would quite like to enforce that there are no conflicts in the generated parser. Unfortunately BNFC doesn't currently allow us to hook into the parser backend to specify this.

This PR adds a new --expect command line option that adds the corresponding %expect pragma to the generated grammar. This is my first time contributing to this repo, so please let me know if I'm getting something wrong e.g. violating your style guide @andreasabel!

This option is off by default so this is very conservative change 🤞

@MatthewDaggitt

MatthewDaggitt commented Nov 25, 2026 •

Copy link
Copy Markdown
Author

Pretty sure test failures are unrelated 🤞

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.

1 participant