Trait Visitor

Source
pub trait Visitor: Sized {
Show 125 methods // Provided methods fn on_alias(&mut self, node: &Alias) { ... } fn on_and(&mut self, node: &And) { ... } fn on_and_asgn(&mut self, node: &AndAsgn) { ... } fn on_arg(&mut self, node: &Arg) { ... } fn on_args(&mut self, node: &Args) { ... } fn on_array(&mut self, node: &Array) { ... } fn on_array_pattern(&mut self, node: &ArrayPattern) { ... } fn on_array_pattern_with_tail(&mut self, node: &ArrayPatternWithTail) { ... } fn on_back_ref(&mut self, node: &BackRef) { ... } fn on_begin(&mut self, node: &Begin) { ... } fn on_block(&mut self, node: &Block) { ... } fn on_blockarg(&mut self, node: &Blockarg) { ... } fn on_block_pass(&mut self, node: &BlockPass) { ... } fn on_break(&mut self, node: &Break) { ... } fn on_case(&mut self, node: &Case) { ... } fn on_case_match(&mut self, node: &CaseMatch) { ... } fn on_casgn(&mut self, node: &Casgn) { ... } fn on_cbase(&mut self, node: &Cbase) { ... } fn on_class(&mut self, node: &Class) { ... } fn on_complex(&mut self, node: &Complex) { ... } fn on_const(&mut self, node: &Const) { ... } fn on_const_pattern(&mut self, node: &ConstPattern) { ... } fn on_c_send(&mut self, node: &CSend) { ... } fn on_cvar(&mut self, node: &Cvar) { ... } fn on_cvasgn(&mut self, node: &Cvasgn) { ... } fn on_def(&mut self, node: &Def) { ... } fn on_defined(&mut self, node: &Defined) { ... } fn on_defs(&mut self, node: &Defs) { ... } fn on_dstr(&mut self, node: &Dstr) { ... } fn on_dsym(&mut self, node: &Dsym) { ... } fn on_e_flip_flop(&mut self, node: &EFlipFlop) { ... } fn on_empty_else(&mut self, node: &EmptyElse) { ... } fn on_encoding(&mut self, node: &Encoding) { ... } fn on_ensure(&mut self, node: &Ensure) { ... } fn on_erange(&mut self, node: &Erange) { ... } fn on_false(&mut self, node: &False) { ... } fn on_file(&mut self, node: &File) { ... } fn on_find_pattern(&mut self, node: &FindPattern) { ... } fn on_float(&mut self, node: &Float) { ... } fn on_for(&mut self, node: &For) { ... } fn on_forward_arg(&mut self, node: &ForwardArg) { ... } fn on_forwarded_args(&mut self, node: &ForwardedArgs) { ... } fn on_gvar(&mut self, node: &Gvar) { ... } fn on_gvasgn(&mut self, node: &Gvasgn) { ... } fn on_hash(&mut self, node: &Hash) { ... } fn on_hash_pattern(&mut self, node: &HashPattern) { ... } fn on_heredoc(&mut self, node: &Heredoc) { ... } fn on_if(&mut self, node: &If) { ... } fn on_if_guard(&mut self, node: &IfGuard) { ... } fn on_i_flip_flop(&mut self, node: &IFlipFlop) { ... } fn on_if_mod(&mut self, node: &IfMod) { ... } fn on_if_ternary(&mut self, node: &IfTernary) { ... } fn on_index(&mut self, node: &Index) { ... } fn on_index_asgn(&mut self, node: &IndexAsgn) { ... } fn on_in_pattern(&mut self, node: &InPattern) { ... } fn on_int(&mut self, node: &Int) { ... } fn on_irange(&mut self, node: &Irange) { ... } fn on_ivar(&mut self, node: &Ivar) { ... } fn on_ivasgn(&mut self, node: &Ivasgn) { ... } fn on_kwarg(&mut self, node: &Kwarg) { ... } fn on_kwargs(&mut self, node: &Kwargs) { ... } fn on_kw_begin(&mut self, node: &KwBegin) { ... } fn on_kwnilarg(&mut self, node: &Kwnilarg) { ... } fn on_kwoptarg(&mut self, node: &Kwoptarg) { ... } fn on_kwrestarg(&mut self, node: &Kwrestarg) { ... } fn on_kwsplat(&mut self, node: &Kwsplat) { ... } fn on_lambda(&mut self, node: &Lambda) { ... } fn on_line(&mut self, node: &Line) { ... } fn on_lvar(&mut self, node: &Lvar) { ... } fn on_lvasgn(&mut self, node: &Lvasgn) { ... } fn on_masgn(&mut self, node: &Masgn) { ... } fn on_match_alt(&mut self, node: &MatchAlt) { ... } fn on_match_as(&mut self, node: &MatchAs) { ... } fn on_match_current_line(&mut self, node: &MatchCurrentLine) { ... } fn on_match_nil_pattern(&mut self, node: &MatchNilPattern) { ... } fn on_match_pattern(&mut self, node: &MatchPattern) { ... } fn on_match_pattern_p(&mut self, node: &MatchPatternP) { ... } fn on_match_rest(&mut self, node: &MatchRest) { ... } fn on_match_var(&mut self, node: &MatchVar) { ... } fn on_match_with_lvasgn(&mut self, node: &MatchWithLvasgn) { ... } fn on_mlhs(&mut self, node: &Mlhs) { ... } fn on_module(&mut self, node: &Module) { ... } fn on_next(&mut self, node: &Next) { ... } fn on_nil(&mut self, node: &Nil) { ... } fn on_nth_ref(&mut self, node: &NthRef) { ... } fn on_numblock(&mut self, node: &Numblock) { ... } fn on_op_asgn(&mut self, node: &OpAsgn) { ... } fn on_optarg(&mut self, node: &Optarg) { ... } fn on_or(&mut self, node: &Or) { ... } fn on_or_asgn(&mut self, node: &OrAsgn) { ... } fn on_pair(&mut self, node: &Pair) { ... } fn on_pin(&mut self, node: &Pin) { ... } fn on_postexe(&mut self, node: &Postexe) { ... } fn on_preexe(&mut self, node: &Preexe) { ... } fn on_procarg0(&mut self, node: &Procarg0) { ... } fn on_rational(&mut self, node: &Rational) { ... } fn on_redo(&mut self, node: &Redo) { ... } fn on_regexp(&mut self, node: &Regexp) { ... } fn on_reg_opt(&mut self, node: &RegOpt) { ... } fn on_rescue(&mut self, node: &Rescue) { ... } fn on_rescue_body(&mut self, node: &RescueBody) { ... } fn on_restarg(&mut self, node: &Restarg) { ... } fn on_retry(&mut self, node: &Retry) { ... } fn on_return(&mut self, node: &Return) { ... } fn on_s_class(&mut self, node: &SClass) { ... } fn on_self_(&mut self, node: &Self_) { ... } fn on_send(&mut self, node: &Send) { ... } fn on_shadowarg(&mut self, node: &Shadowarg) { ... } fn on_splat(&mut self, node: &Splat) { ... } fn on_str(&mut self, node: &Str) { ... } fn on_super(&mut self, node: &Super) { ... } fn on_sym(&mut self, node: &Sym) { ... } fn on_true(&mut self, node: &True) { ... } fn on_undef(&mut self, node: &Undef) { ... } fn on_unless_guard(&mut self, node: &UnlessGuard) { ... } fn on_until(&mut self, node: &Until) { ... } fn on_until_post(&mut self, node: &UntilPost) { ... } fn on_when(&mut self, node: &When) { ... } fn on_while(&mut self, node: &While) { ... } fn on_while_post(&mut self, node: &WhilePost) { ... } fn on_x_heredoc(&mut self, node: &XHeredoc) { ... } fn on_xstr(&mut self, node: &Xstr) { ... } fn on_yield(&mut self, node: &Yield) { ... } fn on_z_super(&mut self, node: &ZSuper) { ... } fn visit(&mut self, node: &Node) { ... }
}
Expand description

Common trait for all visitors

use lib_ruby_parser::{
    nodes::{Class, Const},
    traverse::visitor::{visit_class, Visitor},
    Node,
};

struct ClassesCollector {
    classes: Vec<String>,
}

impl Visitor for ClassesCollector {
    fn on_class(&mut self, node: &Class) {
        self.classes.push(fetch_const_name(&node.name));
        visit_class(self, node);
    }
}

fn fetch_const_name(name: &Node) -> String {
    match name {
        Node::Const(Const { name, .. }) => name.to_owned(),
        other => panic!("Don't know how to fetch const name from {:?}", other),
    }
}

use lib_ruby_parser::{Parser, ParserOptions, ParserResult};
let parser = Parser::new(
    b"class A; class B; end; end".to_vec(),
    ParserOptions::default(),
);
let ParserResult { ast, .. } = parser.do_parse();
let ast = ast.unwrap();

let mut collector = ClassesCollector { classes: vec![] };
collector.visit(&ast);
assert_eq!(
    collector.classes,
    vec![String::from("A"), String::from("B")]
);

Provided Methods§

Source

fn on_alias(&mut self, node: &Alias)

Invoked by a Visitor on entering into Alias node.

Has a default implementation, but you can override it and (optionally) call visit_alias(node) to continue traversing.

Source

fn on_and(&mut self, node: &And)

Invoked by a Visitor on entering into And node.

Has a default implementation, but you can override it and (optionally) call visit_and(node) to continue traversing.

Source

fn on_and_asgn(&mut self, node: &AndAsgn)

Invoked by a Visitor on entering into AndAsgn node.

Has a default implementation, but you can override it and (optionally) call visit_and_asgn(node) to continue traversing.

Source

fn on_arg(&mut self, node: &Arg)

Invoked by a Visitor on entering into Arg node.

Has a default implementation, but you can override it and (optionally) call visit_arg(node) to continue traversing.

Source

fn on_args(&mut self, node: &Args)

Invoked by a Visitor on entering into Args node.

Has a default implementation, but you can override it and (optionally) call visit_args(node) to continue traversing.

Source

fn on_array(&mut self, node: &Array)

Invoked by a Visitor on entering into Array node.

Has a default implementation, but you can override it and (optionally) call visit_array(node) to continue traversing.

Source

fn on_array_pattern(&mut self, node: &ArrayPattern)

Invoked by a Visitor on entering into ArrayPattern node.

Has a default implementation, but you can override it and (optionally) call visit_array_pattern(node) to continue traversing.

Source

fn on_array_pattern_with_tail(&mut self, node: &ArrayPatternWithTail)

Invoked by a Visitor on entering into ArrayPatternWithTail node.

Has a default implementation, but you can override it and (optionally) call visit_array_pattern_with_tail(node) to continue traversing.

Source

fn on_back_ref(&mut self, node: &BackRef)

Invoked by a Visitor on entering into BackRef node.

Has a default implementation, but you can override it and (optionally) call visit_back_ref(node) to continue traversing.

Source

fn on_begin(&mut self, node: &Begin)

Invoked by a Visitor on entering into Begin node.

Has a default implementation, but you can override it and (optionally) call visit_begin(node) to continue traversing.

Source

fn on_block(&mut self, node: &Block)

Invoked by a Visitor on entering into Block node.

Has a default implementation, but you can override it and (optionally) call visit_block(node) to continue traversing.

Source

fn on_blockarg(&mut self, node: &Blockarg)

Invoked by a Visitor on entering into Blockarg node.

Has a default implementation, but you can override it and (optionally) call visit_blockarg(node) to continue traversing.

Source

fn on_block_pass(&mut self, node: &BlockPass)

Invoked by a Visitor on entering into BlockPass node.

Has a default implementation, but you can override it and (optionally) call visit_block_pass(node) to continue traversing.

Source

fn on_break(&mut self, node: &Break)

Invoked by a Visitor on entering into Break node.

Has a default implementation, but you can override it and (optionally) call visit_break(node) to continue traversing.

Source

fn on_case(&mut self, node: &Case)

Invoked by a Visitor on entering into Case node.

Has a default implementation, but you can override it and (optionally) call visit_case(node) to continue traversing.

Source

fn on_case_match(&mut self, node: &CaseMatch)

Invoked by a Visitor on entering into CaseMatch node.

Has a default implementation, but you can override it and (optionally) call visit_case_match(node) to continue traversing.

Source

fn on_casgn(&mut self, node: &Casgn)

Invoked by a Visitor on entering into Casgn node.

Has a default implementation, but you can override it and (optionally) call visit_casgn(node) to continue traversing.

Source

fn on_cbase(&mut self, node: &Cbase)

Invoked by a Visitor on entering into Cbase node.

Has a default implementation, but you can override it and (optionally) call visit_cbase(node) to continue traversing.

Source

fn on_class(&mut self, node: &Class)

Invoked by a Visitor on entering into Class node.

Has a default implementation, but you can override it and (optionally) call visit_class(node) to continue traversing.

Source

fn on_complex(&mut self, node: &Complex)

Invoked by a Visitor on entering into Complex node.

Has a default implementation, but you can override it and (optionally) call visit_complex(node) to continue traversing.

Source

fn on_const(&mut self, node: &Const)

Invoked by a Visitor on entering into Const node.

Has a default implementation, but you can override it and (optionally) call visit_const(node) to continue traversing.

Source

fn on_const_pattern(&mut self, node: &ConstPattern)

Invoked by a Visitor on entering into ConstPattern node.

Has a default implementation, but you can override it and (optionally) call visit_const_pattern(node) to continue traversing.

Source

fn on_c_send(&mut self, node: &CSend)

Invoked by a Visitor on entering into CSend node.

Has a default implementation, but you can override it and (optionally) call visit_c_send(node) to continue traversing.

Source

fn on_cvar(&mut self, node: &Cvar)

Invoked by a Visitor on entering into Cvar node.

Has a default implementation, but you can override it and (optionally) call visit_cvar(node) to continue traversing.

Source

fn on_cvasgn(&mut self, node: &Cvasgn)

Invoked by a Visitor on entering into Cvasgn node.

Has a default implementation, but you can override it and (optionally) call visit_cvasgn(node) to continue traversing.

Source

fn on_def(&mut self, node: &Def)

Invoked by a Visitor on entering into Def node.

Has a default implementation, but you can override it and (optionally) call visit_def(node) to continue traversing.

Source

fn on_defined(&mut self, node: &Defined)

Invoked by a Visitor on entering into Defined node.

Has a default implementation, but you can override it and (optionally) call visit_defined(node) to continue traversing.

Source

fn on_defs(&mut self, node: &Defs)

Invoked by a Visitor on entering into Defs node.

Has a default implementation, but you can override it and (optionally) call visit_defs(node) to continue traversing.

Source

fn on_dstr(&mut self, node: &Dstr)

Invoked by a Visitor on entering into Dstr node.

Has a default implementation, but you can override it and (optionally) call visit_dstr(node) to continue traversing.

Source

fn on_dsym(&mut self, node: &Dsym)

Invoked by a Visitor on entering into Dsym node.

Has a default implementation, but you can override it and (optionally) call visit_dsym(node) to continue traversing.

Source

fn on_e_flip_flop(&mut self, node: &EFlipFlop)

Invoked by a Visitor on entering into EFlipFlop node.

Has a default implementation, but you can override it and (optionally) call visit_e_flip_flop(node) to continue traversing.

Source

fn on_empty_else(&mut self, node: &EmptyElse)

Invoked by a Visitor on entering into EmptyElse node.

Has a default implementation, but you can override it and (optionally) call visit_empty_else(node) to continue traversing.

Source

fn on_encoding(&mut self, node: &Encoding)

Invoked by a Visitor on entering into Encoding node.

Has a default implementation, but you can override it and (optionally) call visit_encoding(node) to continue traversing.

Source

fn on_ensure(&mut self, node: &Ensure)

Invoked by a Visitor on entering into Ensure node.

Has a default implementation, but you can override it and (optionally) call visit_ensure(node) to continue traversing.

Source

fn on_erange(&mut self, node: &Erange)

Invoked by a Visitor on entering into Erange node.

Has a default implementation, but you can override it and (optionally) call visit_erange(node) to continue traversing.

Source

fn on_false(&mut self, node: &False)

Invoked by a Visitor on entering into False node.

Has a default implementation, but you can override it and (optionally) call visit_false(node) to continue traversing.

Source

fn on_file(&mut self, node: &File)

Invoked by a Visitor on entering into File node.

Has a default implementation, but you can override it and (optionally) call visit_file(node) to continue traversing.

Source

fn on_find_pattern(&mut self, node: &FindPattern)

Invoked by a Visitor on entering into FindPattern node.

Has a default implementation, but you can override it and (optionally) call visit_find_pattern(node) to continue traversing.

Source

fn on_float(&mut self, node: &Float)

Invoked by a Visitor on entering into Float node.

Has a default implementation, but you can override it and (optionally) call visit_float(node) to continue traversing.

Source

fn on_for(&mut self, node: &For)

Invoked by a Visitor on entering into For node.

Has a default implementation, but you can override it and (optionally) call visit_for(node) to continue traversing.

Source

fn on_forward_arg(&mut self, node: &ForwardArg)

Invoked by a Visitor on entering into ForwardArg node.

Has a default implementation, but you can override it and (optionally) call visit_forward_arg(node) to continue traversing.

Source

fn on_forwarded_args(&mut self, node: &ForwardedArgs)

Invoked by a Visitor on entering into ForwardedArgs node.

Has a default implementation, but you can override it and (optionally) call visit_forwarded_args(node) to continue traversing.

Source

fn on_gvar(&mut self, node: &Gvar)

Invoked by a Visitor on entering into Gvar node.

Has a default implementation, but you can override it and (optionally) call visit_gvar(node) to continue traversing.

Source

fn on_gvasgn(&mut self, node: &Gvasgn)

Invoked by a Visitor on entering into Gvasgn node.

Has a default implementation, but you can override it and (optionally) call visit_gvasgn(node) to continue traversing.

Source

fn on_hash(&mut self, node: &Hash)

Invoked by a Visitor on entering into Hash node.

Has a default implementation, but you can override it and (optionally) call visit_hash(node) to continue traversing.

Source

fn on_hash_pattern(&mut self, node: &HashPattern)

Invoked by a Visitor on entering into HashPattern node.

Has a default implementation, but you can override it and (optionally) call visit_hash_pattern(node) to continue traversing.

Source

fn on_heredoc(&mut self, node: &Heredoc)

Invoked by a Visitor on entering into Heredoc node.

Has a default implementation, but you can override it and (optionally) call visit_heredoc(node) to continue traversing.

Source

fn on_if(&mut self, node: &If)

Invoked by a Visitor on entering into If node.

Has a default implementation, but you can override it and (optionally) call visit_if(node) to continue traversing.

Source

fn on_if_guard(&mut self, node: &IfGuard)

Invoked by a Visitor on entering into IfGuard node.

Has a default implementation, but you can override it and (optionally) call visit_if_guard(node) to continue traversing.

Source

fn on_i_flip_flop(&mut self, node: &IFlipFlop)

Invoked by a Visitor on entering into IFlipFlop node.

Has a default implementation, but you can override it and (optionally) call visit_i_flip_flop(node) to continue traversing.

Source

fn on_if_mod(&mut self, node: &IfMod)

Invoked by a Visitor on entering into IfMod node.

Has a default implementation, but you can override it and (optionally) call visit_if_mod(node) to continue traversing.

Source

fn on_if_ternary(&mut self, node: &IfTernary)

Invoked by a Visitor on entering into IfTernary node.

Has a default implementation, but you can override it and (optionally) call visit_if_ternary(node) to continue traversing.

Source

fn on_index(&mut self, node: &Index)

Invoked by a Visitor on entering into Index node.

Has a default implementation, but you can override it and (optionally) call visit_index(node) to continue traversing.

Source

fn on_index_asgn(&mut self, node: &IndexAsgn)

Invoked by a Visitor on entering into IndexAsgn node.

Has a default implementation, but you can override it and (optionally) call visit_index_asgn(node) to continue traversing.

Source

fn on_in_pattern(&mut self, node: &InPattern)

Invoked by a Visitor on entering into InPattern node.

Has a default implementation, but you can override it and (optionally) call visit_in_pattern(node) to continue traversing.

Source

fn on_int(&mut self, node: &Int)

Invoked by a Visitor on entering into Int node.

Has a default implementation, but you can override it and (optionally) call visit_int(node) to continue traversing.

Source

fn on_irange(&mut self, node: &Irange)

Invoked by a Visitor on entering into Irange node.

Has a default implementation, but you can override it and (optionally) call visit_irange(node) to continue traversing.

Source

fn on_ivar(&mut self, node: &Ivar)

Invoked by a Visitor on entering into Ivar node.

Has a default implementation, but you can override it and (optionally) call visit_ivar(node) to continue traversing.

Source

fn on_ivasgn(&mut self, node: &Ivasgn)

Invoked by a Visitor on entering into Ivasgn node.

Has a default implementation, but you can override it and (optionally) call visit_ivasgn(node) to continue traversing.

Source

fn on_kwarg(&mut self, node: &Kwarg)

Invoked by a Visitor on entering into Kwarg node.

Has a default implementation, but you can override it and (optionally) call visit_kwarg(node) to continue traversing.

Source

fn on_kwargs(&mut self, node: &Kwargs)

Invoked by a Visitor on entering into Kwargs node.

Has a default implementation, but you can override it and (optionally) call visit_kwargs(node) to continue traversing.

Source

fn on_kw_begin(&mut self, node: &KwBegin)

Invoked by a Visitor on entering into KwBegin node.

Has a default implementation, but you can override it and (optionally) call visit_kw_begin(node) to continue traversing.

Source

fn on_kwnilarg(&mut self, node: &Kwnilarg)

Invoked by a Visitor on entering into Kwnilarg node.

Has a default implementation, but you can override it and (optionally) call visit_kwnilarg(node) to continue traversing.

Source

fn on_kwoptarg(&mut self, node: &Kwoptarg)

Invoked by a Visitor on entering into Kwoptarg node.

Has a default implementation, but you can override it and (optionally) call visit_kwoptarg(node) to continue traversing.

Source

fn on_kwrestarg(&mut self, node: &Kwrestarg)

Invoked by a Visitor on entering into Kwrestarg node.

Has a default implementation, but you can override it and (optionally) call visit_kwrestarg(node) to continue traversing.

Source

fn on_kwsplat(&mut self, node: &Kwsplat)

Invoked by a Visitor on entering into Kwsplat node.

Has a default implementation, but you can override it and (optionally) call visit_kwsplat(node) to continue traversing.

Source

fn on_lambda(&mut self, node: &Lambda)

Invoked by a Visitor on entering into Lambda node.

Has a default implementation, but you can override it and (optionally) call visit_lambda(node) to continue traversing.

Source

fn on_line(&mut self, node: &Line)

Invoked by a Visitor on entering into Line node.

Has a default implementation, but you can override it and (optionally) call visit_line(node) to continue traversing.

Source

fn on_lvar(&mut self, node: &Lvar)

Invoked by a Visitor on entering into Lvar node.

Has a default implementation, but you can override it and (optionally) call visit_lvar(node) to continue traversing.

Source

fn on_lvasgn(&mut self, node: &Lvasgn)

Invoked by a Visitor on entering into Lvasgn node.

Has a default implementation, but you can override it and (optionally) call visit_lvasgn(node) to continue traversing.

Source

fn on_masgn(&mut self, node: &Masgn)

Invoked by a Visitor on entering into Masgn node.

Has a default implementation, but you can override it and (optionally) call visit_masgn(node) to continue traversing.

Source

fn on_match_alt(&mut self, node: &MatchAlt)

Invoked by a Visitor on entering into MatchAlt node.

Has a default implementation, but you can override it and (optionally) call visit_match_alt(node) to continue traversing.

Source

fn on_match_as(&mut self, node: &MatchAs)

Invoked by a Visitor on entering into MatchAs node.

Has a default implementation, but you can override it and (optionally) call visit_match_as(node) to continue traversing.

Source

fn on_match_current_line(&mut self, node: &MatchCurrentLine)

Invoked by a Visitor on entering into MatchCurrentLine node.

Has a default implementation, but you can override it and (optionally) call visit_match_current_line(node) to continue traversing.

Source

fn on_match_nil_pattern(&mut self, node: &MatchNilPattern)

Invoked by a Visitor on entering into MatchNilPattern node.

Has a default implementation, but you can override it and (optionally) call visit_match_nil_pattern(node) to continue traversing.

Source

fn on_match_pattern(&mut self, node: &MatchPattern)

Invoked by a Visitor on entering into MatchPattern node.

Has a default implementation, but you can override it and (optionally) call visit_match_pattern(node) to continue traversing.

Source

fn on_match_pattern_p(&mut self, node: &MatchPatternP)

Invoked by a Visitor on entering into MatchPatternP node.

Has a default implementation, but you can override it and (optionally) call visit_match_pattern_p(node) to continue traversing.

Source

fn on_match_rest(&mut self, node: &MatchRest)

Invoked by a Visitor on entering into MatchRest node.

Has a default implementation, but you can override it and (optionally) call visit_match_rest(node) to continue traversing.

Source

fn on_match_var(&mut self, node: &MatchVar)

Invoked by a Visitor on entering into MatchVar node.

Has a default implementation, but you can override it and (optionally) call visit_match_var(node) to continue traversing.

Source

fn on_match_with_lvasgn(&mut self, node: &MatchWithLvasgn)

Invoked by a Visitor on entering into MatchWithLvasgn node.

Has a default implementation, but you can override it and (optionally) call visit_match_with_lvasgn(node) to continue traversing.

Source

fn on_mlhs(&mut self, node: &Mlhs)

Invoked by a Visitor on entering into Mlhs node.

Has a default implementation, but you can override it and (optionally) call visit_mlhs(node) to continue traversing.

Source

fn on_module(&mut self, node: &Module)

Invoked by a Visitor on entering into Module node.

Has a default implementation, but you can override it and (optionally) call visit_module(node) to continue traversing.

Source

fn on_next(&mut self, node: &Next)

Invoked by a Visitor on entering into Next node.

Has a default implementation, but you can override it and (optionally) call visit_next(node) to continue traversing.

Source

fn on_nil(&mut self, node: &Nil)

Invoked by a Visitor on entering into Nil node.

Has a default implementation, but you can override it and (optionally) call visit_nil(node) to continue traversing.

Source

fn on_nth_ref(&mut self, node: &NthRef)

Invoked by a Visitor on entering into NthRef node.

Has a default implementation, but you can override it and (optionally) call visit_nth_ref(node) to continue traversing.

Source

fn on_numblock(&mut self, node: &Numblock)

Invoked by a Visitor on entering into Numblock node.

Has a default implementation, but you can override it and (optionally) call visit_numblock(node) to continue traversing.

Source

fn on_op_asgn(&mut self, node: &OpAsgn)

Invoked by a Visitor on entering into OpAsgn node.

Has a default implementation, but you can override it and (optionally) call visit_op_asgn(node) to continue traversing.

Source

fn on_optarg(&mut self, node: &Optarg)

Invoked by a Visitor on entering into Optarg node.

Has a default implementation, but you can override it and (optionally) call visit_optarg(node) to continue traversing.

Source

fn on_or(&mut self, node: &Or)

Invoked by a Visitor on entering into Or node.

Has a default implementation, but you can override it and (optionally) call visit_or(node) to continue traversing.

Source

fn on_or_asgn(&mut self, node: &OrAsgn)

Invoked by a Visitor on entering into OrAsgn node.

Has a default implementation, but you can override it and (optionally) call visit_or_asgn(node) to continue traversing.

Source

fn on_pair(&mut self, node: &Pair)

Invoked by a Visitor on entering into Pair node.

Has a default implementation, but you can override it and (optionally) call visit_pair(node) to continue traversing.

Source

fn on_pin(&mut self, node: &Pin)

Invoked by a Visitor on entering into Pin node.

Has a default implementation, but you can override it and (optionally) call visit_pin(node) to continue traversing.

Source

fn on_postexe(&mut self, node: &Postexe)

Invoked by a Visitor on entering into Postexe node.

Has a default implementation, but you can override it and (optionally) call visit_postexe(node) to continue traversing.

Source

fn on_preexe(&mut self, node: &Preexe)

Invoked by a Visitor on entering into Preexe node.

Has a default implementation, but you can override it and (optionally) call visit_preexe(node) to continue traversing.

Source

fn on_procarg0(&mut self, node: &Procarg0)

Invoked by a Visitor on entering into Procarg0 node.

Has a default implementation, but you can override it and (optionally) call visit_procarg0(node) to continue traversing.

Source

fn on_rational(&mut self, node: &Rational)

Invoked by a Visitor on entering into Rational node.

Has a default implementation, but you can override it and (optionally) call visit_rational(node) to continue traversing.

Source

fn on_redo(&mut self, node: &Redo)

Invoked by a Visitor on entering into Redo node.

Has a default implementation, but you can override it and (optionally) call visit_redo(node) to continue traversing.

Source

fn on_regexp(&mut self, node: &Regexp)

Invoked by a Visitor on entering into Regexp node.

Has a default implementation, but you can override it and (optionally) call visit_regexp(node) to continue traversing.

Source

fn on_reg_opt(&mut self, node: &RegOpt)

Invoked by a Visitor on entering into RegOpt node.

Has a default implementation, but you can override it and (optionally) call visit_reg_opt(node) to continue traversing.

Source

fn on_rescue(&mut self, node: &Rescue)

Invoked by a Visitor on entering into Rescue node.

Has a default implementation, but you can override it and (optionally) call visit_rescue(node) to continue traversing.

Source

fn on_rescue_body(&mut self, node: &RescueBody)

Invoked by a Visitor on entering into RescueBody node.

Has a default implementation, but you can override it and (optionally) call visit_rescue_body(node) to continue traversing.

Source

fn on_restarg(&mut self, node: &Restarg)

Invoked by a Visitor on entering into Restarg node.

Has a default implementation, but you can override it and (optionally) call visit_restarg(node) to continue traversing.

Source

fn on_retry(&mut self, node: &Retry)

Invoked by a Visitor on entering into Retry node.

Has a default implementation, but you can override it and (optionally) call visit_retry(node) to continue traversing.

Source

fn on_return(&mut self, node: &Return)

Invoked by a Visitor on entering into Return node.

Has a default implementation, but you can override it and (optionally) call visit_return(node) to continue traversing.

Source

fn on_s_class(&mut self, node: &SClass)

Invoked by a Visitor on entering into SClass node.

Has a default implementation, but you can override it and (optionally) call visit_s_class(node) to continue traversing.

Source

fn on_self_(&mut self, node: &Self_)

Invoked by a Visitor on entering into Self_ node.

Has a default implementation, but you can override it and (optionally) call visit_self_(node) to continue traversing.

Source

fn on_send(&mut self, node: &Send)

Invoked by a Visitor on entering into Send node.

Has a default implementation, but you can override it and (optionally) call visit_send(node) to continue traversing.

Source

fn on_shadowarg(&mut self, node: &Shadowarg)

Invoked by a Visitor on entering into Shadowarg node.

Has a default implementation, but you can override it and (optionally) call visit_shadowarg(node) to continue traversing.

Source

fn on_splat(&mut self, node: &Splat)

Invoked by a Visitor on entering into Splat node.

Has a default implementation, but you can override it and (optionally) call visit_splat(node) to continue traversing.

Source

fn on_str(&mut self, node: &Str)

Invoked by a Visitor on entering into Str node.

Has a default implementation, but you can override it and (optionally) call visit_str(node) to continue traversing.

Source

fn on_super(&mut self, node: &Super)

Invoked by a Visitor on entering into Super node.

Has a default implementation, but you can override it and (optionally) call visit_super(node) to continue traversing.

Source

fn on_sym(&mut self, node: &Sym)

Invoked by a Visitor on entering into Sym node.

Has a default implementation, but you can override it and (optionally) call visit_sym(node) to continue traversing.

Source

fn on_true(&mut self, node: &True)

Invoked by a Visitor on entering into True node.

Has a default implementation, but you can override it and (optionally) call visit_true(node) to continue traversing.

Source

fn on_undef(&mut self, node: &Undef)

Invoked by a Visitor on entering into Undef node.

Has a default implementation, but you can override it and (optionally) call visit_undef(node) to continue traversing.

Source

fn on_unless_guard(&mut self, node: &UnlessGuard)

Invoked by a Visitor on entering into UnlessGuard node.

Has a default implementation, but you can override it and (optionally) call visit_unless_guard(node) to continue traversing.

Source

fn on_until(&mut self, node: &Until)

Invoked by a Visitor on entering into Until node.

Has a default implementation, but you can override it and (optionally) call visit_until(node) to continue traversing.

Source

fn on_until_post(&mut self, node: &UntilPost)

Invoked by a Visitor on entering into UntilPost node.

Has a default implementation, but you can override it and (optionally) call visit_until_post(node) to continue traversing.

Source

fn on_when(&mut self, node: &When)

Invoked by a Visitor on entering into When node.

Has a default implementation, but you can override it and (optionally) call visit_when(node) to continue traversing.

Source

fn on_while(&mut self, node: &While)

Invoked by a Visitor on entering into While node.

Has a default implementation, but you can override it and (optionally) call visit_while(node) to continue traversing.

Source

fn on_while_post(&mut self, node: &WhilePost)

Invoked by a Visitor on entering into WhilePost node.

Has a default implementation, but you can override it and (optionally) call visit_while_post(node) to continue traversing.

Source

fn on_x_heredoc(&mut self, node: &XHeredoc)

Invoked by a Visitor on entering into XHeredoc node.

Has a default implementation, but you can override it and (optionally) call visit_x_heredoc(node) to continue traversing.

Source

fn on_xstr(&mut self, node: &Xstr)

Invoked by a Visitor on entering into Xstr node.

Has a default implementation, but you can override it and (optionally) call visit_xstr(node) to continue traversing.

Source

fn on_yield(&mut self, node: &Yield)

Invoked by a Visitor on entering into Yield node.

Has a default implementation, but you can override it and (optionally) call visit_yield(node) to continue traversing.

Source

fn on_z_super(&mut self, node: &ZSuper)

Invoked by a Visitor on entering into ZSuper node.

Has a default implementation, but you can override it and (optionally) call visit_z_super(node) to continue traversing.

Source

fn visit(&mut self, node: &Node)

Generic visit router that calls on_<type> under the hood

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§