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

refactor binary expression parsing. #166

Merged
merged 9 commits into from
Feb 18, 2013
Merged

refactor binary expression parsing. #166

merged 9 commits into from
Feb 18, 2013

Conversation

michaelficarra
Copy link
Owner

Fixes #112. Chained comparison handling really muddied up foldBinaryExpr, unfortunately. Performance appears to have been improved by only around 5%. Still, the grammar itself is much smaller and DRY-er. Assignment and compound assignments still need to be pulled into foldBinaryExpr, but they should be much easier than chained comparison handling.

, '--': CS.PostDecrementOp
},

precedenceHierarchy =
Copy link
Owner Author

Choose a reason for hiding this comment

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

I guess I should probably change this to index by symbols like the others, in case (for example) we want and and && to be at different precedence levels one day.

The assignments are all particular about their LHS, so it's not
appropriate to treat them as any old binary operator. And since seqs are
below assigns in precedence order, they'll stay where they are as well.
@michaelficarra michaelficarra merged commit e7f4c6f into master Feb 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor binary expression parsing
2 participants