Crate logicaffeine_base

Crate logicaffeine_base 

Source
Expand description

§logicaffeine-base

Pure structural atoms for the logicaffeine ecosystem.

This crate provides the foundational types used throughout logicaffeine:

§Design Principles

This crate has no knowledge of English vocabulary or I/O. It provides only generic, reusable infrastructure that higher-level crates build upon.

§Example

use logicaffeine_base::{Arena, Interner, Span};

let arena: Arena<&str> = Arena::new();
let mut interner = Interner::new();

let hello = interner.intern("hello");
let span = Span::new(0, 5);

let allocated = arena.alloc("hello");
assert_eq!(*allocated, "hello");

Re-exports§

pub use arena::Arena;
pub use intern::Interner;
pub use intern::Symbol;
pub use intern::SymbolEq;
pub use span::Span;
pub use error::SpannedError;
pub use error::Result;

Modules§

arena
Arena allocation for stable AST references.
error
Error types with source location tracking.
intern
String interning for O(1) equality comparison.
span
Source location tracking for error reporting.