Remove ChainBehavior.

This commit is contained in:
Tom Alexander 2023-04-18 20:44:58 -04:00
parent 35eff51d1b
commit a2051aca4f
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
8 changed files with 7 additions and 20 deletions

View File

@ -16,7 +16,6 @@ use nom::sequence::tuple;
use crate::parser::element::element; use crate::parser::element::element;
use crate::parser::exiting::ExitClass; use crate::parser::exiting::ExitClass;
use crate::parser::object::standard_set_object; use crate::parser::object::standard_set_object;
use crate::parser::parser_context::ChainBehavior;
use crate::parser::parser_context::ContextElement; use crate::parser::parser_context::ContextElement;
use crate::parser::parser_context::ContextTree; use crate::parser::parser_context::ContextTree;
use crate::parser::parser_context::ExitMatcherNode; use crate::parser::parser_context::ExitMatcherNode;

View File

@ -12,7 +12,6 @@ use super::Context;
use crate::parser::element::element; use crate::parser::element::element;
use crate::parser::error::Res; use crate::parser::error::Res;
use crate::parser::exiting::ExitClass; use crate::parser::exiting::ExitClass;
use crate::parser::parser_context::ChainBehavior;
use crate::parser::parser_context::ContextElement; use crate::parser::parser_context::ContextElement;
use crate::parser::parser_context::ExitMatcherNode; use crate::parser::parser_context::ExitMatcherNode;
use crate::parser::parser_with_context::parser_with_context; use crate::parser::parser_with_context::parser_with_context;

View File

@ -9,3 +9,9 @@ pub enum ExitClass {
/// Elements who cede priority to alpha elements when matching. /// Elements who cede priority to alpha elements when matching.
Beta = 300, Beta = 300,
} }
impl std::fmt::Display for ExitClass {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "{:?}", self)
}
}

View File

@ -4,7 +4,6 @@ use super::Context;
use crate::parser::element::element; use crate::parser::element::element;
use crate::parser::exiting::ExitClass; use crate::parser::exiting::ExitClass;
use crate::parser::greater_element::FootnoteDefinition; use crate::parser::greater_element::FootnoteDefinition;
use crate::parser::parser_context::ChainBehavior;
use crate::parser::parser_context::ContextElement; use crate::parser::parser_context::ContextElement;
use crate::parser::parser_context::ExitMatcherNode; use crate::parser::parser_context::ExitMatcherNode;
use crate::parser::parser_with_context::parser_with_context; use crate::parser::parser_with_context::parser_with_context;

View File

@ -5,7 +5,6 @@ use crate::parser::error::CustomError;
use crate::parser::error::MyError; use crate::parser::error::MyError;
use crate::parser::exiting::ExitClass; use crate::parser::exiting::ExitClass;
use crate::parser::greater_element::GreaterBlock; use crate::parser::greater_element::GreaterBlock;
use crate::parser::parser_context::ChainBehavior;
use crate::parser::parser_context::ContextElement; use crate::parser::parser_context::ContextElement;
use crate::parser::parser_context::ExitMatcherNode; use crate::parser::parser_context::ExitMatcherNode;
use crate::parser::parser_with_context::parser_with_context; use crate::parser::parser_with_context::parser_with_context;

View File

@ -8,7 +8,6 @@ use nom::sequence::tuple;
use crate::parser::exiting::ExitClass; use crate::parser::exiting::ExitClass;
use crate::parser::object::standard_set_object; use crate::parser::object::standard_set_object;
use crate::parser::parser_context::ChainBehavior;
use crate::parser::parser_context::ContextElement; use crate::parser::parser_context::ContextElement;
use crate::parser::parser_context::ExitMatcherNode; use crate::parser::parser_context::ExitMatcherNode;
use crate::parser::parser_with_context::parser_with_context; use crate::parser::parser_with_context::parser_with_context;

View File

@ -158,23 +158,10 @@ pub struct ExitMatcherNode<'r> {
pub class: ExitClass, pub class: ExitClass,
} }
#[derive(Clone)]
pub enum ChainBehavior<'r> {
AndParent(Option<&'r Matcher>),
IgnoreParent(Option<&'r Matcher>),
}
impl<'r> std::fmt::Debug for ExitMatcherNode<'r> { impl<'r> std::fmt::Debug for ExitMatcherNode<'r> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ExitMatcherNode"); let mut formatter = f.debug_struct("ExitMatcherNode");
// match self { formatter.field("class", &self.class.to_string());
// ChainBehavior::AndParent(_) => {
// formatter = formatter.field("type", &"AndParent");
// }
// ChainBehavior::IgnoreParent(_) => {
// formatter = formatter.field("type", &"IgnoreParent");
// }
// };
formatter.finish() formatter.finish()
} }
} }

View File

@ -9,7 +9,6 @@ use super::util::non_whitespace_character;
use super::Context; use super::Context;
use crate::parser::element::element; use crate::parser::element::element;
use crate::parser::exiting::ExitClass; use crate::parser::exiting::ExitClass;
use crate::parser::parser_context::ChainBehavior;
use crate::parser::parser_context::ContextElement; use crate::parser::parser_context::ContextElement;
use crate::parser::parser_context::ExitMatcherNode; use crate::parser::parser_context::ExitMatcherNode;
use crate::parser::util::blank_line; use crate::parser::util::blank_line;