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

Warn on never-taken branch #34

Open
Dante-Broggi opened this issue Jul 16, 2023 · 0 comments
Open

Warn on never-taken branch #34

Dante-Broggi opened this issue Jul 16, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Dante-Broggi
Copy link

Is your feature request related to a problem? Please describe.

When translating a grammar from a grammar language with unordered choice (eg: BNF) it may happen that a simple transliteration results in branches being unable of being taken, simply due to being in an incorrect order for pest.
Eg:
X = { Identifier | Keyword }

This would also help if a rule is changed to be an option on an earlier rule:
Eg:

Item = { … | Statement | Declaration | … }
Statement = { … | Declaration /* new */ | … }

Describe the solution you'd like

It would be nice if the pest extension would warn if a latter branch is a strict subset of an earlier option in a rule.

@Dante-Broggi Dante-Broggi added the enhancement New feature or request label Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant