charon_lib::ast

Module visitor

source
Expand description

Defines two overrideable visitor traits that can be used to conveniently traverse the whole contents of an item. This is useful when e.g. dealing with types, which show up pretty much everywhere in the ast.

The crate defines two traits:

Structs§

  • Implementation detail: wrapper that implements Visit[Mut]<T> for T: #trait_name, and delegates all the visiting to our trait’s drive[_mut]. Used in the implementation of visit_inner
  • Implementation detail: wrapper that implements Visit[Mut]<T> for T: #trait_name, and delegates all the visiting to our trait’s drive[_mut]. Used in the implementation of visit_inner
  • Ast and body visitor that uses dynamic dispatch to call the provided function on the visited values of the right type.

Traits§

  • An overrideable visitor trait that can be used to conveniently traverse the whole contents of an item. This is useful when e.g. dealing with types, which show up pretty much everywhere in the ast.
  • A smaller visitor group just for function bodies. This explores statements, places and operands, but does not recurse into types.