Ports parser.c: the one-event-at-a-time state machine that turns the scanner's token stream into the YAML event stream. Covers stream and document framing, directive processing with %TAG handle resolution and default handles, the node property/tag/anchor production, block and indentless sequences, block mappings, and flow sequences and mappings including the single-pair `?` mapping forms. Output verified against the libyaml reference event dumper: the empty mapping value, %TAG resolution, and shorthand tags all match byte for byte. 331 tests, no regression.
11 lines
395 B
Swift
11 lines
395 B
Swift
extension PureYAML.Parsing.LibYAML {
|
|
/// A parser error, mirroring `yaml_parser_set_parser_error[_context]`: an
|
|
/// optional context describing the surrounding production, the immediate
|
|
/// problem, and the mark where it was detected.
|
|
struct ParserError: Error, Equatable {
|
|
var context: String?
|
|
var problem: String
|
|
var mark: PureYAML.Parsing.Mark
|
|
}
|
|
}
|