Skip to main content

Module format

Module format 

Source
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
INS sub-keyword: insert after the anchor line.
HL_INSERT_BEFORE
INS sub-keyword: insert before the anchor line.
HL_INSERT_HEAD
INS sub-keyword: insert at the very top of the file.
HL_INSERT_KEYWORD
Keyword marking an insertion hunk header.
HL_INSERT_TAIL
INS sub-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.=end range.
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 start or DEL 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:.