go/src/cmd
Matthew Dempsky 8165256bc2 [dev.typeparams] cmd/compile/internal/syntax: go/ast-style walk API
This CL adds go/ast's Visitor, Walk, and Inspect functions to package
syntax. Having functions with the same API and semantics as their
go/ast counterparts reduces the mental load of context switching
between go/ast and syntax.

It also renames the existing Walk function into Crawl, and marks it as
a deprecated wrapper around Inspect. (I named it "Crawl" because it's
less functional than "Walk"... get it??)

There aren't that many callers to Crawl, so we can probably remove it
in the future. But it doesn't seem pressing, and I'm more concerned
about the risk of forgetting to invert a bool condition somewhere.

Change-Id: Ib2fb275873a1d1a730249c9cb584864cb6ec370e
Reviewed-on: https://go-review.googlesource.com/c/go/+/330429
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-06-23 22:23:16 +00:00
..
addr2line
api cmd/api: disallow silent API additions after api/go1.n.txt is created 2021-05-03 19:14:16 +00:00
asm cmd/asm: restore supporting of *1 scaling on ARM64 2021-06-16 14:23:50 +00:00
buildid
cgo cmd/link, cmd/cgo: support -flto in CFLAGS 2021-06-01 19:59:18 +00:00
compile [dev.typeparams] cmd/compile/internal/syntax: go/ast-style walk API 2021-06-23 22:23:16 +00:00
cover
dist cmd/internal/sys: mark windows/arm64 as c-shared-capable 2021-06-14 20:36:54 +00:00
doc
fix
go [dev.typeparams] all: merge master (16e82be) into dev.typeparams 2021-06-22 00:35:08 +07:00
gofmt [dev.typeparams] cmd/gofmt: remove typeparams guards 2021-06-22 17:02:41 +00:00
internal [dev.typeparams] all: merge master (785a8f6) into dev.typeparams 2021-06-16 14:59:13 +07:00
link [dev.typeparams] all: merge master (785a8f6) into dev.typeparams 2021-06-16 14:59:13 +07:00
nm
objdump cmd/internal/objfile: emit better error for Go object of a different version 2021-04-30 16:53:35 +00:00
pack
pprof cmd/pprof,runtime/pprof: disable test on more broken platforms 2021-06-17 21:58:54 +00:00
test2json
trace
vendor cmd/go: in Go 1.17+ modules, add indirect go.mod dependencies separately from direct ones 2021-06-08 19:32:28 +00:00
vet
README.vendor
go.mod cmd/go: in Go 1.17+ modules, add indirect go.mod dependencies separately from direct ones 2021-06-08 19:32:28 +00:00
go.sum cmd/go: in Go 1.17+ modules, add indirect go.mod dependencies separately from direct ones 2021-06-08 19:32:28 +00:00

README.vendor

See src/README.vendor for information on loading vendored packages
and updating the vendor directory.