diff --git a/src/parser/nom_context.rs b/src/parser/nom_context.rs index aa2a905b..affe0bbd 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!() + } }