Expand description
L0 — the shared foundation for Vize.
Experimental: level APIs may change during the restructure.
Legacy compatibility is provided by vize_carton.
This crate provides the foundational utilities and data structures for the Vize compiler, much like a carton (artist’s portfolio case) holds all the essential tools and materials an artist needs for their work.
§Modules
- Allocator: Arena-based memory allocation for efficient AST construction
- Shared utilities: DOM configuration, optimization flags, and helper functions
- Telegraph: Generic message fan-out for report emitters
§Example
use vize_l0::{Allocator, Box, Vec};
let allocator = Allocator::default();
let allocator = &allocator;
// Allocate a boxed value
let boxed = Box::new_in(42, &allocator);
assert_eq!(*boxed, 42);
// Create a vector
let mut vec = Vec::new_in(&allocator);
vec.push(1);
vec.push(2);
vec.push(3);
assert_eq!(vec.len(), 3);Re-exports§
pub use compiler_error::ErrorCode;pub use recursion::ensure_sufficient_stack;pub use source_frame::SourceBlock;pub use source_frame::SourceFrameError;pub use source_frame::SourceRoot;pub use span::Span;pub use dom_tag_config::*;pub use flags::*;pub use general::*;
Modules§
- compiler_
error - Stable compiler codes shared with the preserved parser.
- config
- In-memory Vize configuration values and projections.
- diag
- The unified diagnostic every stage emits.
- dialect
- Vue dialect profiles and structural petite-vue detection.
- directive
- Vize comment directive parsing.
- dom_
tag_ config - DOM tag configuration shared between compiler-dom and runtime-dom.
- dump
- Dump - the textual dump format every Davinci stage speaks.
- expression_
guard - Expression nesting guard: whether text is safe to hand to OXC’s recursive parser.
- fact
- The fact API — the one typed query surface of charter #5/#8 (P4-1a).
- flags
- Optimization flags shared between compiler and runtime.
- general
- General utility functions shared across the compiler.
- hash
- Fast hashing utilities using xxHash3.
- id
- Node identity: the key every side table and cross-stage reference uses.
- interner
- Arena-backed atoms for template names that repeat within one compile.
- key
- Stage artifact keys (Davinci P5-1a): the content identity every cache of a stage artifact keys on.
- level
- The level registry: L0–L4 and the conversion crates between them.
- line_
index - Byte-offset to (line, UTF-16 column) mapping for LSP coordinates.
- pass
- The pass manager: pipelines as const data, classified and fused at build time.
- pool
- Per-worker arena pool: one arena reused across files (Davinci P1-11).
- profiler
- Lightweight profiling utilities for performance monitoring.
- recursion
- Stack headroom for the compiler’s recursive AST passes.
- side_
table SideTable— analysis results keyed byNodeId, not stored on nodes.- source_
frame - Validated authored-source frames for Davinci spans.
- source_
io - Borrowed UTF-8 validation for authored source bytes. Validation never normalizes or repairs bytes, preserving exact offsets.
- source_
range - Source range utilities for position tracking.
- span
- The Davinci span type: two byte offsets into the authored file.
- stage
- Canonical Davinci stage names and their current crate spellings.
- string_
builder - String builder utilities for efficient string construction.
- telegraph
- Generic message fan-out for compiler reports and tool integrations.
Macros§
- append
- Push formatted content to a string using
write!. - appendln
- Push a line (with newline) to a string efficiently.
- appends
- Push multiple items to a string efficiently.
- assert_
dump_ snapshot - Snapshot-assert a
Dumpvalue using the normalizedFull-mode printer. - bitflags
- Generate a flags type.
- cstr
- Create a new [
CompactString] using format arguments. - phf_map
- Macro to create a
static(compile-time)Map. - phf_set
- Macro to create a
static(compile-time)Set. - profile
- Macro for profiling a block of code.
- smallvec
- Creates a
SmallVeccontaining the arguments.
Structs§
- Allocator
- Arena allocator for Vize.
- Arena
Stamp - Identity plus generation of the arena a value was allocated from.
- Box
- A
BoxwithoutDrop, which stores its data in the arena allocator. - Compact
String - A
CompactStringis a compact string type that can be used almost anywhere aStringorstrcan be used. - PhfMap
- An immutable map constructed at compile time.
- PhfSet
- An immutable set constructed at compile time.
- Small
Vec - A
Vec-like container that can store a small number of elements inline. - String
- A
CompactStringis a compact string type that can be used almost anywhere aStringorstrcan be used. - String
Builder - String builder.
- Vec
- A
VecwithoutDrop, which stores its data in the arena allocator.
Enums§
- Namespace
- Namespace for elements
Traits§
- CloneIn
- Trait for cloning a value into an arena allocator.
- ToCompact
String - A trait for converting a value to a
CompactString.