]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: simplify writer.collectDecls
authorMatthew Dempsky <mdempsky@google.com>
Wed, 23 Jun 2021 21:04:11 +0000 (14:04 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 24 Jun 2021 06:58:33 +0000 (06:58 +0000)
commit9bdbf73c98b21c602f1304993176a6db0714f802
treedb2700f9ad12a0a889f09eaad6cffc1aa571c5fa
parentee4fc0c1bc300f181388ef6dd187ca8b8737efd2
[dev.typeparams] cmd/compile: simplify writer.collectDecls

The previous code for walking the syntax AST to find declarations
needed to know whether a declaration appeared within block scope, but
syntax.Crawl (née syntax.Walk) made that somewhat awkward.

This CL simplifies it a little, taking advantage of syntax.Walk's
support for keeping per-subtree state.

Change-Id: I03c7da8c44bec40f88e983852dc6bbab7e6ac13c
Reviewed-on: https://go-review.googlesource.com/c/go/+/330549
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/noder/writer.go