Skip to content
Discussion options

You must be logged in to vote

The replace call just queues up the replacement; it doesn't go into the tree (really the result of rewriting is a new tree) until the end when all changes are applied in one go. If you create a new subtree to replace, and want to replace things within that new subtree, you need to actually visit that subtree explicitly since visitDefault won't know about it. Alternatively you can do it in multiple passes, but doing it one is going to be more efficient.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@MikePopoloski
Comment options

Answer selected by fischeti
Comment options

You must be logged in to vote
2 replies
@MikePopoloski
Comment options

@fischeti
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants