Trying to switch to unbound matchers.
This commit is contained in:
parent
05b3ac1725
commit
11cf24a500
@ -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| {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user