logicaffeine_base/
lib.rs

1#![cfg_attr(docsrs, feature(doc_cfg))]
2
3//! # logicaffeine-base
4//!
5//! Pure structural atoms for the logicaffeine ecosystem.
6//!
7//! This crate provides the foundational types used throughout logicaffeine:
8//!
9//! - [`Arena`] — Bump allocation for stable AST references
10//! - [`Interner`]/[`Symbol`] — String interning for O(1) equality
11//! - [`Span`] — Source location tracking
12//! - [`SpannedError`]/[`Result`] — Errors with source positions
13//!
14//! # Design Principles
15//!
16//! This crate has **no knowledge of English vocabulary or I/O**. It provides
17//! only generic, reusable infrastructure that higher-level crates build upon.
18//!
19//! # Example
20//!
21//! ```
22//! use logicaffeine_base::{Arena, Interner, Span};
23//!
24//! let arena: Arena<&str> = Arena::new();
25//! let mut interner = Interner::new();
26//!
27//! let hello = interner.intern("hello");
28//! let span = Span::new(0, 5);
29//!
30//! let allocated = arena.alloc("hello");
31//! assert_eq!(*allocated, "hello");
32//! ```
33
34pub mod arena;
35pub mod intern;
36pub mod span;
37pub mod error;
38
39pub use arena::Arena;
40pub use intern::{Interner, Symbol, SymbolEq};
41pub use span::Span;
42pub use error::{SpannedError, Result};