From 601fc4776adf0a03f019e48fd1c5855800f87d7e Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 16 Dec 2022 00:53:29 -0500 Subject: [PATCH] Have to rework the paragraph parser to return something that I'd want to put in a token, like a Paragraph struct. --- src/parser/text_element_parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/text_element_parser.rs b/src/parser/text_element_parser.rs index ac10512b..b60f27fa 100644 --- a/src/parser/text_element_parser.rs +++ b/src/parser/text_element_parser.rs @@ -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 Res<&str, Vec<(Vec, &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 }