From 400e253cf17323096cc8ceaa6d367c1b0496dcde Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Tue, 18 Apr 2023 22:18:21 -0400 Subject: [PATCH] Don't give paragraph a context since it just contains objects. --- src/parser/paragraph.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/parser/paragraph.rs b/src/parser/paragraph.rs index c0f9611..afb641b 100644 --- a/src/parser/paragraph.rs +++ b/src/parser/paragraph.rs @@ -27,14 +27,8 @@ use super::Context; #[tracing::instrument(ret, level = "debug")] pub fn paragraph<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, Paragraph<'s>> { - if immediate_in_section(context, "paragraph") { - return Err(nom::Err::Error(CustomError::MyError(MyError( - "Cannot nest objects of the same element", - )))); - } - let parser_context = context - .with_additional_node(ContextElement::Context("paragraph")) - .with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode { + let parser_context = + context.with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode { class: ExitClass::Beta, exit_matcher: ¶graph_end, }));