]> Cypherpunks repositories - gostls13.git/commit
go/ast: add Preorder go1.23 iterator
authorAlan Donovan <adonovan@google.com>
Mon, 11 Mar 2024 21:16:44 +0000 (17:16 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 15 May 2024 21:44:50 +0000 (21:44 +0000)
commit7730e5b78308b966a1fe913cdd3086c84e0a2e25
treed2c34ee8774f50a9a7c4c2a221b7cd715be8719c
parent3c8f9256067bb3917d7cae05cffdb56dc29e4b3c
go/ast: add Preorder go1.23 iterator

This CL adds a new function Preorder that makes it
easier to iterate over the nodes of a syntax tree.
In particular, break, continue, and return retain
their usual continuations.

Fixes #66339

Change-Id: I438b3c23780c91ed589871ad3b8822d54e8fabc7
Reviewed-on: https://go-review.googlesource.com/c/go/+/570680
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
api/next/66339.txt [new file with mode: 0644]
doc/next/6-stdlib/99-minor/go/ast/66339.md [new file with mode: 0644]
src/go/ast/example_test.go
src/go/ast/walk.go