Skip to content

Chained do IIFE: use grammar, not rewriter#5070

Merged
GeoffreyBooth merged 3 commits intojashkenas:astfrom
helixbass:do-iife-grammar
Jul 12, 2018
Merged

Chained do IIFE: use grammar, not rewriter#5070
GeoffreyBooth merged 3 commits intojashkenas:astfrom
helixbass:do-iife-grammar

Conversation

@helixbass
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

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

@helixbass
Copy link
Copy Markdown
Collaborator Author

@GeoffreyBooth ok merged ast

@GeoffreyBooth
Copy link
Copy Markdown
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