Rewire ResumableDocumentScanner onto PureYAML.Streaming.Scanner #3
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Copied from https://codeberg.org/NodetteHQ/PureYAMLStreaming/issues/3. Opened by Mihaela on 2026-07-10.
Status (2026-07-10)
Open.
ResumableDocumentScanner(Sources/PureYAMLStreaming/ResumableDocumentScanner.swift) is a naive line-based heuristic: it looks for---at the start of a line to split documents, with no understanding of YAML grammar (block scalars, flow context, or quoting can all contain a line starting with---that is not a real document boundary, and it would misfire).PureYAML now ships a real, proven, resumable token-level scanner as public API:
PureYAML.Streaming.Scanner(init(),feed(_:),finish(),next() throws -> Outcome), added in NodetteHQ/PureYAML commit41ca600. It is a thin wrapper around the internal libyaml-ported scanner'sscanStep(), which is proven byte-for-byte identical to batch scanning across the whole yaml-test-suite corpus at multiple chunk sizes, and the public wrapper has its own separate differential proof (PublicStreamingScannerTests.swift) covering the translation layer itself.This is the "resumable token scanner" NodetteHQ/PureYAML#4 named as this package's actual intended consumer.
Work
PureYAMLdependency pin to the commit (or next tagged release) that includesPureYAML.Streaming.Scanner.ResumableDocumentScanner's line-basedconsume(_:)/consumeLine(_:documents:)with a real token-driven document-boundary detector built onPureYAML.Streaming.Scanner.next(): watch for.documentStart/.documentEnd/.streamEndtoken kinds instead of scanning raw lines for---.Parser.swift/StreamingToken.swiftshould look like once real tokens are available: keep the currentdocumentSource(String)-onlyStreamingToken(feeding whole document text toPureYAML.parse()per document, just with a correct boundary detector), or start exposing token-level events directly per the "feed event-level consumers directly" goal in NodetteHQ/PureYAML#4.README.md's "Status" section, which currently states "It is not yet a token-level YAML scanner," once this lands.Not in scope here
PureYAMLitself; the public API this depends on already exists and is proven.PureYAMLStreamingWasmSmokeneeds to link against.Related: NodetteHQ/PureYAML#4.