macro_rules! parser {
(<$i:ty, $o:ty, $e:ty> + $lt:tt) => { ... };
(<$i:ty, $o:ty, $e:ty>) => { ... };
}
Expand description
The parser macro allows you to easily write the type of a parser in a return position, using
impl Trait
.
There are two ways to use it (I
being the input, O
the output and E
the error type):
parser!(<I, O, E>)
yieldsParser<impl ParserImpl<I, Output = O, Error = E>>
parser!(<I, O, E> + 'a)
yieldsParser<impl ParserImpl<I, Output = O, Error = E> + 'a>