-
Notifications
You must be signed in to change notification settings - Fork 449
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
= and += #58
Comments
The lexer will return the first rule to match, so if "+" comes before On Sat, Aug 20, 2011 at 12:53 PM, ProjectMoon
Zach Carter |
I see. Is this in the documentation at all? |
This has fixed the problem. |
This is a good point, since flex will use the longest matching rule. I may expose an option to have it behave as flex does. Maybe in the future that behavior will be the default. |
I agree that the lexical part should match the longest rule. Since this makes grouping the same attribute easier. Flex
Both Jison
Both
That's make the lexical part too heavy. |
Maybe this issue should be reopened since people are commenting on it. |
Yes, I'll leave this open until we have an option for longest rule matching. |
There's now a "flex" mode where the lexer uses the rule with the logest match. Just put:
in your lexer grammar before the rules section. |
wow! thank you for improving this. :) |
This almost assuredly a problem where I don't understand quite how to use the lexer. My lexer specifies "=" as '=' and "+=" as 'PLUSEQUAL'.
However, the parser will fail with stuff like:
It will say expecting an = sign instead.
x = 5;
works fine. I'm guessing this has something to do with precedence that I'm missing. I'm using the jscore example. I added a lexer to the file.The grammar is here: https://gist.github.com/1159333
The text was updated successfully, but these errors were encountered: