From 9e3ea2963468104041c4beb414e1348598280cf5 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 14 Oct 2022 20:50:00 -0400 Subject: [PATCH] I think I need a box. --- src/parser/nom_context.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/parser/nom_context.rs b/src/parser/nom_context.rs index aa2a905..affe0bb 100644 --- a/src/parser/nom_context.rs +++ b/src/parser/nom_context.rs @@ -19,4 +19,14 @@ impl<'a> NomContext<'a> { can_match_link: true, } } + + pub fn with_additional_fail_matcher<'o, 'c: 'a + 'o>(&self, other: &'o mut dyn FnMut(&str) -> IResult<&str, &str, VerboseError<&str>>) -> NomContext<'c> { + let new_matcher = alt((&self.fail_matcher, other)); + NomContext { + fail_matcher: new_matcher, + can_match_bold: self.can_match_bold, + can_match_link: self.can_match_link + } + todo!() + } }