Starting an unbound matcher type to allow unbound matchers as parameters to context_many_till.
This commit is contained in:
parent
6cfc39ca45
commit
05b3ac1725
@ -39,6 +39,9 @@ use nom::Parser;
|
|||||||
use tracing::instrument;
|
use tracing::instrument;
|
||||||
use tracing::trace;
|
use tracing::trace;
|
||||||
|
|
||||||
|
type UnboundMatcher<'r> =
|
||||||
|
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, M, T>(
|
||||||
context: Context<'r>,
|
context: Context<'r>,
|
||||||
mut many_matcher: M,
|
mut many_matcher: M,
|
||||||
@ -101,12 +104,8 @@ pub fn paragraph<'s, 'r>(
|
|||||||
}));
|
}));
|
||||||
let ret = {
|
let ret = {
|
||||||
let text_element_parser = parser_with_context!(flat_text_element)(paragraph_context);
|
let text_element_parser = parser_with_context!(flat_text_element)(paragraph_context);
|
||||||
many_till(text_element_parser, paragraph_end)(i)
|
context_many_till(¶graph_context, text_element_parser, paragraph_end)(i)
|
||||||
};
|
};
|
||||||
// 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);
|
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user