Switching to generics.
This commit is contained in:
parent
0fb523e0fe
commit
c1778a4f12
@ -32,21 +32,23 @@ use nom::multi::many1;
|
||||
use nom::multi::many_till;
|
||||
use nom::sequence::tuple;
|
||||
use nom::IResult;
|
||||
use nom::InputLength;
|
||||
use nom::Parser;
|
||||
use tracing::instrument;
|
||||
use tracing::trace;
|
||||
|
||||
fn context_many_till<
|
||||
'r,
|
||||
M: for<'s> FnMut(&'s str) -> IResult<&'s str, TextElement<'s>, VerboseError<&'s str>>,
|
||||
T: for<'s> FnMut(&'s str) -> IResult<&'s str, &'s str, VerboseError<&'s str>>,
|
||||
>(
|
||||
fn context_many_till<'r, I, O, E, F, M, T>(
|
||||
context: &'r OrgModeContextNode<'r>,
|
||||
mut many_matcher: M,
|
||||
mut till_matcher: T,
|
||||
) -> impl for<'s> FnMut(
|
||||
&'s str,
|
||||
) -> IResult<&'s str, (Vec<TextElement<'s>>, &'s str), VerboseError<&'s str>> {
|
||||
|i| {
|
||||
) -> impl FnMut(I) -> IResult<I, (Vec<O>, F), E>
|
||||
where
|
||||
I: Clone + InputLength,
|
||||
M: Parser<I, O, E>,
|
||||
T: Parser<I, F, E>,
|
||||
E: ParseError<I>,
|
||||
{
|
||||
move |mut i: I| {
|
||||
// todo
|
||||
todo!()
|
||||
}
|
||||
@ -68,7 +70,7 @@ pub fn paragraph<'s, 'r>(
|
||||
let paragraph_context = context.with_additional_fail_matcher(¶graph_end);
|
||||
let text_element_parser = parser_with_context!(flat_text_element)(¶graph_context);
|
||||
let ret = context_many_till(¶graph_context, text_element_parser, paragraph_end)(i);
|
||||
// let ret = many_till(text_element_parser, paragraph_end)(i);
|
||||
let ret = many_till(text_element_parser, paragraph_end)(i);
|
||||
ret
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user