wip
This commit is contained in:
parent
8608136124
commit
b9034147a6
@ -89,8 +89,8 @@ pub fn document(input: &str) -> Res<&str, Vec<(Vec<TextElement>, &str)>> {
|
|||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn paragraph<'s, 'r, C>(
|
pub fn paragraph<'s, 'x: 'r, 'r, C>(
|
||||||
context: &'r ContextTree<'r, C>,
|
context: &'x ContextTree<'r, C>,
|
||||||
i: &'s str,
|
i: &'s str,
|
||||||
) -> Res<&'s str, (Vec<TextElement<'s>>, &'s str)>
|
) -> Res<&'s str, (Vec<TextElement<'s>>, &'s str)>
|
||||||
where
|
where
|
||||||
@ -101,15 +101,19 @@ where
|
|||||||
let paragraph_context = context.with_additional_node(FailMatcherNode {
|
let paragraph_context = context.with_additional_node(FailMatcherNode {
|
||||||
fail_matcher: ChainBehavior::AndParent(Some(¶graph_end)),
|
fail_matcher: ChainBehavior::AndParent(Some(¶graph_end)),
|
||||||
});
|
});
|
||||||
|
let ret = {
|
||||||
|
let text_element_parser = parser_with_context!(flat_text_element)(¶graph_context);
|
||||||
|
many_till(text_element_parser, paragraph_end)(i)
|
||||||
|
};
|
||||||
// let paragraph_context = context.with_additional_fail_matcher(¶graph_end);
|
// let paragraph_context = context.with_additional_fail_matcher(¶graph_end);
|
||||||
let text_element_parser = parser_with_context!(flat_text_element)(¶graph_context);
|
// 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 = 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
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
fn flat_text_element<'s, 'r, C>(
|
fn flat_text_element<'s, 'x: 'r, 'r, C>(
|
||||||
context: &'r ContextTree<'r, C>,
|
context: &'x ContextTree<'r, C>,
|
||||||
i: &'s str,
|
i: &'s str,
|
||||||
) -> Res<&'s str, TextElement<'s>>
|
) -> Res<&'s str, TextElement<'s>>
|
||||||
where
|
where
|
||||||
@ -136,7 +140,10 @@ fn recognize_bold_end(input: &str) -> Res<&str, &str> {
|
|||||||
recognize(bold_end)(input)
|
recognize(bold_end)(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn flat_bold<'s, 'r, C>(context: &'r ContextTree<'r, C>, i: &'s str) -> Res<&'s str, Bold<'s>>
|
fn flat_bold<'s, 'x: 'r, 'r, C>(
|
||||||
|
context: &'x ContextTree<'r, C>,
|
||||||
|
i: &'s str,
|
||||||
|
) -> Res<&'s str, Bold<'s>>
|
||||||
where
|
where
|
||||||
C: ContextElement,
|
C: ContextElement,
|
||||||
{
|
{
|
||||||
@ -157,7 +164,10 @@ fn recognize_link_end(input: &str) -> Res<&str, &str> {
|
|||||||
recognize(link_end)(input)
|
recognize(link_end)(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn flat_link<'s, 'r, C>(context: &'r ContextTree<'r, C>, i: &'s str) -> Res<&'s str, Link<'s>>
|
fn flat_link<'s, 'x: 'r, 'r, C>(
|
||||||
|
context: &'x ContextTree<'r, C>,
|
||||||
|
i: &'s str,
|
||||||
|
) -> Res<&'s str, Link<'s>>
|
||||||
where
|
where
|
||||||
C: ContextElement,
|
C: ContextElement,
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user