Trait gluon_base::ast::Visitor
source · pub trait Visitor<'a, 'ast> {
type Ident: 'a + 'ast;
// Provided methods
fn visit_expr(&mut self, e: &'a SpannedExpr<'ast, Self::Ident>) { ... }
fn visit_pattern(&mut self, e: &'a SpannedPattern<'ast, Self::Ident>) { ... }
fn visit_spanned_typed_ident(&mut self, id: &'a SpannedIdent<Self::Ident>) { ... }
fn visit_ident(&mut self, id: &'a TypedIdent<Self::Ident>) { ... }
fn visit_alias(&mut self, alias: &'a SpannedAlias<'ast, Self::Ident>) { ... }
fn visit_spanned_ident(&mut self, _: &'a Spanned<Self::Ident, BytePos>) { ... }
fn visit_typ(&mut self, _: &'a ArcType<Self::Ident>) { ... }
fn visit_ast_type(&mut self, s: &'a AstType<'ast, Self::Ident>) { ... }
}
Expand description
Visitor trait which walks over expressions calling visit_*
on all encountered elements. By
default the visit_*
functions just walk the tree. If they are overridden the user will need to
call walk_*
to continue traversing the tree.