macro_rules! visitor {
(
$($access:tt)? enum $name:ident, $name_mut:ident {
Root($root:ident $(visits [$($root_host:ident),*])?),
Branches(
$($branch:ident $(visits [$($branch_host:ident),*])?),*
)
}
) => { ... };
}
Expand description
! A macro for generating visitor types. Example:
ⓘ
use ::is_tree::*;
visitor! {
pub enum Visitors, VisitorMut {
Root(Root visits [Type1]),
Branches(
Branch1 visits [Type1, Type2, Type3],
Branch2 visits [Type2, Type4],
Branch3
)
}
}