macro_rules! make_fn {
($name:ident<$i:ty, $o:ty>, $rule:ident!($( $body:tt )* )) => { ... };
(pub $name:ident<$i:ty, $o:ty>, $rule:ident!($( $body:tt )* )) => { ... };
($name:ident<$i:ty, $o:ty>, $rule:ident) => { ... };
(pub $name:ident<$i:ty, $o:ty>, $rule:ident) => { ... };
}Expand description
Constructs a function named $name that takes an input of type $i and produces an output of type $o.
make_fn!(myrule<StrIter, &str>,
text_token!("token")
);You can also specify that the function is public if so desired.
make_fn!(pub otherrule<StrIter, &str>,
text_token!("other")
);