Eliminate the document root context element.

This commit is contained in:
Tom Alexander
2023-08-24 17:01:12 -04:00
parent 720afa5d32
commit 3348807a05
3 changed files with 6 additions and 29 deletions

View File

@@ -85,19 +85,6 @@ impl<'r, 's> ContextTree<'r, 's> {
))));
}
pub fn get_document_root(&self) -> Option<&'s str> {
for current_node in self.iter() {
let context_element = current_node.get_data();
match context_element {
ContextElement::DocumentRoot(body) => {
return Some(body);
}
_ => {}
}
}
None
}
/// Indicates if elements should consume the whitespace after them.
///
/// Defaults to true.
@@ -121,11 +108,6 @@ impl<'r, 's> ContextTree<'r, 's> {
#[derive(Debug)]
pub enum ContextElement<'r, 's> {
/// Stores a reference to the entire org-mode document being parsed.
///
/// This is used for look-behind.
DocumentRoot(&'s str),
/// Stores a parser that indicates that children should exit upon matching an exit matcher.
ExitMatcherNode(ExitMatcherNode<'r>),
Context(&'r str),