Have to rework the paragraph parser to return something that I'd want to put in a token, like a Paragraph struct.

This commit is contained in:
Tom Alexander 2022-12-16 00:53:29 -05:00
parent 6459cc64d0
commit 601fc4776a
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 2 additions and 2 deletions

View File

@ -2,6 +2,7 @@
use crate::parser::parser_with_context::parser_with_context;
use crate::parser::text::paragraph_end;
use super::combinator::context_many1;
use super::combinator::context_many_till;
use super::error::CustomError;
use super::error::MyError;
@ -46,8 +47,7 @@ type UnboundMatcher<'r, 's, I, O, E> = dyn Fn(Context<'r, 's>, I) -> IResult<I,
pub fn document(input: &str) -> Res<&str, Vec<(Vec<TextElement>, &str)>> {
let initial_context: ContextTree<'_, '_> = ContextTree::new();
let paragraph_parser = parser_with_context!(paragraph);
let ret = many1(paragraph_parser(&initial_context))(input);
let ret = context_many1(&initial_context, paragraph)(input);
ret
}