Expand description
Patch-specific line-sequence matcher ported from the TypeScript apply_patch engine.
This module intentionally does not reuse fuzzy_match: edit matching works in byte
ranges, while apply_patch needs line indexes, EOF anchoring, and unique-only reflow.
Structs§
Enums§
Constants§
- REFLOW_
NON_ WS_ TOLERANCE - Allow candidate reflow windows to differ by up to eight non-whitespace characters before exact normalized comparison.
Functions§
- find_
reflow_ match - Find one unique whitespace-reflowed window, returning
(found_line, line_count); mirrorspatch-parser.ts:310-351. - has_
reflow_ content - Return true when a line has any non-whitespace content; mirrors
patch-parser.ts:241-243. - normalize_
indent - Replace a leading run of tabs and spaces with the same number of plain spaces; mirrors
patch-parser.ts:227-229. - normalize_
reflow_ whitespace - Collapse every Unicode whitespace run to one space and trim the ends; mirrors
patch-parser.ts:233-235. - normalize_
unicode - Convert smart quotes, dash variants, ellipsis, and NBSP to their ASCII forms; mirrors
patch-parser.ts:207-214. - seek_
sequence_ tiered - Run the first-hit-wins Exact/Rstrip/Trim/Indent/Unicode/Reflow ladder; mirrors
patch-parser.ts:353-399. - strip_
reflow_ whitespace - Remove every Unicode whitespace character; mirrors
patch-parser.ts:237-239. - try_
match - Search for a full pattern with a caller-supplied comparator, optionally anchored at EOF; mirrors
patch-parser.ts:247-281.