Trying to switch to unbound matchers.

This commit is contained in:
Tom Alexander 2022-12-03 22:49:56 -05:00
parent 05b3ac1725
commit 11cf24a500
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 4 additions and 7 deletions

View File

@ -39,18 +39,15 @@ use nom::Parser;
use tracing::instrument; use tracing::instrument;
use tracing::trace; use tracing::trace;
type UnboundMatcher<'r> = type UnboundMatcher<'r, I, O, E> = dyn for<'s> Fn(Context<'r>, I) -> IResult<I, O, E>;
dyn for<'s> Fn(Context<'r>, &'s str) -> IResult<&'s str, &'s str, VerboseError<&'s str>>;
fn context_many_till<'r, I, O, E, F, M, T>( fn context_many_till<'r, I, O, E, F>(
context: Context<'r>, context: Context<'r>,
mut many_matcher: M, mut many_matcher: UnboundMatcher<'r, I, O, E>,
mut till_matcher: T, mut till_matcher: UnboundMatcher<'r, I, F, E>,
) -> impl FnMut(I) -> IResult<I, (Vec<O>, F), E> ) -> impl FnMut(I) -> IResult<I, (Vec<O>, F), E>
where where
I: Clone + InputLength, I: Clone + InputLength,
M: Parser<I, O, E>,
T: Parser<I, F, E>,
E: ParseError<I>, E: ParseError<I>,
{ {
move |mut i: I| { move |mut i: I| {