You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cue/ast: move WalkVisitor and Visitor to astutil and unexport them
https://cuelang.org/cl/1194006 added ast.WalkVisitor and ast.Visitor
so that the cue/ast and cue/ast/astutil packages could share the code
rather than duplicating it.
Roger correctly pointed out that ast.Walk is equally as powerful,
one just needs to keep enough state somewhere like a method receiver.
The new ast.stackVisitor type just added does exactly that.
We can now move WalkVisitor and stackVisitor into cue/ast/astutil
and unexport them, as they are the only users across the repository.
The APIs were just exposed in master and not included in any release.
Later on I would like to remove the needed for his walkVisitor layer,
instead having the Sanitize and Resolve APIs keep their own state
on top of the ast.Walk API. However, that work is not urgent,
and would very easily be non-trivial, so leave a TODO for now.
Signed-off-by: Daniel Martí <[email protected]>
Change-Id: Ic35b997645da193aae42bd0489d5f5b1a0cdd071
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194084
Reviewed-by: Roger Peppe <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
0 commit comments