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

Validate grammar in CLI, disable validation at runtime #253

Merged
merged 1 commit into from
Oct 11, 2021

Conversation

spoenemann
Copy link
Contributor

Closes #196. I also changed a few other things on the way.

@spoenemann spoenemann added this to the v0.2.0 milestone Sep 30, 2021
@spoenemann spoenemann requested a review from msujew September 30, 2021 13:45
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

LGTM! I am able to validate the parser during cli-runtime by using the following setup:

A: B | C;

B: 'a' 'b' 'c' 'd' 'e' 'f' id=STRING;
C: 'a' 'b' 'c' 'd' 'e' 'g' id=STRING;

Which will result in the following error being shown in the console:

Error: Parser Definition Errors detected:
 Ambiguous Alternatives Detected: <1 ,2> in <OR1> inside <A> Rule,
<a, b, c> may appears as a prefix path in all these alternatives.
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.

@msujew msujew merged commit e2607b0 into main Oct 11, 2021
@msujew msujew deleted the spoenemann/validate-grammar-in-196 branch October 11, 2021 11:24
@msujew msujew added cli CLI related issue parser Parser related issue labels Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli CLI related issue parser Parser related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate grammar in CLI, disable validation at runtime
2 participants