Files
oh-my-pi/packages/hashline/src/grammar.lark
T
can1357 5ea583e413 feat: replaced legacy editing commands with unified put and cut syntax
- Replaced legacy `SWAP`, `INS`, and `PASTE` commands with unified `PUT` and `CUT` hunks across parser, grammar, tokenizer, and test suites.
- Added support for named registers and span paste operations in clipboard and block execution logic.
- Implemented indentation repair and enhanced gap locator formatting for improved patch resilience.
- Updated documentation, system prompts, and session analysis scripts to reflect the new syntax and header shapes.
2026-07-31 00:19:52 +02:00

28 lines
733 B
Plaintext

start: begin_patch file_patch+ end_patch
begin_patch: "*** Begin Patch" LF
end_patch: "*** End Patch" LF?
file_patch: file_header hunk+
file_header: "[" filename "#" file_hash "]" LF
file_hash: /[0-9A-F]{4}/
filename: /[^#\r\n]+/
hunk: put_hunk | cut_hunk | rem_hunk | mv_hunk
put_hunk: "PUT " put_locator register? ":" LF body*
| "PUT " put_locator register LF
| "PUT " gap_locator LF
cut_hunk: "CUT " cut_locator register? LF
rem_hunk: "REM" LF
mv_hunk: "MV " filename LF body*
put_locator: range | LID "*" | gap_locator
cut_locator: range | LID "*"
gap_locator: "<" LID | ">" LID | ">" LID "*" | ">$"
register: " @" /[A-Za-z0-9_-]+/
range: LID ".=" LID
LID: /[1-9]\d*/
body: "+" /(.*)/ LF
%import common.LF