use std::cell::RefCell; use std::rc::Rc; use nom::branch::alt; use nom::combinator::not; use nom::error::VerboseError; use nom::IResult; use nom::Parser; // type ContextReference<'r, T> = Option>; // type MatcherRef = dyn for<'s> FnMut(&'s str) -> IResult<&'s str, &'s str, VerboseError<&'s str>>; // pub struct ContextLayer<'r, T> { // data: T, // parent: ContextReference<'r, T>, // } // pub struct TestContext<'r, T> { // head: ContextReference<'r, T>, // } // pub struct ContextData<'r> { // fail_matcher: ChainBehavior<'r>, // } // impl<'r> TestContext<'r, ContextData<'r>> { // pub fn new() -> Self { // TestContext { head: None } // } // pub fn with_additional_fail_matcher<'subr>( // &self, // additional_fail_matcher: &'subr MatcherRef, // ) -> TestContext<'subr, ContextData<'subr>> { // // TestContext { // // head: Some( // // ) // // } // todo!() // } // } // enum ChainBehavior<'r> { // AndParent(Option<&'r MatcherRef>), // IgnoreParent(Option<&'r MatcherRef>), // }