-
Notifications
You must be signed in to change notification settings - Fork 207
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
Separator DSL methods lookahead issue. #391
Comments
Yes it has in master but this changes have not yet been released to npm. I'll reply to your grammar issue separately. |
I'm not sure yet, did you try without MANY_SEP? https://github.com/SAP/chevrotain/blob/master/examples/grammars/json/json.js#L65 |
At what point does this error message appear? I'm guessing a single left parenthesis is not enough to distinguish between those two alternatives. If this is indeed the case a larger example is needed to debug, preferably one with only the grammar (no embedded actions) as it makes it much easier to debug. |
First sneaky issue.This is a invalid argument type issue.
|
MANY_SEP bug.This looks like a bug 😞 . I don't see a problem with the code you have written There different handling for lookahead calculation for MANY and MANY_SEP Is it possible to link to the full code so I can debug this? BTW what is the input token vector which raises the error? |
Optional TypesI'd love to have optional types in ECMAScript. When it would become available I would Infinite loopsI'm very interested in those edge cases. Those are very hard for end users to figure out, Contributing
I'm always happy to receive source code contributions. https://github.com/SAP/chevrotain/issues?q=is%3Aissue+is%3Aopen+label%3ASimple |
Link to last commit to reproduce MANY_SEP bug |
O.k. The ScenarioAt this point we need to decide between a three alternatives: this.OR([
{ALT: () => this.SUBRULE(this.Literal)},
{ALT: () => this.SUBRULE(this.Identifier)},
{ALT: () => this.SUBRULE(this.ParenthesisExpression)
}]); Alternatives 1 and 3 can both start with "(" So several tokens must be looked ahead to distinguish. The BugThe bug is that the separator token is not taken into account when computing the lookahead. The SolutionDo not ignore the separator in the lookahead paths calculation. Why this bug has not surfaced before.It is a pretty strange edge case in which a separator of an optional repetition is required |
The text was updated successfully, but these errors were encountered: