Expand description
Token-driven state machine that turns a stream of Tokens into a flat
list of Edits, plus the top-level envelope splitter that carves an
authored patch into PatchSections.
Ported from omp packages/hashline/src/parser.ts (the Executor state
machine) and packages/hashline/src/input.ts (splitPatchInput,
PatchSection).
Structs§
- Patch
- A parsed hashline patch — zero or more
PatchSections, each rooted at a[PATH#HASH]header. - Patch
Section - One section of a parsed patch: a target file plus its eagerly-parsed edits.
Functions§
- parse_
patch - Parse a single section’s diff body into
(edits, warnings). Mirrors ompparsePatch. - parse_
patch_ streaming - Streaming-tolerant variant of
parse_patch. Mirrors ompparsePatchStreaming. - split_
patch_ input - Parse
textinto aPatch. Splits the*** Begin Patch … *** End Patchenvelope into[PATH#HASH]sections and eagerly parses each section’s edits.