-
Notifications
You must be signed in to change notification settings - Fork 201
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
Increase DSL methods suffix indices. #606
Comments
I personally never needed more. It can be fairly easily increased. // existing API
CONSUME1(SemiColon ,{errMsg:"missing semicolon at end of statement"})
// using argument
CONSUME(1, SemiColon ,{errMsg:"missing semicolon at end of statement"})
// cannot be "compiled" as it the index is resolved at runtime
var x = 2
CONSUME(x, SemiColon ,{errMsg:"missing semicolon at end of statement"})
// using argument in config object - forces always using config object
CONSUME(SemiColon ,{idx:2)
|
It's also possible to use overloaded getters as well. The ES6 proxy system supports this, so it's possible to do |
I am guessing the proxy approach would have performance implications. |
To the best of my understanding the proxy dynamic property getter does not work on IE11 I guess that I would just add additional methods to reduce the chance of running out. Also in the longer term when Chevrotain would hopefully have declarative apis #480
Could be used to enable unlimited suffixes as the added verbosity would be less meaningful |
So the fix increased it to 9? |
Yes. will be released in 2.0 soon. |
I will re-open this issue as a reminder to update to grammar analysis code too. |
It appears that there's a limit to the occurrence index from 1 to 5. While this is useful most of the time. It should be possible to make this number dynamic by moving it into a parameter instead, or perhaps using overloaded getters and setters to refere to an arbitrary number of indices.
What was the reason to stop at 5?
The text was updated successfully, but these errors were encountered: