feat: add specific operations
This commit is contained in:
14
grammar.js
14
grammar.js
@@ -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]+/,
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user