tanzim-value
Foundational value types for the tanzim pipeline.
Types
- [
Value] —Bool,Int,Float,String,List,Map(no null) - [
LocatedValue] —Value+ [Location] (source name, resource, optional 1-based line/column) - [
Map] — orderedVec-backed map; last inserted key wins on lookup - [
Error] — parse-time errors; use{error:#}for source snippet with caret underline
Location
Positions (line, column, length) are 1-based and stored as
Option<NonZeroU32>. The compact representation keeps [Location] — and
therefore the [Error] that embeds it — small enough to return by value without
tripping clippy::result_large_err. Construct with [Location::at], which takes
ordinary Option<usize> positions and treats zero or out-of-range values as
absent, so callers never deal with NonZeroU32 directly.
Example
use ;
let mut map = new;
let location = at;
map.insert;
map.insert;
assert!;
assert_eq!;
Features
No optional features. This crate is always included as-is.
Relations
- Used by all other tanzim crates.
tanzim-parseproducesLocatedValuetrees from raw bytes.tanzim-mergeconsumesLocatedValuetrees to produce merged maps.