dazzle_core/lib.rs
1//! # Dazzle Core
2//!
3//! Core library for Dazzle: Scheme interpreter (ported from OpenJade),
4//! DSSSL engine, and trait definitions for groves and backends.
5//!
6//! ## Architecture
7//!
8//! Dazzle follows OpenJade's clean separation:
9//!
10//! - `grove`: Trait definitions for document tree abstraction (like OpenJade's grove/)
11//! - `fot`: Trait definitions for flow object tree backends (like OpenJade's FOTBuilder)
12//! - `scheme`: Scheme interpreter (ported from OpenJade's style/)
13//! - `value`: Scheme value types (ELObj equivalent)
14//! - `parser`: S-expression parser (SchemeParser.cxx equivalent)
15//! - `interpreter`: Evaluator and environment (Interpreter.cxx equivalent)
16//! - `primitives`: All 236 DSSSL primitives (primitive.cxx equivalent)
17//! - `dsssl`: DSSSL style engine (processing modes, rules, etc.)
18//!
19//! ## Design Principles
20//!
21//! 1. **Trait-based abstraction**: Groves and backends are defined as traits,
22//! allowing multiple implementations without coupling to the interpreter.
23//!
24//! 2. **Faithful port**: Preserves OpenJade's proven design and performance optimizations
25//! (instruction-based evaluation, string interning, lazy node lists).
26//!
27//! 3. **100% compatibility**: All valid R4RS/DSSSL code that works in OpenJade
28//! works in Dazzle without modification.
29
30pub mod fot;
31pub mod grove;
32pub mod scheme;
33
34// Re-export key types for convenience
35pub use fot::FotBuilder;
36pub use grove::{Grove, Node, NodeList};
37pub use scheme::{Environment, EvalError, EvalResult, Evaluator, PairData, Parser, Procedure, Value};
38
39/// Dazzle version
40pub const VERSION: &str = env!("CARGO_PKG_VERSION");
41
42#[cfg(test)]
43mod tests {
44 use super::*;
45
46 #[test]
47 fn test_version() {
48 assert!(!VERSION.is_empty());
49 }
50}