Commit Graph

3 Commits

Author SHA1 Message Date
5c34ebd8b6 fix(parsing): reject a misindented multi-line quoted scalar continuation
A quoted scalar's continuation line must be indented past the parent
block, so '"a' / 'b"' (continuation in column 0) and '"bar' / '\tbaz'
(tab indentation) are malformed; libyaml accepts both.

Record the indentation error during the continuation scan but defer
raising it until the closing quote is found. An unterminated quote reaches
end of input first and still reports the missing quote (the root cause)
rather than the indentation symptom, preserving the multi-error diagnostic.

Surpasses libyaml on QB6E and DK95/01. Whole-suite conformance is now
402/402 with zero recorded gaps; canonical events stay 308/308.
2026-06-24 22:09:14 +02:00
0588996506 feat(parsing): run the whole library on the ported engine
Routes the value and stream APIs through the ported scanner+parser (the
event API already was), so PureYAML now parses entirely on the libyaml
port. Adds the features needed to match and exceed the previous engine:
JSON UTF-16 surrogate-pair \u escapes, bare documents after an explicit
`...`, reserved-directive handling that still requires a following `---`,
and a 64-level nesting bound enforced on the event stream so deeply nested
input fails with nestingTooDeep instead of overflowing a recursive
consumer. Parser errors are translated to the diagnostic-aware ParseError,
recovering precise codes where identifiable and a readable malformed
fallback otherwise; error-reporting fixtures are rebased onto the port.

Canonical event conformance: 268 -> 271 of 308 (7Z25, HWV9, QT73).
393 tests pass.
2026-06-24 18:02:22 +02:00
4e7ca8fcb2 feat(parsing): port libyaml quoted-scalar scanner to Swift
Stage 3 of the faithful libyaml scanner port, continued. Translates fetch_flow_scalar and scan_flow_scalar: single- and double-quoted scalars with line-break folding (a single break folds to a space, blank lines to newlines), the single-quote '' escape, double-quoted backslash escapes (the full \0 \a \b \t \n \v \f \r \e space \" / \ \N \_ \L \P table plus \xXX/\uXXXX/\UXXXXXXXX hex), and the escaped end-of-line continuation that suppresses the break. Escapes are decoded to Unicode scalars directly rather than UTF-8 bytes. Unit-tested for the escaped single quote, the escape table including a hex unicode escape, and multi-line folding. The remaining unported fetchers are block scalars, anchors, tags, and directives. 310 tests, no regression.
2026-06-24 15:22:41 +02:00