2022-07-16 03:26:49 +00:00
|
|
|
macro_rules! parser_with_context {
|
2022-07-16 22:09:43 +00:00
|
|
|
($name:ident,$inp:ident,$context:ident,$fnbody:block) => {
|
|
|
|
pub fn $name<'c, I: Clone, O, E: nom::error::ParseError<I>>(
|
|
|
|
$context: &mut NomContext<'c, I, O, E>,
|
|
|
|
) -> impl for<'a> FnMut(I) -> IResult<I, O, E> + 'c {
|
|
|
|
|$inp: I| $fnbody
|
2022-07-16 03:26:49 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
pub(crate) use parser_with_context;
|