PureYAML/Sources
Mihaela Mihaljevic 18fdf9b69a feat(parsing): add a resumable scanner increment and broaden the mutation suite
Add Scanner.scanStep(), the first increment of true chunked input streaming
(#4): Reader gains isFinal/append(_:)/markFinal(), and peek(_:) flags ranDry
instead of asserting end of input when the buffer runs out mid-fetch and more
chunks may still arrive. scanStep() snapshots the scanner before each
fetchNextToken() and restores it whenever a fetch runs dry, so a construct
spanning a chunk boundary is retried after more input lands rather than
misread as an early end of input. Every existing call site keeps the default
isFinal: true, so scanAll() and batch parsing are unchanged; ranDry can never
be set when isFinal is true, by construction. A token already queued is not
always safe to release, since libyaml's simple-key mechanism can still splice
a KEY token in front of it, so scanStep() ports libyaml's
yaml_parser_fetch_more_tokens release condition.

Proof: StreamingScannerDifferentialTests.swift drives scanStep() at several
chunk sizes over representative cases always, and over the entire
yaml-test-suite manifest (402 cases) behind PUREYAML_RUN_YAML_TEST_SUITE=1,
asserting the token sequence matches scanAll() exactly. That proof caught a
real bug: lastTokenForbidsInlineSequence() read indentEngine.tokens.last,
which goes empty once tokens are released incrementally, silently breaking
the key: - a rejection. Fixed by tracking IndentEngine.lastToken explicitly,
kept in sync with tokens.last so batch behavior (which never dequeues) is
unchanged.

Not yet wired into PureYAMLStreaming; scanStep() and its supporting types stay
internal until that integration is designed.

Also broaden the real-seed mutation property suite (#6) with the three
mutation classes it named but didn't yet cover: invalidControlCharacter,
mixedTabSpaceIndentation, and truncatedFlowCollection. The test now asserts
diagnostic quality, not just pass/fail: line must fall within the mutated
document, and column, when present, must be 1-based (some ParseError cases,
like tabIndentation, are line-only by design).
2026-07-09 23:38:39 +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 fix(emitting): escape CRLF per unicode scalar in double-quoted output 2026-06-23 22:23:40 +02:00
Encoding feat(model): support complex mapping keys 2026-06-05 16:08:45 +02:00
Model feat(parsing): opt-in located parse on the hand-rolled engine 2026-06-29 07:14:42 +02:00
Parsing feat(parsing): add a resumable scanner increment and broaden the mutation suite 2026-07-09 23:38:39 +02:00
PureYAMLJSON Merge conformance/yaml-test-suite-gaps: the libyaml port becomes the engine on main 2026-07-05 00:23:48 +02:00
Stream feat(parser): add multi-document stream parsing 2026-06-05 14:55:54 +02:00
Tagged Merge conformance/yaml-test-suite-gaps: the libyaml port becomes the engine on main 2026-07-05 00:23:48 +02:00
Validation Merge conformance/yaml-test-suite-gaps: the libyaml port becomes the engine on main 2026-07-05 00:23:48 +02:00
API.swift feat(parsing): opt-in located parse on the hand-rolled engine 2026-06-29 07:14:42 +02:00
PureYAML.swift feat(tagged): add tag-preserving validation 2026-06-05 15:35:52 +02:00