PureYAML/Sources
Mihaela M ae29059530 fix(parsing): parse a property-only explicit mapping key as an empty key
An explicit key that is only a node property (`? &e` then `: &a`) parsed to an
`expectedNode` error. Unlike the implicit form (`&a : v`), the scanner emits no
synthesized empty scalar for an explicit key, so the block parser read the key
via parseNode, consumed the property, then hit the `:` value indicator with no
node and threw.

parseNode now treats a `:` in node position as an empty key carrying any
properties, reusing emitEmptyNodeOrThrow (the node it already produced for a
property at end of input) without consuming the `:`, so the mapping machinery
reads the `:` as the value indicator. To stay within the cyclomatic-complexity
limit, the scalar case is extracted to parseScalarNode.

yaml-test-suite PW8X now passes (parse-level 314/333 to 315/333). should-error
rejections and value-level matches are unchanged, and a value-level test pins
the produced tree for the anchored and tagged property-only explicit keys.
2026-06-29 08:56:58 +02:00
..
Coding feat(codable): broaden compatibility coverage 2026-06-05 12:49:20 +02:00
Decoding feat(model): support complex mapping keys 2026-06-05 16:08:45 +02:00
Emitting feat(parser): harden diagnostics and streaming 2026-06-06 07:57:48 +02:00
Encoding feat(model): support complex mapping keys 2026-06-05 16:08:45 +02:00
Model feat(model): support complex mapping keys 2026-06-05 16:08:45 +02:00
Parsing fix(parsing): parse a property-only explicit mapping key as an empty key 2026-06-29 08:56:58 +02:00
Stream feat(parser): add multi-document stream parsing 2026-06-05 14:55:54 +02:00
Tagged feat(validation): enforce tagged mapping-key uniqueness 2026-06-28 17:03:20 +02:00
Validation feat(validation): enforce tagged mapping-key uniqueness 2026-06-28 17:03:20 +02:00
API.swift feat(emitting): dump YAML streams 2026-06-05 17:14:41 +02:00
PureYAML.swift feat(tagged): add tag-preserving validation 2026-06-05 15:35:52 +02:00