Woah, it builds.
This commit is contained in:
parent
83c5a545e0
commit
040671b98f
@ -1,9 +1,9 @@
|
|||||||
macro_rules! parser_with_context {
|
macro_rules! parser_with_context {
|
||||||
($name:ident,$inp:ident,$context:ident,$fnbody:block) => {
|
($name:ident,$typ:ty,$inp:ident,$context:ident,$fnbody:block) => {
|
||||||
pub fn $name<'c, I: Clone, O, E: nom::error::ParseError<I>>(
|
pub fn $name<'c, I: Clone, O, E: nom::error::ParseError<I>>(
|
||||||
$context: &mut NomContext<'c, I, O, E>,
|
$context: &mut NomContext<'c, I, O, E>,
|
||||||
) -> impl for<'a> FnMut(I) -> IResult<I, O, E> + 'c {
|
) -> impl for<'a> FnMut(&'a str) -> IResult<&'a str, $typ, VerboseError<&'a str>> + 'c {
|
||||||
|$inp: I| $fnbody
|
|$inp| $fnbody
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ use nom::combinator::not;
|
|||||||
use nom::error::VerboseError;
|
use nom::error::VerboseError;
|
||||||
use nom::IResult;
|
use nom::IResult;
|
||||||
|
|
||||||
parser_with_context!(text_element, i, context, {
|
parser_with_context!(text_element, TextElement, i, context, {
|
||||||
// not(|i| (context.fail_matcher)(i))(i)?;
|
// not(|i| (context.fail_matcher)(i))(i)?;
|
||||||
alt((
|
alt((
|
||||||
// map(
|
// map(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user