Don't give paragraph a context since it just contains objects.

This commit is contained in:
Tom Alexander 2023-04-18 22:18:21 -04:00
parent 45d0ce17c3
commit 400e253cf1
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 2 additions and 8 deletions

View File

@ -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: &paragraph_end,
}));