From 35f058a3545a240bb09dce974daabff1c7b23586 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Wed, 27 Sep 2023 13:48:17 -0400 Subject: [PATCH] Starting a new iteration implementation. This implementation will reduce the use of heap by elimininating Box<> from the individual iterators but it will still need heap for maintaining a vector of iterators from nodes. --- src/iter/ast_node.rs | 1 + src/iter/ast_node_iter.rs | 5 +++++ src/iter/mod.rs | 2 ++ src/lib.rs | 1 + 4 files changed, 9 insertions(+) create mode 100644 src/iter/ast_node.rs create mode 100644 src/iter/ast_node_iter.rs create mode 100644 src/iter/mod.rs diff --git a/src/iter/ast_node.rs b/src/iter/ast_node.rs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/src/iter/ast_node.rs @@ -0,0 +1 @@ + diff --git a/src/iter/ast_node_iter.rs b/src/iter/ast_node_iter.rs new file mode 100644 index 00000000..136814a3 --- /dev/null +++ b/src/iter/ast_node_iter.rs @@ -0,0 +1,5 @@ +use crate::types::Object; + +pub struct BoldIter<'s> { + next: std::slice::Iter<'s, Object<'s>>, +} diff --git a/src/iter/mod.rs b/src/iter/mod.rs new file mode 100644 index 00000000..b59a57f7 --- /dev/null +++ b/src/iter/mod.rs @@ -0,0 +1,2 @@ +mod ast_node; +mod ast_node_iter; diff --git a/src/lib.rs b/src/lib.rs index bbcaf1f3..c522cf6a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,6 +8,7 @@ pub mod compare; mod context; mod error; +mod iter; pub mod parser; pub mod types;