Expand description
AST Visitor trait and walk functions for Shape.
This module provides a visitor pattern for traversing the AST. All variants are explicitly handled - no wildcards.
§Per-Variant Expression Methods
The Visitor trait provides fine-grained per-variant methods for expressions.
Each method has a default implementation that returns true (continue into
children). Override only the variants you care about.
The visit order for each expression is:
visit_expr(expr)— coarse pre-visit hook; returnfalseto skip entirelyvisit_<variant>(expr, span)— per-variant hook; returnfalseto skip children- Walk children recursively
leave_expr(expr)— post-visit hook
Traits§
- Visitor
- A visitor trait for traversing Shape AST nodes.
Functions§
- walk_
expr - Walk an expression - ALL VARIANTS HANDLED EXPLICITLY
- walk_
function - Walk a function definition
- walk_
item - Walk an item
- walk_
program - Walk a program, visiting all items
- walk_
query - Walk a query
- walk_
stmt - Walk a statement