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

File diff suppressed because it is too large Load Diff

5590
example-file.noil Normal file

File diff suppressed because it is too large Load Diff

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]+/,
}
});

93
src/grammar.json generated
View File

@@ -158,13 +158,98 @@
"type": "PATTERN",
"value": "[a-z0-9]+"
},
"operation": {
"type": "PATTERN",
"value": "[A-Z]+"
},
"file_path": {
"type": "PATTERN",
"value": "[^ \\t\\n][^\\n]*"
},
"operation": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "op_add"
},
{
"type": "SYMBOL",
"name": "op_delete"
},
{
"type": "SYMBOL",
"name": "op_move"
},
{
"type": "SYMBOL",
"name": "op_copy"
},
{
"type": "SYMBOL",
"name": "generic_operation"
}
]
},
"op_add": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "A"
},
{
"type": "STRING",
"value": "ADD"
}
]
},
"op_delete": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "D"
},
{
"type": "STRING",
"value": "DELETE"
}
]
},
"op_move": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "M"
},
{
"type": "STRING",
"value": "MV"
},
{
"type": "STRING",
"value": "MOVE"
},
{
"type": "STRING",
"value": "RENAME"
}
]
},
"op_copy": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "C"
},
{
"type": "STRING",
"value": "COPY"
}
]
},
"generic_operation": {
"type": "PATTERN",
"value": "[A-Z]+"
}
},
"extras": [

93
src/node-types.json generated
View File

@@ -61,6 +61,57 @@
}
}
},
{
"type": "op_add",
"named": true,
"fields": {}
},
{
"type": "op_copy",
"named": true,
"fields": {}
},
{
"type": "op_delete",
"named": true,
"fields": {}
},
{
"type": "op_move",
"named": true,
"fields": {}
},
{
"type": "operation",
"named": true,
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "generic_operation",
"named": true
},
{
"type": "op_add",
"named": true
},
{
"type": "op_copy",
"named": true
},
{
"type": "op_delete",
"named": true
},
{
"type": "op_move",
"named": true
}
]
}
},
{
"type": "operation_line",
"named": true,
@@ -163,12 +214,52 @@
"type": ":",
"named": false
},
{
"type": "A",
"named": false
},
{
"type": "ADD",
"named": false
},
{
"type": "C",
"named": false
},
{
"type": "COPY",
"named": false
},
{
"type": "D",
"named": false
},
{
"type": "DELETE",
"named": false
},
{
"type": "M",
"named": false
},
{
"type": "MOVE",
"named": false
},
{
"type": "MV",
"named": false
},
{
"type": "RENAME",
"named": false
},
{
"type": "file_path",
"named": true
},
{
"type": "operation",
"type": "generic_operation",
"named": true
},
{

714
src/parser.c generated
View File

@@ -7,11 +7,11 @@
#endif
#define LANGUAGE_VERSION 15
#define STATE_COUNT 22
#define LARGE_STATE_COUNT 4
#define SYMBOL_COUNT 14
#define STATE_COUNT 27
#define LARGE_STATE_COUNT 10
#define SYMBOL_COUNT 29
#define ALIAS_COUNT 0
#define TOKEN_COUNT 6
#define TOKEN_COUNT 16
#define EXTERNAL_TOKEN_COUNT 0
#define FIELD_COUNT 3
#define MAX_ALIAS_SEQUENCE_LENGTH 5
@@ -23,16 +23,31 @@ enum ts_symbol_identifiers {
anon_sym_LF = 1,
anon_sym_COLON = 2,
sym_prefix = 3,
sym_operation = 4,
sym_file_path = 5,
sym_source_file = 6,
sym_line = 7,
sym_empty_line = 8,
sym_path_only_line = 9,
sym_mapping_line = 10,
sym_operation_line = 11,
sym_operation_only_line = 12,
aux_sym_source_file_repeat1 = 13,
sym_file_path = 4,
anon_sym_A = 5,
anon_sym_ADD = 6,
anon_sym_D = 7,
anon_sym_DELETE = 8,
anon_sym_M = 9,
anon_sym_MV = 10,
anon_sym_MOVE = 11,
anon_sym_RENAME = 12,
anon_sym_C = 13,
anon_sym_COPY = 14,
sym_generic_operation = 15,
sym_source_file = 16,
sym_line = 17,
sym_empty_line = 18,
sym_path_only_line = 19,
sym_mapping_line = 20,
sym_operation_line = 21,
sym_operation_only_line = 22,
sym_operation = 23,
sym_op_add = 24,
sym_op_delete = 25,
sym_op_move = 26,
sym_op_copy = 27,
aux_sym_source_file_repeat1 = 28,
};
static const char * const ts_symbol_names[] = {
@@ -40,8 +55,18 @@ static const char * const ts_symbol_names[] = {
[anon_sym_LF] = "\n",
[anon_sym_COLON] = ":",
[sym_prefix] = "prefix",
[sym_operation] = "operation",
[sym_file_path] = "file_path",
[anon_sym_A] = "A",
[anon_sym_ADD] = "ADD",
[anon_sym_D] = "D",
[anon_sym_DELETE] = "DELETE",
[anon_sym_M] = "M",
[anon_sym_MV] = "MV",
[anon_sym_MOVE] = "MOVE",
[anon_sym_RENAME] = "RENAME",
[anon_sym_C] = "C",
[anon_sym_COPY] = "COPY",
[sym_generic_operation] = "generic_operation",
[sym_source_file] = "source_file",
[sym_line] = "line",
[sym_empty_line] = "empty_line",
@@ -49,6 +74,11 @@ static const char * const ts_symbol_names[] = {
[sym_mapping_line] = "mapping_line",
[sym_operation_line] = "operation_line",
[sym_operation_only_line] = "operation_only_line",
[sym_operation] = "operation",
[sym_op_add] = "op_add",
[sym_op_delete] = "op_delete",
[sym_op_move] = "op_move",
[sym_op_copy] = "op_copy",
[aux_sym_source_file_repeat1] = "source_file_repeat1",
};
@@ -57,8 +87,18 @@ static const TSSymbol ts_symbol_map[] = {
[anon_sym_LF] = anon_sym_LF,
[anon_sym_COLON] = anon_sym_COLON,
[sym_prefix] = sym_prefix,
[sym_operation] = sym_operation,
[sym_file_path] = sym_file_path,
[anon_sym_A] = anon_sym_A,
[anon_sym_ADD] = anon_sym_ADD,
[anon_sym_D] = anon_sym_D,
[anon_sym_DELETE] = anon_sym_DELETE,
[anon_sym_M] = anon_sym_M,
[anon_sym_MV] = anon_sym_MV,
[anon_sym_MOVE] = anon_sym_MOVE,
[anon_sym_RENAME] = anon_sym_RENAME,
[anon_sym_C] = anon_sym_C,
[anon_sym_COPY] = anon_sym_COPY,
[sym_generic_operation] = sym_generic_operation,
[sym_source_file] = sym_source_file,
[sym_line] = sym_line,
[sym_empty_line] = sym_empty_line,
@@ -66,6 +106,11 @@ static const TSSymbol ts_symbol_map[] = {
[sym_mapping_line] = sym_mapping_line,
[sym_operation_line] = sym_operation_line,
[sym_operation_only_line] = sym_operation_only_line,
[sym_operation] = sym_operation,
[sym_op_add] = sym_op_add,
[sym_op_delete] = sym_op_delete,
[sym_op_move] = sym_op_move,
[sym_op_copy] = sym_op_copy,
[aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1,
};
@@ -86,11 +131,51 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = true,
.named = true,
},
[sym_operation] = {
[sym_file_path] = {
.visible = true,
.named = true,
},
[sym_file_path] = {
[anon_sym_A] = {
.visible = true,
.named = false,
},
[anon_sym_ADD] = {
.visible = true,
.named = false,
},
[anon_sym_D] = {
.visible = true,
.named = false,
},
[anon_sym_DELETE] = {
.visible = true,
.named = false,
},
[anon_sym_M] = {
.visible = true,
.named = false,
},
[anon_sym_MV] = {
.visible = true,
.named = false,
},
[anon_sym_MOVE] = {
.visible = true,
.named = false,
},
[anon_sym_RENAME] = {
.visible = true,
.named = false,
},
[anon_sym_C] = {
.visible = true,
.named = false,
},
[anon_sym_COPY] = {
.visible = true,
.named = false,
},
[sym_generic_operation] = {
.visible = true,
.named = true,
},
@@ -122,6 +207,26 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = true,
.named = true,
},
[sym_operation] = {
.visible = true,
.named = true,
},
[sym_op_add] = {
.visible = true,
.named = true,
},
[sym_op_delete] = {
.visible = true,
.named = true,
},
[sym_op_move] = {
.visible = true,
.named = true,
},
[sym_op_copy] = {
.visible = true,
.named = true,
},
[aux_sym_source_file_repeat1] = {
.visible = false,
.named = false,
@@ -194,6 +299,11 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = {
[19] = 19,
[20] = 20,
[21] = 21,
[22] = 22,
[23] = 23,
[24] = 24,
[25] = 25,
[26] = 26,
};
static bool ts_lex(TSLexer *lexer, TSStateId state) {
@@ -204,9 +314,14 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (eof) ADVANCE(2);
if (lookahead == '\n') ADVANCE(3);
if (lookahead == ':') ADVANCE(4);
if (lookahead == 'A') ADVANCE(7);
if (lookahead == 'C') ADVANCE(15);
if (lookahead == 'D') ADVANCE(9);
if (lookahead == 'M') ADVANCE(11);
if (lookahead == 'R') ADVANCE(19);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(0);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(6);
if (('B' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(5);
END_STATE();
@@ -215,7 +330,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
lookahead == ' ') SKIP(1);
if (lookahead != 0 &&
lookahead != '\t' &&
lookahead != '\n') ADVANCE(7);
lookahead != '\n') ADVANCE(6);
END_STATE();
case 2:
ACCEPT_TOKEN(ts_builtin_sym_end);
@@ -232,13 +347,128 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
('a' <= lookahead && lookahead <= 'z')) ADVANCE(5);
END_STATE();
case 6:
ACCEPT_TOKEN(sym_operation);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(6);
END_STATE();
case 7:
ACCEPT_TOKEN(sym_file_path);
if (lookahead != 0 &&
lookahead != '\n') ADVANCE(7);
lookahead != '\n') ADVANCE(6);
END_STATE();
case 7:
ACCEPT_TOKEN(anon_sym_A);
if (lookahead == 'D') ADVANCE(18);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 8:
ACCEPT_TOKEN(anon_sym_ADD);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 9:
ACCEPT_TOKEN(anon_sym_D);
if (lookahead == 'E') ADVANCE(24);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 10:
ACCEPT_TOKEN(anon_sym_DELETE);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 11:
ACCEPT_TOKEN(anon_sym_M);
if (lookahead == 'O') ADVANCE(29);
if (lookahead == 'V') ADVANCE(12);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 12:
ACCEPT_TOKEN(anon_sym_MV);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 13:
ACCEPT_TOKEN(anon_sym_MOVE);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 14:
ACCEPT_TOKEN(anon_sym_RENAME);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 15:
ACCEPT_TOKEN(anon_sym_C);
if (lookahead == 'O') ADVANCE(27);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 16:
ACCEPT_TOKEN(anon_sym_COPY);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 17:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'A') ADVANCE(25);
if (('B' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 18:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'D') ADVANCE(8);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 19:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'E') ADVANCE(26);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 20:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'E') ADVANCE(28);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 21:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'E') ADVANCE(13);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 22:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'E') ADVANCE(10);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 23:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'E') ADVANCE(14);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 24:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'L') ADVANCE(20);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 25:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'M') ADVANCE(23);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 26:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'N') ADVANCE(17);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 27:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'P') ADVANCE(30);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 28:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'T') ADVANCE(22);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 29:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'V') ADVANCE(21);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 30:
ACCEPT_TOKEN(sym_generic_operation);
if (lookahead == 'Y') ADVANCE(16);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
case 31:
ACCEPT_TOKEN(sym_generic_operation);
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(31);
END_STATE();
default:
return false;
@@ -257,17 +487,22 @@ static const TSLexerMode ts_lex_modes[STATE_COUNT] = {
[8] = {.lex_state = 0},
[9] = {.lex_state = 0},
[10] = {.lex_state = 0},
[11] = {.lex_state = 1},
[11] = {.lex_state = 0},
[12] = {.lex_state = 0},
[13] = {.lex_state = 0},
[14] = {.lex_state = 0},
[15] = {.lex_state = 1},
[15] = {.lex_state = 0},
[16] = {.lex_state = 1},
[17] = {.lex_state = 0},
[18] = {.lex_state = 1},
[19] = {.lex_state = 0},
[20] = {.lex_state = 0},
[18] = {.lex_state = 0},
[19] = {.lex_state = 1},
[20] = {.lex_state = 1},
[21] = {.lex_state = 0},
[22] = {.lex_state = 0},
[23] = {.lex_state = 1},
[24] = {.lex_state = 0},
[25] = {.lex_state = 0},
[26] = {.lex_state = 0},
};
static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
@@ -276,190 +511,343 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
[anon_sym_LF] = ACTIONS(1),
[anon_sym_COLON] = ACTIONS(1),
[sym_prefix] = ACTIONS(1),
[sym_operation] = ACTIONS(1),
[anon_sym_A] = ACTIONS(1),
[anon_sym_ADD] = ACTIONS(1),
[anon_sym_D] = ACTIONS(1),
[anon_sym_DELETE] = ACTIONS(1),
[anon_sym_M] = ACTIONS(1),
[anon_sym_MV] = ACTIONS(1),
[anon_sym_MOVE] = ACTIONS(1),
[anon_sym_RENAME] = ACTIONS(1),
[anon_sym_C] = ACTIONS(1),
[anon_sym_COPY] = ACTIONS(1),
[sym_generic_operation] = ACTIONS(1),
},
[STATE(1)] = {
[sym_source_file] = STATE(12),
[sym_source_file] = STATE(17),
[sym_line] = STATE(2),
[sym_empty_line] = STATE(4),
[sym_path_only_line] = STATE(4),
[sym_mapping_line] = STATE(4),
[sym_operation_line] = STATE(4),
[sym_operation_only_line] = STATE(4),
[sym_empty_line] = STATE(5),
[sym_path_only_line] = STATE(5),
[sym_mapping_line] = STATE(5),
[sym_operation_line] = STATE(5),
[sym_operation_only_line] = STATE(5),
[sym_operation] = STATE(15),
[sym_op_add] = STATE(13),
[sym_op_delete] = STATE(13),
[sym_op_move] = STATE(13),
[sym_op_copy] = STATE(13),
[aux_sym_source_file_repeat1] = STATE(2),
[ts_builtin_sym_end] = ACTIONS(3),
[anon_sym_LF] = ACTIONS(5),
[anon_sym_COLON] = ACTIONS(7),
[sym_prefix] = ACTIONS(9),
[sym_operation] = ACTIONS(11),
[anon_sym_A] = ACTIONS(11),
[anon_sym_ADD] = ACTIONS(11),
[anon_sym_D] = ACTIONS(13),
[anon_sym_DELETE] = ACTIONS(13),
[anon_sym_M] = ACTIONS(15),
[anon_sym_MV] = ACTIONS(15),
[anon_sym_MOVE] = ACTIONS(15),
[anon_sym_RENAME] = ACTIONS(15),
[anon_sym_C] = ACTIONS(17),
[anon_sym_COPY] = ACTIONS(17),
[sym_generic_operation] = ACTIONS(19),
},
[STATE(2)] = {
[sym_line] = STATE(3),
[sym_empty_line] = STATE(4),
[sym_path_only_line] = STATE(4),
[sym_mapping_line] = STATE(4),
[sym_operation_line] = STATE(4),
[sym_operation_only_line] = STATE(4),
[sym_empty_line] = STATE(5),
[sym_path_only_line] = STATE(5),
[sym_mapping_line] = STATE(5),
[sym_operation_line] = STATE(5),
[sym_operation_only_line] = STATE(5),
[sym_operation] = STATE(15),
[sym_op_add] = STATE(13),
[sym_op_delete] = STATE(13),
[sym_op_move] = STATE(13),
[sym_op_copy] = STATE(13),
[aux_sym_source_file_repeat1] = STATE(3),
[ts_builtin_sym_end] = ACTIONS(13),
[ts_builtin_sym_end] = ACTIONS(21),
[anon_sym_LF] = ACTIONS(5),
[anon_sym_COLON] = ACTIONS(7),
[sym_prefix] = ACTIONS(9),
[sym_operation] = ACTIONS(11),
[anon_sym_A] = ACTIONS(11),
[anon_sym_ADD] = ACTIONS(11),
[anon_sym_D] = ACTIONS(13),
[anon_sym_DELETE] = ACTIONS(13),
[anon_sym_M] = ACTIONS(15),
[anon_sym_MV] = ACTIONS(15),
[anon_sym_MOVE] = ACTIONS(15),
[anon_sym_RENAME] = ACTIONS(15),
[anon_sym_C] = ACTIONS(17),
[anon_sym_COPY] = ACTIONS(17),
[sym_generic_operation] = ACTIONS(19),
},
[STATE(3)] = {
[sym_line] = STATE(3),
[sym_empty_line] = STATE(4),
[sym_path_only_line] = STATE(4),
[sym_mapping_line] = STATE(4),
[sym_operation_line] = STATE(4),
[sym_operation_only_line] = STATE(4),
[sym_empty_line] = STATE(5),
[sym_path_only_line] = STATE(5),
[sym_mapping_line] = STATE(5),
[sym_operation_line] = STATE(5),
[sym_operation_only_line] = STATE(5),
[sym_operation] = STATE(15),
[sym_op_add] = STATE(13),
[sym_op_delete] = STATE(13),
[sym_op_move] = STATE(13),
[sym_op_copy] = STATE(13),
[aux_sym_source_file_repeat1] = STATE(3),
[ts_builtin_sym_end] = ACTIONS(15),
[anon_sym_LF] = ACTIONS(17),
[anon_sym_COLON] = ACTIONS(20),
[sym_prefix] = ACTIONS(23),
[sym_operation] = ACTIONS(26),
[ts_builtin_sym_end] = ACTIONS(23),
[anon_sym_LF] = ACTIONS(25),
[anon_sym_COLON] = ACTIONS(28),
[sym_prefix] = ACTIONS(31),
[anon_sym_A] = ACTIONS(34),
[anon_sym_ADD] = ACTIONS(34),
[anon_sym_D] = ACTIONS(37),
[anon_sym_DELETE] = ACTIONS(37),
[anon_sym_M] = ACTIONS(40),
[anon_sym_MV] = ACTIONS(40),
[anon_sym_MOVE] = ACTIONS(40),
[anon_sym_RENAME] = ACTIONS(40),
[anon_sym_C] = ACTIONS(43),
[anon_sym_COPY] = ACTIONS(43),
[sym_generic_operation] = ACTIONS(46),
},
[STATE(4)] = {
[ts_builtin_sym_end] = ACTIONS(49),
[anon_sym_LF] = ACTIONS(49),
[anon_sym_COLON] = ACTIONS(49),
[sym_prefix] = ACTIONS(49),
[anon_sym_A] = ACTIONS(51),
[anon_sym_ADD] = ACTIONS(51),
[anon_sym_D] = ACTIONS(51),
[anon_sym_DELETE] = ACTIONS(51),
[anon_sym_M] = ACTIONS(51),
[anon_sym_MV] = ACTIONS(51),
[anon_sym_MOVE] = ACTIONS(51),
[anon_sym_RENAME] = ACTIONS(51),
[anon_sym_C] = ACTIONS(51),
[anon_sym_COPY] = ACTIONS(51),
[sym_generic_operation] = ACTIONS(51),
},
[STATE(5)] = {
[ts_builtin_sym_end] = ACTIONS(53),
[anon_sym_LF] = ACTIONS(53),
[anon_sym_COLON] = ACTIONS(53),
[sym_prefix] = ACTIONS(53),
[anon_sym_A] = ACTIONS(55),
[anon_sym_ADD] = ACTIONS(55),
[anon_sym_D] = ACTIONS(55),
[anon_sym_DELETE] = ACTIONS(55),
[anon_sym_M] = ACTIONS(55),
[anon_sym_MV] = ACTIONS(55),
[anon_sym_MOVE] = ACTIONS(55),
[anon_sym_RENAME] = ACTIONS(55),
[anon_sym_C] = ACTIONS(55),
[anon_sym_COPY] = ACTIONS(55),
[sym_generic_operation] = ACTIONS(55),
},
[STATE(6)] = {
[ts_builtin_sym_end] = ACTIONS(57),
[anon_sym_LF] = ACTIONS(57),
[anon_sym_COLON] = ACTIONS(57),
[sym_prefix] = ACTIONS(57),
[anon_sym_A] = ACTIONS(59),
[anon_sym_ADD] = ACTIONS(59),
[anon_sym_D] = ACTIONS(59),
[anon_sym_DELETE] = ACTIONS(59),
[anon_sym_M] = ACTIONS(59),
[anon_sym_MV] = ACTIONS(59),
[anon_sym_MOVE] = ACTIONS(59),
[anon_sym_RENAME] = ACTIONS(59),
[anon_sym_C] = ACTIONS(59),
[anon_sym_COPY] = ACTIONS(59),
[sym_generic_operation] = ACTIONS(59),
},
[STATE(7)] = {
[ts_builtin_sym_end] = ACTIONS(61),
[anon_sym_LF] = ACTIONS(61),
[anon_sym_COLON] = ACTIONS(61),
[sym_prefix] = ACTIONS(61),
[anon_sym_A] = ACTIONS(63),
[anon_sym_ADD] = ACTIONS(63),
[anon_sym_D] = ACTIONS(63),
[anon_sym_DELETE] = ACTIONS(63),
[anon_sym_M] = ACTIONS(63),
[anon_sym_MV] = ACTIONS(63),
[anon_sym_MOVE] = ACTIONS(63),
[anon_sym_RENAME] = ACTIONS(63),
[anon_sym_C] = ACTIONS(63),
[anon_sym_COPY] = ACTIONS(63),
[sym_generic_operation] = ACTIONS(63),
},
[STATE(8)] = {
[ts_builtin_sym_end] = ACTIONS(65),
[anon_sym_LF] = ACTIONS(65),
[anon_sym_COLON] = ACTIONS(65),
[sym_prefix] = ACTIONS(65),
[anon_sym_A] = ACTIONS(67),
[anon_sym_ADD] = ACTIONS(67),
[anon_sym_D] = ACTIONS(67),
[anon_sym_DELETE] = ACTIONS(67),
[anon_sym_M] = ACTIONS(67),
[anon_sym_MV] = ACTIONS(67),
[anon_sym_MOVE] = ACTIONS(67),
[anon_sym_RENAME] = ACTIONS(67),
[anon_sym_C] = ACTIONS(67),
[anon_sym_COPY] = ACTIONS(67),
[sym_generic_operation] = ACTIONS(67),
},
[STATE(9)] = {
[ts_builtin_sym_end] = ACTIONS(69),
[anon_sym_LF] = ACTIONS(69),
[anon_sym_COLON] = ACTIONS(69),
[sym_prefix] = ACTIONS(69),
[anon_sym_A] = ACTIONS(71),
[anon_sym_ADD] = ACTIONS(71),
[anon_sym_D] = ACTIONS(71),
[anon_sym_DELETE] = ACTIONS(71),
[anon_sym_M] = ACTIONS(71),
[anon_sym_MV] = ACTIONS(71),
[anon_sym_MOVE] = ACTIONS(71),
[anon_sym_RENAME] = ACTIONS(71),
[anon_sym_C] = ACTIONS(71),
[anon_sym_COPY] = ACTIONS(71),
[sym_generic_operation] = ACTIONS(71),
},
};
static const uint16_t ts_small_parse_table[] = {
[0] = 1,
ACTIONS(29), 5,
ts_builtin_sym_end,
anon_sym_LF,
ACTIONS(73), 2,
anon_sym_COLON,
sym_prefix,
sym_operation,
[8] = 1,
ACTIONS(31), 5,
ts_builtin_sym_end,
anon_sym_LF,
[5] = 1,
ACTIONS(75), 2,
anon_sym_COLON,
sym_prefix,
sym_operation,
[16] = 1,
ACTIONS(33), 5,
ts_builtin_sym_end,
anon_sym_LF,
[10] = 1,
ACTIONS(77), 2,
anon_sym_COLON,
sym_prefix,
sym_operation,
[24] = 1,
ACTIONS(35), 5,
ts_builtin_sym_end,
anon_sym_LF,
[15] = 1,
ACTIONS(79), 2,
anon_sym_COLON,
sym_prefix,
sym_operation,
[20] = 1,
ACTIONS(81), 2,
anon_sym_COLON,
sym_prefix,
[25] = 2,
ACTIONS(83), 1,
anon_sym_COLON,
ACTIONS(85), 1,
sym_prefix,
[32] = 1,
ACTIONS(37), 5,
ACTIONS(87), 1,
sym_file_path,
[36] = 1,
ACTIONS(89), 1,
ts_builtin_sym_end,
anon_sym_LF,
anon_sym_COLON,
sym_prefix,
sym_operation,
[40] = 1,
ACTIONS(39), 5,
ts_builtin_sym_end,
anon_sym_LF,
ACTIONS(91), 1,
anon_sym_COLON,
sym_prefix,
sym_operation,
[48] = 2,
ACTIONS(41), 1,
anon_sym_COLON,
ACTIONS(43), 1,
sym_prefix,
[55] = 1,
ACTIONS(45), 1,
[44] = 1,
ACTIONS(93), 1,
sym_file_path,
[59] = 1,
ACTIONS(47), 1,
ts_builtin_sym_end,
[63] = 1,
ACTIONS(49), 1,
anon_sym_COLON,
[67] = 1,
ACTIONS(51), 1,
[48] = 1,
ACTIONS(95), 1,
sym_file_path,
[52] = 1,
ACTIONS(97), 1,
anon_sym_LF,
[71] = 1,
ACTIONS(53), 1,
sym_file_path,
[75] = 1,
ACTIONS(55), 1,
sym_file_path,
[79] = 1,
ACTIONS(57), 1,
[56] = 1,
ACTIONS(99), 1,
anon_sym_LF,
[83] = 1,
ACTIONS(59), 1,
[60] = 1,
ACTIONS(101), 1,
sym_file_path,
[87] = 1,
ACTIONS(61), 1,
[64] = 1,
ACTIONS(103), 1,
anon_sym_LF,
[68] = 1,
ACTIONS(105), 1,
anon_sym_COLON,
[91] = 1,
ACTIONS(63), 1,
anon_sym_LF,
[95] = 1,
ACTIONS(65), 1,
[72] = 1,
ACTIONS(107), 1,
anon_sym_LF,
};
static const uint32_t ts_small_parse_table_map[] = {
[SMALL_STATE(4)] = 0,
[SMALL_STATE(5)] = 8,
[SMALL_STATE(6)] = 16,
[SMALL_STATE(7)] = 24,
[SMALL_STATE(8)] = 32,
[SMALL_STATE(9)] = 40,
[SMALL_STATE(10)] = 48,
[SMALL_STATE(11)] = 55,
[SMALL_STATE(12)] = 59,
[SMALL_STATE(13)] = 63,
[SMALL_STATE(14)] = 67,
[SMALL_STATE(15)] = 71,
[SMALL_STATE(16)] = 75,
[SMALL_STATE(17)] = 79,
[SMALL_STATE(18)] = 83,
[SMALL_STATE(19)] = 87,
[SMALL_STATE(20)] = 91,
[SMALL_STATE(21)] = 95,
[SMALL_STATE(10)] = 0,
[SMALL_STATE(11)] = 5,
[SMALL_STATE(12)] = 10,
[SMALL_STATE(13)] = 15,
[SMALL_STATE(14)] = 20,
[SMALL_STATE(15)] = 25,
[SMALL_STATE(16)] = 32,
[SMALL_STATE(17)] = 36,
[SMALL_STATE(18)] = 40,
[SMALL_STATE(19)] = 44,
[SMALL_STATE(20)] = 48,
[SMALL_STATE(21)] = 52,
[SMALL_STATE(22)] = 56,
[SMALL_STATE(23)] = 60,
[SMALL_STATE(24)] = 64,
[SMALL_STATE(25)] = 68,
[SMALL_STATE(26)] = 72,
};
static const TSParseActionEntry ts_parse_actions[] = {
[0] = {.entry = {.count = 0, .reusable = false}},
[1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(),
[3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0, 0, 0),
[5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5),
[7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11),
[9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13),
[11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10),
[13] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0),
[15] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0),
[17] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(5),
[20] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(11),
[23] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(13),
[26] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(10),
[29] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_line, 1, 0, 0),
[31] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_empty_line, 1, 0, 0),
[33] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_mapping_line, 4, 0, 2),
[35] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_path_only_line, 3, 0, 1),
[37] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operation_only_line, 4, 0, 3),
[39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operation_line, 5, 0, 4),
[41] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16),
[43] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19),
[45] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14),
[47] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(),
[49] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15),
[51] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7),
[53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20),
[55] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17),
[57] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8),
[59] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21),
[61] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18),
[63] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6),
[65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9),
[5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4),
[7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16),
[9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18),
[11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11),
[13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12),
[15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10),
[17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14),
[19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(13),
[21] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0),
[23] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0),
[25] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(4),
[28] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(16),
[31] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(18),
[34] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(11),
[37] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(12),
[40] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(10),
[43] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(14),
[46] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(13),
[49] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_empty_line, 1, 0, 0),
[51] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_empty_line, 1, 0, 0),
[53] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_line, 1, 0, 0),
[55] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_line, 1, 0, 0),
[57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_mapping_line, 4, 0, 2),
[59] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_mapping_line, 4, 0, 2),
[61] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_path_only_line, 3, 0, 1),
[63] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_path_only_line, 3, 0, 1),
[65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operation_only_line, 4, 0, 3),
[67] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operation_only_line, 4, 0, 3),
[69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operation_line, 5, 0, 4),
[71] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_operation_line, 5, 0, 4),
[73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_op_move, 1, 0, 0),
[75] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_op_add, 1, 0, 0),
[77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_op_delete, 1, 0, 0),
[79] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_operation, 1, 0, 0),
[81] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_op_copy, 1, 0, 0),
[83] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20),
[85] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25),
[87] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24),
[89] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(),
[91] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19),
[93] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21),
[95] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22),
[97] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6),
[99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8),
[101] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26),
[103] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7),
[105] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23),
[107] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9),
};
#ifdef __cplusplus