Expand description
Hashline format primitives: sigils, separators, and display helpers. Single source of truth for the parser, tokenizer, prompt, and grammar.
Ported from omp packages/hashline/src/format.ts.
Constants§
- HL_
DELETE_ KEYWORD - Keyword marking a deletion hunk header.
- HL_
FILE_ HASH_ LENGTH - Length, in hex characters, of a content hash tag.
- HL_
FILE_ HASH_ SEP - Separator between a path and its hash tag.
- HL_
FILE_ PREFIX - Opening sigil of a hashline section header.
- HL_
FILE_ SUFFIX - Closing sigil of a hashline section header.
- HL_
HEADER_ COLON - Colon terminating a hunk header.
- HL_
INSERT_ AFTER INSsub-keyword: insert after the anchor line.- HL_
INSERT_ BEFORE INSsub-keyword: insert before the anchor line.- HL_
INSERT_ HEAD INSsub-keyword: insert at the very top of the file.- HL_
INSERT_ KEYWORD - Keyword marking an insertion hunk header.
- HL_
INSERT_ TAIL INSsub-keyword: insert at the very bottom of the file.- HL_
LINE_ BODY_ SEP - Separator between a line number and its body text.
- HL_
PAYLOAD_ REPLACE - Sigil prefixing each literal payload row.
- HL_
RANGE_ SEP - Separator in an inclusive
start.=endrange. - HL_
REPLACE_ KEYWORD - Keyword marking a replacement hunk header.
Functions§
- compute_
file_ hash - Compute the content-derived hash tag carried by a hashline section header.
- format_
delete_ header - Format a concrete deletion hunk header:
DEL startorDEL start.=end. - format_
hashline_ header - Format a hashline section header:
[path#HASH]. - format_
insert_ header - Format an insertion hunk header for a cursor position.
- format_
numbered_ line - Format a single numbered line:
LINE:TEXT. - format_
replace_ header - Format a concrete replacement hunk header:
SWAP start.=end:.