vize_armature

Crates.iovize_armature
lib.rsvize_armature
version0.0.1-alpha.31
created_at2026-01-11 14:48:48.252995+00
updated_at2026-01-12 12:38:49.431736+00
descriptionArmature - The structural parser framework for Vize Vue templates
homepage
repositoryhttps://github.com/ubugeeei/vize
max_upload_size
id2035922
size74,433
ubugeeei (ubugeeei)

documentation

README

vize_armature

Armature - The structural parser framework for Vize Vue templates.

vize_armature logo

Name Origin

Armature (/ˈɑːrmətʃər/) is the internal skeleton or framework that supports a sculpture during its creation. Just as an armature provides the structural foundation that a sculptor builds upon, vize_armature provides the parsing framework that analyzes and structures Vue templates.

The armature is the invisible but essential structure that gives shape to the final work - similarly, this crate provides the parsing infrastructure that extracts structure from raw template text.

Features

  • High-Performance Tokenizer: State machine-based HTML tokenizer optimized for Vue template syntax
  • Vue Template Parser: Full support for Vue-specific syntax including:
    • Directives (v-if, v-for, v-bind, v-on, etc.)
    • Interpolation ({{ expression }})
    • Custom delimiters
    • Dynamic arguments (v-bind:[key])
    • Modifiers (@click.stop.prevent)
  • Arena Allocation: Zero-copy parsing using bumpalo arena allocator
  • Error Recovery: Graceful handling of malformed templates with detailed error messages
  • Source Location Tracking: Precise line/column tracking for IDE integration

Dependencies

  • vize_carton - Core types and arena allocator
  • vize_relief - AST definitions, errors, and options

Usage

use vize_armature::{parse, parse_with_options, ParserOptions};
use vize_carton::Bump;

// Simple parsing
let allocator = Bump::new();
let source = "<div>{{ message }}</div>";
let (ast, errors) = parse(&allocator, source);

// Parsing with options
let options = ParserOptions::default();
let (ast, errors) = parse_with_options(&allocator, source, options);

Architecture

vize_armature
├── tokenizer.rs  # State machine tokenizer
└── parser.rs     # AST builder using tokenizer callbacks

The parser uses a callback-based design where the tokenizer emits events that the parser handles to build the AST.

License

MIT

Commit count: 135

cargo fmt