tools/go
Robert Griesemer 6d70fb2e85 go/ast/astutil: add Apply, for rewriting Go ASTs
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).

Fixes golang/go#17108.

Change-Id: I56d56b7f2bc5be2acfeb927f76aea7f264bb7b94
Reviewed-on: https://go-review.googlesource.com/77811
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2017-11-16 01:30:56 +00:00
..
ast/astutil go/ast/astutil: add Apply, for rewriting Go ASTs 2017-11-16 01:30:56 +00:00
buildutil x/tools/go/buildutil: remove unused function 2017-03-01 14:53:57 +00:00
callgraph tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
gccgoexportdata go/gccgoexportdata: correctly handle archive files containing string tables 2016-11-09 21:28:38 +00:00
gcexportdata go/gcexportdata: fix test again (fix older builds) 2017-06-08 21:12:18 +00:00
gcimporter15 go/gcimporter: update to latest copy from master 2017-04-25 22:48:49 +00:00
internal/gccgoimporter x/tools/go/internal/gccgoimporter: remove unused method 2017-03-01 14:54:10 +00:00
loader go/loader: Fix thinko in FindPackage hook signature 2017-07-05 16:38:48 +00:00
pointer go/pointer: implement extended queries 2017-03-06 04:11:41 +00:00
ssa go/ssa: remove statement with no effect 2017-06-15 21:28:45 +00:00
types/typeutil tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
vcs go/vcs: reject update of VCS inside VCS 2017-10-05 08:21:07 +00:00