Replace old iteration with new iteration.

This commit is contained in:
Tom Alexander
2023-09-27 19:36:23 -04:00
parent 8784da5179
commit 9ce042d5b6
3 changed files with 12 additions and 11 deletions

View File

@@ -69,7 +69,7 @@ use crate::types::VerseBlock;
/// This only iterates over the children, not the starting node itself. So an AstNodeIter::PlainList would only return PlainListItems, not the PlainList.
///
/// This only iterates over AST nodes, so an AstNodeIter::Heading would iterate over both the title and section contents, but it would not iterate over simple strings like the TODO keyword or priority.
pub enum AstNodeIter<'r, 's> {
pub(crate) enum AstNodeIter<'r, 's> {
// Document Nodes
Document(DocumentIter<'r, 's>),
Heading(HeadingIter<'r, 's>),
@@ -132,7 +132,7 @@ pub enum AstNodeIter<'r, 's> {
}
impl<'r, 's> AstNodeIter<'r, 's> {
pub fn from_ast_node(node: &AstNode<'r, 's>) -> AstNodeIter<'r, 's> {
pub(crate) fn from_ast_node(node: &AstNode<'r, 's>) -> AstNodeIter<'r, 's> {
match node {
AstNode::Document(inner) => AstNodeIter::Document(inner.into_iter()),
AstNode::Heading(inner) => AstNodeIter::Heading(inner.into_iter()),

View File

@@ -2,3 +2,4 @@ mod all_ast_node_iter;
mod ast_node;
mod ast_node_iter;
mod macros;
pub(crate) use ast_node::AstNode;