The block-scalar scanner used 0 as the 'indentation not yet detected' sentinel and floored the auto-detected indent at 1, mirroring libyaml's scan_block_scalar_breaks. A root-level block scalar (parent indent -1) whose content starts in column 0 therefore detected no content, and the first content line was reparsed as a fresh document, raising 'did not find expected document start'. Switch the sentinel to -1 so 0 is a representable detected indent, and floor the auto-detected indent at parent indent + 1 (0 at the document root) instead of 1. Nested block scalars keep a parent indent >= 0, so their floor stays >= 1 and they are unaffected. Surpasses libyaml on DK3J, FP8R, and M7A3. Port score 283 -> 286. |
||
|---|---|---|
| .. | ||
| Coding | ||
| Decoding | ||
| Emitting | ||
| Encoding | ||
| Model | ||
| Parsing | ||
| Stream | ||
| Tagged | ||
| Validation | ||
| API.swift | ||
| PureYAML.swift | ||