-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cue/ast: implement Visitor walking in terms of func walking
Roger correctly points out that a before func returning a new visitor can be implemented in terms of a before func returning a boolean, we just need to keep state in the receiver in the form of a stack. This is a step towards removing the very recently added WalkVisitor API, given the above, and how the tests still pass with this change. The following commits will incrementally remove the new API. While here, remove the godoc on walk, as it was a remnant from Go's walking API, and not correct given our implementation. We already have a godoc on the exported Walk API which is correct. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: If1b4fbaf974a1a23ebfb211676c5f6ac5832c2d5 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194082 Reviewed-by: Roger Peppe <rogpeppe@gmail.com> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
- Loading branch information
Showing
1 changed file
with
72 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters