diff --git a/src/parser/parser_with_context.rs b/src/parser/parser_with_context.rs index d9fdb322..183311ea 100644 --- a/src/parser/parser_with_context.rs +++ b/src/parser/parser_with_context.rs @@ -1,9 +1,9 @@ macro_rules! parser_with_context { - ($name:ident,$typ:ty,$inp:ident,$context:ident,$fnbody:block) => { - pub fn $name>( - $context: &mut NomContext, - ) -> impl for<'a> FnMut(&'a str) -> IResult<&'a str, $typ, VerboseError<&'a str>> { - |$inp: &str| $fnbody + ($name:ident,$inp:ident,$context:ident,$fnbody:block) => { + pub fn $name<'c, I: Clone, O, E: nom::error::ParseError>( + $context: &mut NomContext<'c, I, O, E>, + ) -> impl for<'a> FnMut(I) -> IResult + 'c { + |$inp: I| $fnbody } }; } diff --git a/src/parser/text_element_parser.rs b/src/parser/text_element_parser.rs index ccc234dc..dbf0ade5 100644 --- a/src/parser/text_element_parser.rs +++ b/src/parser/text_element_parser.rs @@ -12,8 +12,8 @@ use nom::combinator::not; use nom::error::VerboseError; use nom::IResult; -parser_with_context!(text_element, TextElement, i, context, { - not(|i| (context.fail_matcher)(i))(i)?; +parser_with_context!(text_element, i, context, { + // not(|i| (context.fail_matcher)(i))(i)?; alt(( // map( // BoldParser::new(slf.context.fail_matcher.clone()),