2022-07-16 03:26:49 +00:00
|
|
|
macro_rules! parser_with_context {
|
|
|
|
($name:ident,$typ:ty,$inp:ident,$context:ident,$fnbody:block) => {
|
2022-07-16 21:52:04 +00:00
|
|
|
pub fn $name<I: Clone, O, E: nom::error::ParseError<I>>(
|
|
|
|
$context: &mut NomContext<I, O, E>,
|
2022-07-16 21:27:08 +00:00
|
|
|
) -> impl for<'a> FnMut(&'a str) -> IResult<&'a str, $typ, VerboseError<&'a str>> {
|
2022-07-16 03:26:49 +00:00
|
|
|
|$inp: &str| $fnbody
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
pub(crate) use parser_with_context;
|