oak_core/tree/
mod.rs

1//! Red-green tree implementation for efficient kind tree representation.
2//!
3//! This module provides the core red-green tree data structures that enable
4//! efficient incremental parsing and kind tree manipulation.
5//!
6//! # Key Components
7//!
8//! - **Green Trees**: Immutable, position-agnostic kind tree nodes allocated in an Arena.
9//! - **Red Trees**: Position-aware kind tree nodes computed from green trees.
10//!
11//! # Architecture
12//!
13//! The red-green tree design enables:
14//! - **Incremental Parsing**: Only re-parse changed regions of source code
15//! - **Memory Efficiency**: Arena-based allocation with minimal overhead
16//! - **Performance**: Zero-copy node construction and fast traversal
17
18mod cursor;
19mod green_tree;
20pub mod red_tree;
21
22pub use self::{
23    cursor::Cursor,
24    green_tree::{GreenLeaf, GreenNode, GreenTree},
25    red_tree::{RedChildren, RedLeaf, RedNode, RedTree},
26};
27
28pub use triomphe::Arc;