use nom::branch::alt; use nom::error::VerboseError; use nom::IResult; pub struct NomContext { pub fail_matcher: Box IResult<&str, &str, VerboseError<&str>>>, /// You can't have nested bolds or links in org-mode pub can_match_bold: bool, pub can_match_link: bool, } impl NomContext { pub fn new( fail_matcher: Box IResult<&str, &str, VerboseError<&str>>>, ) -> Self { NomContext { fail_matcher, can_match_bold: true, can_match_link: true, } } pub fn with_additional_fail_matcher<>(&self, other: Box IResult<&str, &str, VerboseError<&str>>>) -> NomContext { // 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!() } }