First implementation moving over to the new exit matcher class system.

This commit is contained in:
Tom Alexander
2023-04-18 20:33:01 -04:00
parent fcd5c7d3cd
commit 35eff51d1b
8 changed files with 46 additions and 42 deletions

View File

@@ -11,6 +11,7 @@ use nom::sequence::tuple;
use super::Context;
use crate::parser::element::element;
use crate::parser::error::Res;
use crate::parser::exiting::ExitClass;
use crate::parser::parser_context::ChainBehavior;
use crate::parser::parser_context::ContextElement;
use crate::parser::parser_context::ExitMatcherNode;
@@ -36,7 +37,8 @@ pub fn drawer<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str,
let parser_context = context
.with_additional_node(ContextElement::ConsumeTrailingWhitespace(true))
.with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode {
exit_matcher: ChainBehavior::AndParent(Some(&drawer_end)),
class: ExitClass::Alpha,
exit_matcher: &drawer_end,
}));
let element_matcher = parser_with_context!(element)(&parser_context);