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

Chained do IIFE: use grammar, not rewriter #5070

Merged
merged 3 commits into from
Jul 12, 2018

Conversation

helixbass
Copy link
Collaborator

@GeoffreyBooth in playing with whether INDENT_SUPPRESSOR could be used for chaining, I came across #4666/#4672, where the consensus was that a grammar-based solution for handling chained do IIFE eg:

do ->
  a
.b

would be better than the rewriter-based one added in those PRs

At this point I was comfortable tackling a grammar-based solution, so this PR removes that rewriter pass and instead adds tagging in the lexer to distinguish DO (not followed by IIFE) from DO_IIFE and grammar rules for both (and assigns higher precedence to DO_IIFE) - this should be more or less what @jashkenas was pushing for

@GeoffreyBooth GeoffreyBooth changed the base branch from master to ast June 11, 2018 04:45
@GeoffreyBooth
Copy link
Collaborator

@helixbass Do you want to resolve the conflicts so we can wrap this up?

@helixbass
Copy link
Collaborator Author

@GeoffreyBooth ok merged ast

@GeoffreyBooth
Copy link
Collaborator

This looks good to me. @zdenko or @vendethiel or anyone else, any notes?

@GeoffreyBooth GeoffreyBooth merged commit 16b4448 into jashkenas:ast Jul 12, 2018
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.

2 participants