Maybe I need to hard-code types.

This commit is contained in:
Tom Alexander 2022-07-16 18:09:43 -04:00
parent 7e07e00e4c
commit 981eeb5326
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 7 additions and 7 deletions

View File

@ -1,9 +1,9 @@
macro_rules! parser_with_context {
($name:ident,$typ:ty,$inp:ident,$context:ident,$fnbody:block) => {
pub fn $name<I: Clone, O, E: nom::error::ParseError<I>>(
$context: &mut NomContext<I, O, E>,
) -> 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<I>>(
$context: &mut NomContext<'c, I, O, E>,
) -> impl for<'a> FnMut(I) -> IResult<I, O, E> + 'c {
|$inp: I| $fnbody
}
};
}

View File

@ -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()),