You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change implements an AST walker, Apply, with the capability
to perform various actions (including rewrites) during the AST
walk, in pre- and post-iteration order.
Ideally we would like to have this functionality in the std lib
(go/ast), but as this change contains significant new API, it
is better to first gain some experience with it in x/tools.
Credits: This is joint work of Josh Bleecher Snyder, Roger
Peppe, and myself (author of this CL). The code is based on
proposal golang/go#17108 which I had started, together with an
initial implementation. It was then reworked significantly by
Josh in golang.org/cl/55790, further refined by suggestions
from Roger (allocation reduction), and finally cleaned up a bit
by me (AST simplifications).
Fixesgolang/go#17108.
Change-Id: I56d56b7f2bc5be2acfeb927f76aea7f264bb7b94
Reviewed-on: https://go-review.googlesource.com/77811
Run-TryBot: Robert Griesemer <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Alan Donovan <[email protected]>
0 commit comments