mirror of https://github.com/grafana/loki
chore(ast): Update WalkFn signature to return bool (#16989)
The boolean return value indicates whether walking/traversing should be continued with child nodes. This PR does not change any existing traversal behaviour. Signed-off-by: Christian Haudum <christian.haudum@gmail.com>pull/16992/head
parent
1d99f4d86d
commit
0a3230f457
@ -1,7 +1,10 @@ |
||||
package syntax |
||||
|
||||
type WalkFn = func(e Expr) |
||||
// WalkFn is the callback function that gets called whenever a node of the AST is visited.
|
||||
// The return value indicates whether the traversal should continue with the child nodes.
|
||||
type WalkFn = func(e Expr) bool |
||||
|
||||
// Walkable denotes a node of the AST that can be traversed.
|
||||
type Walkable interface { |
||||
Walk(f WalkFn) |
||||
} |
||||
|
Loading…
Reference in new issue