This page documents @lanexio/parser-grammar-yaml, the YAML grammar package implementing an iterative YAML 1.2.2 parser with explicit indentation and container stack.
Version:Stable
Module name:parser-grammar-yaml
Package:@lanexio/parser-grammar-yaml
Import path:@lanexio/parser-grammar-yaml
Layer: 2 (Grammar)
Runtime: Universal
Module format: ESM
Stability: Stable
Primary use case: Parse YAML 1.2.2 documents into a flat AST.
yamlToValue() projects a YAML stream into an object, array, or scalar. Plain scalars resolve by the YAML 1.2.2 core schema (null, bool, decimal/octal/hex int, float, .inf/.nan, else string); quoted and block scalars unquote. Anchors and aliases resolve with cycle detection (circular_alias), unknown anchors report missing_anchor, << merge keys copy anchored mappings with explicit keys winning, and multi-document streams project to an array of values.
No direct accessibility surface. The YAML parser produces flat AST data structures. Consuming code is responsible for rendering output with appropriate semantics.
YAML has unique security risks (anchors, aliases, tags). Lanexio Parser produces a LexTree and does not resolve YAML tags into application-level types.
Threat
Mitigation
Status
Malformed input byte sequence
Panic-free guarantee: all inputs accepted, errors produce YamlKind.Error AST nodes
Implemented
YAML anchor/alias injection
Parser produces AST but does not resolve anchors or execute tag handlers