Expand description
Stateful, line-oriented classifier for hashline diff text.
Turns raw patch lines into typed Tokens (section headers, hunk
headers, payload rows). The parser consumes the token stream.
Line-ops only (default build): SWAP, DEL, INS.PRE|POST|HEAD|TAIL.
Block ops (SWAP.BLK, DEL.BLK, INS.BLK.POST) live behind the
block-ops feature gate and are not recognized here.
Ported from omp packages/hashline/src/tokenizer.ts.
Structs§
- Tokenizer
- Stateful, reusable line classifier. Buffer text with
feed, flush the remainder withend, and reset withresetbefore reuse.
Enums§
- Block
Target - Where a hunk header lands. Line-ops only in the default build.
- Token
- One classified line of patch text.
Functions§
- clone_
cursor Cursorcarries only aCopyAnchor; cloning is cheap. Provided for API parity with ompcloneCursor— idiomatic Rust callers reach forCursor::clonedirectly.- parse_
lid - Parse a bare line-number anchor. Errors on malformed input.
- split_
hashline_ lines - Split
textinto lines on\n, stripping a trailing\rfrom each. An empty input yields a single empty line (ompsplitHashlineLines).