Skip to main content

Module parser

Module parser 

Source
Expand description

YAML parser for converting tokens to events

Re-exportsΒ§

pub use events::*;
pub use streaming::*;

ModulesΒ§

events
YAML event definitions
streaming
Streaming parser implementation for efficient YAML processing

StructsΒ§

BasicParser
Basic parser implementation that converts tokens to events

EnumsΒ§

ParserState πŸ”’
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 events looking for an unclosed DocumentStart (i.e. one without a matching DocumentEnd after it). Returns true if the parser is still inside a document.
has_unclosed_flow_collection πŸ”’
Emit MappingEnd / SequenceEnd events to close any unbalanced collection starts in events. Called before emitting a DocumentEnd when an outer construct (e.g. a new --- marker) forces the previous document closed without going through the usual indent-driven BlockEnd token 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 (a SequenceStart / MappingStart with flow_style=true without a matching …End afterwards). 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 events to 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.