Eliminate the document root context element.
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user