From 040671b98ffe4a6d83cf94d6f1329e748cbdc8f9 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 16 Jul 2022 18:18:41 -0400 Subject: [PATCH] Woah, it builds. --- src/parser/parser_with_context.rs | 6 +++--- src/parser/text_element_parser.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parser/parser_with_context.rs b/src/parser/parser_with_context.rs index 183311e..691d049 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,$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>( $context: &mut NomContext<'c, I, O, E>, - ) -> impl for<'a> FnMut(I) -> IResult + 'c { - |$inp: I| $fnbody + ) -> impl for<'a> FnMut(&'a str) -> IResult<&'a str, $typ, VerboseError<&'a str>> + 'c { + |$inp| $fnbody } }; } diff --git a/src/parser/text_element_parser.rs b/src/parser/text_element_parser.rs index dbf0ade..416e304 100644 --- a/src/parser/text_element_parser.rs +++ b/src/parser/text_element_parser.rs @@ -12,7 +12,7 @@ use nom::combinator::not; use nom::error::VerboseError; 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)?; alt(( // map(