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

@@ -2,6 +2,7 @@ use super::error::Res;
use super::util::WORD_CONSTITUENT_CHARACTERS;
use super::Context;
use crate::parser::element::element;
use crate::parser::exiting::ExitClass;
use crate::parser::greater_element::FootnoteDefinition;
use crate::parser::parser_context::ChainBehavior;
use crate::parser::parser_context::ContextElement;
@@ -37,7 +38,8 @@ pub fn footnote_definition<'r, 's>(
let parser_context = context
.with_additional_node(ContextElement::ConsumeTrailingWhitespace(true))
.with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode {
exit_matcher: ChainBehavior::IgnoreParent(Some(&footnote_definition_end)),
class: ExitClass::Alpha,
exit_matcher: &footnote_definition_end,
}));
// TODO: The problem is we are not accounting for trailing whitespace like we do in section. Maybe it would be easier if we passed down whether or not to parse trailing whitespace into the element matcher similar to how tag takes in parameters.
let element_matcher = parser_with_context!(element)(&parser_context);