Skip to main content

Crate vize_l0

Crate vize_l0 

Source
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 by NodeId, 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 Dump value using the normalized Full-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 SmallVec containing the arguments.

Structs§

Allocator
Arena allocator for Vize.
ArenaStamp
Identity plus generation of the arena a value was allocated from.
Box
A Box without Drop, which stores its data in the arena allocator.
CompactString
A CompactString is a compact string type that can be used almost anywhere a String or str can be used.
PhfMap
An immutable map constructed at compile time.
PhfSet
An immutable set constructed at compile time.
SmallVec
A Vec-like container that can store a small number of elements inline.
String
A CompactString is a compact string type that can be used almost anywhere a String or str can be used.
StringBuilder
String builder.
Vec
A Vec without Drop, which stores its data in the arena allocator.

Enums§

Namespace
Namespace for elements

Traits§

CloneIn
Trait for cloning a value into an arena allocator.
ToCompactString
A trait for converting a value to a CompactString.

Type Aliases§

FxHashMap
Type alias for a hash map that uses the Fx hashing algorithm.
FxHashSet
Type alias for a hash set that uses the Fx hashing algorithm.