Expand description
Core types for a YAML 1.2.2 round-trip parser.
This crate is intentionally dependency-free. It owns source storage, the lossless lexer and CST, semantic metadata, diagnostics, JSON Pointer operations, typed-overlay traits, editor APIs, and patch-based emission. The original source and CST remain authoritative so untouched YAML is emitted byte-for-byte.
Structs§
- Children
- Iterator over a node’s children in source order.
- Diagnostic
- Structured user-facing diagnostic.
- Edit
- Pending source edit used by the patch-based emitter.
- Fragment
Error - Failure to parse, validate, or render a YAML fragment.
- Json
Pointer - A parsed plain RFC 6901 JSON Pointer.
- LineCol
- One-based line and column location.
- Node
- Lossless syntax node produced by the CST parser.
- NodeId
- Identifier for a node stored inside a
crate::YamlDoc. - Pointer
Error - Structured JSON Pointer parse or resolution error.
- Reference
Token - One decoded RFC 6901 reference token.
- Reserved
Directive - Parsed reserved directive metadata.
- Scalar
Resolve Error - Failure to resolve a scalar according to the YAML core schema.
- Semantic
Value Error - Failure while projecting YAML nodes into the JSON-compatible data model.
- Source
- Original YAML input plus line-start metadata.
- Span
- A byte span inside a
Source. - TagDirective
- Parsed
%TAGdirective metadata. - Token
- Lexical token preserving its exact source span.
- Yaml
Directive - Parsed
%YAMLdirective metadata. - YamlDoc
- A source-preserving YAML document.
- Yaml
Edit Error - Failure while applying a pointer-addressed YAML edit.
- Yaml
Error - Error type for YAML parsing, semantic lookup, typed overlays, and emission.
- Yaml
Event - Semantic YAML event produced by the parser.
- Yaml
Events - On-demand iterator over semantic YAML events.
- Yaml
Fragment - A parsed YAML value document containing exactly one root node.
- Yaml
Number - An exact, finite YAML number normalized for semantic comparison.
- Yaml
Patch - A parsed sequence of RFC 6902-style operations over YAML values.
- Yaml
Patch Error - Failure while parsing or applying a YAML patch.
Enums§
- Collection
Style - YAML collection spelling.
- Diagnostic
Kind - Diagnostic phase.
- Mapping
Entry Style - Formatting controls for inserting a block mapping entry.
- Node
Kind - Node kinds emitted by the CST parser.
- NonFinite
Float - A non-finite YAML float, which is outside the JSON-compatible data model.
- Pointer
Error Kind - Classification of a JSON Pointer parse or resolution failure.
- Resolved
Scalar - YAML 1.2 core-schema interpretation of a scalar.
- Semantic
Kind - Semantic interpretation attached to a lossless CST node.
- Token
Kind - Token kinds emitted by the lossless lexer.
- Yaml
Event Kind - Semantic YAML event kinds.
- Yaml
Patch Error Kind - Classification of a YAML patch failure.
- Yaml
Patch Operation - One YAML patch operation.
- Yaml
Scalar Style - YAML scalar spelling.
Constants§
- TARGET_
YAML_ VERSION - YAML version targeted by this workspace.
Traits§
- From
Yaml Doc - Converts a YAML document into a typed overlay.
- ToYaml
Doc - Applies a typed overlay back to a YAML document as minimal patches.
- ToYaml
Fragment - Formats a typed value as a YAML fragment for parent-aware insertions.
- Yaml
Flatten - Reads and writes a field flattened into its containing YAML mapping.
- Yaml
Value - Reads and writes individual YAML node values.
Functions§
- events_
to_ test_ string - Renders YAML events in the YAML Test Suite
test.eventformat. - lex
- Lexes YAML source into lossless tokens.
- parse_
cst - Parses a source buffer into a lossless CST node arena.
- resolve_
scalar - Resolves a decoded scalar value using the YAML 1.2 core schema.
- semantically_
equal - Compares two YAML nodes using RFC 6902 JSON-value equality.
- tokens_
to_ string - Reconstructs source text from token spans.
Type Aliases§
- Parse
Error - Alias for parse errors until richer phase-specific errors are introduced.