PureYAML/Sources
Mihaela Mihaljevic 7898dcd1a9 fix(parsing): keep the final break of a newline-less block scalar
A block scalar whose last line is whitespace only and ends at end of
input without a break still owns one line break, which keep (+) chomping
preserves. libyaml records no break because there is no break byte, so
'- |+' over a spaces-only unterminated line yields '' instead of '\n'.

In scan_block_scalar_breaks, when the break loop stops at end of input
after consuming whitespace on that line, append one implicit '\n' to the
trailing breaks (used only by keep chomping). Content lines are
unaffected because they do not skip whitespace in this loop.

With this the ported engine emits the exact canonical event stream for
every valid case in the vendored YAML test suite: 308/308, ahead of
libyaml (252) and the old hand-rolled parser (267). Port score 307 -> 308.
2026-06-24 19:28:58 +02:00
..
Coding
Decoding
Emitting
Encoding
Model
Parsing fix(parsing): keep the final break of a newline-less block scalar 2026-06-24 19:28:58 +02:00
Stream
Tagged feat(parsing): add authoritative canonical-event conformance gate 2026-06-24 01:24:24 +02:00
Validation
API.swift
PureYAML.swift