Start of attempt to return tokens.

This commit is contained in:
Tom Alexander 2022-12-10 22:24:12 -05:00
parent a88117f731
commit ea63793b36
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 5 additions and 7 deletions

View File

@ -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<I, (Vec<O>, F), E> + 'r
) -> impl FnMut(I) -> IResult<I, (Vec<Token<'x>>, F), E> + 'r
where
O: Into<Token<'x>>,
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(&paragraph_end)),
}));
let ret = context_many_till(&paragraph_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>> {