Expand description
Carton - The artist’s toolbox for Vize.
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_carton::{Allocator, Box, Vec};
let allocator = Allocator::default();
// Allocate a boxed value
let boxed = Box::new_in(42, allocator.as_bump());
assert_eq!(*boxed, 42);
// Create a vector
let mut vec = Vec::new_in(allocator.as_bump());
vec.push(1);
vec.push(2);
vec.push(3);
assert_eq!(vec.len(), 3);Re-exports§
pub use dom_tag_config::*;pub use flags::*;pub use general::*;
Modules§
- config
- Shared Vize configuration loading.
- corsa_
resolver - Unified Corsa/tsgo executable discovery.
- 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.
- flags
- Optimization flags shared between compiler and runtime.
- general
- General utility functions shared across the compiler.
- hash
- Fast hashing utilities using xxHash3.
- i18n
- Internationalization (i18n) foundation for Vize.
- line_
index - Byte-offset to (line, UTF-16 column) mapping for LSP coordinates.
- lsp
- Generic LSP (Language Server Protocol) client utilities.
- path
- Filesystem path helpers shared by CLI and native type-checking code.
- profiler
- Lightweight profiling utilities for performance monitoring.
- source_
range - Source range utilities for position tracking.
- 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.
- bitflags
- Generate a flags type.
- cstr
- Create a new [
CompactString] using format arguments. - phf_map
- phf_set
- profile
- Macro for profiling a block of code.
- smallvec
- Creates a
SmallVeccontaining the arguments.
Structs§
- Allocator
- Arena allocator for Vize.
- Box
- An owned pointer to a bump-allocated
Tvalue, that runsDropimplementations. - Bump
- An arena to bump allocate into.
- Bump
String - A UTF-8 encoded, growable string.
- BumpVec
- A contiguous growable array type, written
Vec<'bump, T>but pronounced ‘vector’. - 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. - Vec
- A contiguous growable array type, written
Vec<'bump, T>but pronounced ‘vector’.
Traits§
- CloneIn
- Trait for cloning a value into an arena allocator.
- ToCompact
String - A trait for converting a value to a
CompactString.