Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Breaking: set `parent` of AST nodes before rules run (fixes #9122) #10014
What is the purpose of this pull request? (put an "X" next to item)
[x] Add something to the core
What changes did you make? (Give an overview)
This was originally merged in 1488b51, but was reverted because it broke a couple of rules. The issue was re-accepted as a breaking change.
Is there anything you'd like reviewers to focus on?
Nothing in particular
Left a few suggestions, but this looks good to me.
There are some performance measurements in #9283 (comment) (from the first time we tried to apply this change). The change does not seem to have a significant performance impact.
This change does require iterating through the list of AST nodes an extra time, but it doesn't require another traversal of the tree, because the ordered list of nodes can be stored from the first traversal.