A block key that is only a node property (`&a : v`, `!!str : v`) parsed to an `expectedNode` error. The scanner synthesized an empty mapping key for a bare `: v` line but not when the line's sole content before the `:` was an anchor or tag, so no key marker was emitted and the parser rejected the `:`. Track non-property content per line (a leading `&`/`!` does not count, and a block entry opens a fresh node position) and synthesize the empty key whenever only properties precede the `:`. The property tokens already bind to the synthesized empty scalar through the existing mapping machinery, so no parser change is needed. Relocate the synthesis helper to Scanner.Helpers to keep Scanner under the file-length limit. yaml-test-suite FH7J now passes (parse-level 313/333 to 314/333); PW8X still needs the empty-anchored explicit-value form. should-error rejections and value-level matches are unchanged, and a value-level regression test pins the produced tree for each property-only-key shape. |
||
|---|---|---|
| .. | ||
| Coding | ||
| Decoding | ||
| Emitting | ||
| Encoding | ||
| Model | ||
| Parsing | ||
| Stream | ||
| Tagged | ||
| Validation | ||
| API.swift | ||
| PureYAML.swift | ||