feat: add specific operations

This commit is contained in:
2025-07-25 23:28:58 +02:00
parent 9ed328b67b
commit 2f29562943
6 changed files with 6335 additions and 5759 deletions

View File

@@ -50,7 +50,19 @@ module.exports = grammar({
),
prefix: _ => /[a-z0-9]+/, // allow lowercase alphanumeric
operation: _ => /[A-Z]+/, // must be all uppercase
file_path: _ => /[^ \t\n][^\n]*/, // must not start with space or newline
operation: $ => choice(
$.op_add,
$.op_delete,
$.op_move,
$.op_copy,
$.generic_operation
),
op_add: _ => choice("A", "ADD"),
op_delete: _ => choice("D", "DELETE"),
op_move: _ => choice("M", "MV", "MOVE", "RENAME"),
op_copy: _ => choice("C","COPY"),
generic_operation: _ => /[A-Z]+/,
}
});