From ea63793b36be0b12f7c24dc8e09d486a0de95fda Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 10 Dec 2022 22:24:12 -0500 Subject: [PATCH] Start of attempt to return tokens. --- src/parser/text_element_parser.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/parser/text_element_parser.rs b/src/parser/text_element_parser.rs index e5386ea9..f9777bc9 100644 --- a/src/parser/text_element_parser.rs +++ b/src/parser/text_element_parser.rs @@ -47,7 +47,7 @@ fn context_many_till<'r, 'x, I, O, E, F, M, T>( context: Context<'r>, mut many_matcher: M, mut till_matcher: T, -) -> impl FnMut(I) -> IResult, F), E> + 'r +) -> impl FnMut(I) -> IResult>, F), E> + 'r where O: Into>, I: Clone + InputLength, @@ -71,11 +71,7 @@ where ContextElement::PreviousElementNode(PreviousElementNode { element: token, }) => { - match token { - Token::TextElement(text_element) => { - ret.push(text_element); - } - }; + ret.push(token); } }; @@ -138,7 +134,9 @@ pub fn paragraph<'s, 'r>( fail_matcher: ChainBehavior::AndParent(Some(¶graph_end)), })); let ret = context_many_till(¶graph_context, flat_text_element, context_paragraph_end)(i); - ret + // TODO: FIX THIS + // ret + todo!() } fn flat_text_element<'s, 'r>(context: Context<'r>, i: &'s str) -> Res<&'s str, TextElement<'s>> {