Skip to main content

Module yaml

Module yaml 

Source
Expand description

YAML parser groundwork for long-term Panache integration.

This module is intentionally minimal and currently acts as a placeholder for a future in-tree YAML parser that can produce Panache-compatible CST structures. Initial goals:

  • support plain YAML and hashpipe-prefixed YAML from shared parsing primitives,
  • preserve lossless syntax/trivia needed for exact host document ranges,
  • enable shadow-mode comparison against the existing YAML engine before rollout.
  • prepare for first-class YAML formatting support once parser parity is proven.

Modules§

diagnostic_codes

Structs§

ShadowParserV2Report
Public byte-completeness report from running the v2 parser scaffold over an input. The harness in tests/yaml.rs uses this to gate each step-11 sub-commit on losslessness.
ShadowScannerReport
Byte-completeness report from running the streaming scanner over an input. Used by the integration harness to gate the cutover (step 12) — until every allowlisted fixture is covered byte-completely with no overlaps or gaps, the new scanner cannot replace the line-based lexer.
ShadowYamlOptions
ShadowYamlReport
YamlDiagnostic
YamlParseReport

Enums§

ShadowYamlOutcome
YamlInputKind

Functions§

parse_shadow
Parse YAML in shadow mode using prototype groundwork only.
parse_v2
Drive the scanner over input and build a CST. Always returns a SyntaxNode — the scanner is permissive and the v2 builder preserves bytes regardless of well-formedness.
parse_yaml_report
Parse prototype YAML tree structure and include diagnostics on failure.
parse_yaml_tree
Parse prototype YAML tree structure from input
project_events
Walk the shadow CST for input and return the projected yaml-test-suite event stream. Returns an empty vector if the input fails to parse.
project_events_from_tree
Walk a shadow-parser CST and return the projected yaml-test-suite event stream. Decoupled from parse_yaml_tree so the v2 parser can reuse the same projection for parity comparisons.
shadow_parser_v2_check
Run the v2 parser and return a losslessness report. Exposed so the integration harness can run over allowlisted fixtures without depending on private types.
shadow_scanner_check
Drive the streaming scanner to completion over input and return a byte-completeness report. This is exposed so the integration harness in tests/yaml.rs can run the scanner over every allowlisted fixture without depending on internal Token/Scanner types.