Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ast_{iter,mapper}: always traverse the attributes right after the loc…
…ation Now that each node that supports attributes also has a location, we want to make the attributed node's location robustly available to AST traversal functions. The best way to do this would be to change the "attributes" traverser to take the node's location as extra parameter. However, doing this changes the type of the traverser interface, with a risk of breaking user code. This may be the right long-term change, but for now we go with something weaker: we ensure that the attributes of a node are always traversed right after the node's location, which lets user track attributed location (if they wish) through a side-effect.
- Loading branch information
Showing
2 changed files
with
37 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters