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:
parent
6459cc64d0
commit
601fc4776a
@ -2,6 +2,7 @@
|
|||||||
use crate::parser::parser_with_context::parser_with_context;
|
use crate::parser::parser_with_context::parser_with_context;
|
||||||
use crate::parser::text::paragraph_end;
|
use crate::parser::text::paragraph_end;
|
||||||
|
|
||||||
|
use super::combinator::context_many1;
|
||||||
use super::combinator::context_many_till;
|
use super::combinator::context_many_till;
|
||||||
use super::error::CustomError;
|
use super::error::CustomError;
|
||||||
use super::error::MyError;
|
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)>> {
|
pub fn document(input: &str) -> Res<&str, Vec<(Vec<TextElement>, &str)>> {
|
||||||
let initial_context: ContextTree<'_, '_> = ContextTree::new();
|
let initial_context: ContextTree<'_, '_> = ContextTree::new();
|
||||||
let paragraph_parser = parser_with_context!(paragraph);
|
let ret = context_many1(&initial_context, paragraph)(input);
|
||||||
let ret = many1(paragraph_parser(&initial_context))(input);
|
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user