Stage 2 of the faithful libyaml scanner port. Translates yaml_parser_save_simple_key, yaml_parser_remove_simple_key, yaml_parser_stale_simple_keys, and the flow-level push/pop (yaml_parser_increase_flow_level / decrease) onto a new PureYAML.Parsing.LibYAML.Scanner aggregate that embeds the indent engine. The simple-key mechanism is what lets a quoted scalar, a nested collection, or a property-carrying node become a mapping key when a ':' follows, and is required exactly at the block indent. Modelled faithfully: a potential key goes stale once it spans a line break or exceeds 1024 characters, and a required key that is removed or goes stale is the 'could not find expected colon' error. Unit-tested for the required/not-required, removal-error, staleness, and flow-level cases. No public behavior changed yet.
11 lines
402 B
Swift
11 lines
402 B
Swift
extension PureYAML.Parsing.LibYAML {
|
|
/// A scanning error, mirroring libyaml's `yaml_parser_set_scanner_error`
|
|
/// (`context` plus `problem` at a mark). It is mapped to the package's public
|
|
/// `ParseError` when the port is integrated.
|
|
struct ScannerError: Swift.Error, Equatable {
|
|
var context: String
|
|
var problem: String
|
|
var mark: PureYAML.Parsing.Mark
|
|
}
|
|
}
|