Expand description
YAML parser for converting tokens to events
Re-exportsΒ§
ModulesΒ§
StructsΒ§
- Basic
Parser - Basic parser implementation that converts tokens to events
EnumsΒ§
- Parser
State π - Parser state for tracking context
TraitsΒ§
- Parser
- Trait for YAML parsers that convert token streams to events
FunctionsΒ§
- close_
open_ πcollections - has_
open_ πdocument - Walks back through
eventslooking for an unclosedDocumentStart(i.e. one without a matchingDocumentEndafter it). Returns true if the parser is still inside a document. - has_
unclosed_ πflow_ collection - Emit
MappingEnd/SequenceEndevents to close any unbalanced collection starts inevents. Called before emitting aDocumentEndwhen an outer construct (e.g. a new---marker) forces the previous document closed without going through the usual indent-drivenBlockEndtoken path. Also synthesises implicit empty scalars for mappings that have an odd child-event count (i.e. a key without a value before the close). Return true when there is at least one flow collection still open (aSequenceStart/MappingStartwithflow_style=truewithout a matchingβ¦Endafterwards). Used at end-of-stream to enforce Β§7.4. - innermost_
mapping_ πhas_ odd_ children - Return true when the innermost still-open mapping has an odd number of children β i.e. a key has been emitted but its value has not. Used to decide when to synthesise an implicit empty scalar.
- second_
root_ πnode_ present - Walk
eventsto detect a document that already contains a closed root-level node. Returns true when the second root node arrives and the existing event stack has no unmatched MapStart/SeqStart.