Commit
+721 -416 +/-5 browse
1 | diff --git a/grammar.js b/grammar.js |
2 | index d9f22a9..f5e0ada 100644 |
3 | --- a/grammar.js |
4 | +++ b/grammar.js |
5 | @@ -2,15 +2,27 @@ const NEWLINE = /\r?\n/; |
6 | const WHITE_SPACE = /[\t\f\v ]+/; |
7 | const ANYTHING = /[^\r\n]+/; |
8 | |
9 | - const COMMAND_PRELUDE = prec(30, token.immediate("diff")); |
10 | - const INDEX_PRELUDE = prec(25, token.immediate("index")); |
11 | - const FILE_PRELUDE = prec( |
12 | - 20, |
13 | - token.immediate(field("kind", choice("---", "+++"))) |
14 | + const PREC = { |
15 | + COMMAND: 50, |
16 | + FILE_CHANGE: 47, |
17 | + INDEX: 45, |
18 | + FILE: 40, |
19 | + LOCATION: 35, |
20 | + ADDITION: 30, |
21 | + DELETION: 25, |
22 | + }; |
23 | + |
24 | + const COMMAND_PRELUDE = token.immediate(prec(PREC.COMMAND, "diff")); |
25 | + const FILE_CHANGE_PRELUDE = token.immediate( |
26 | + prec(PREC.FILE_CHANGE, field("kind", choice("new", "deleted"))) |
27 | + ); |
28 | + const INDEX_PRELUDE = token.immediate(prec(PREC.INDEX, "index")); |
29 | + const FILE_PRELUDE = token.immediate( |
30 | + prec(PREC.FILE, field("kind", choice("---", "+++"))) |
31 | ); |
32 | - const LOCATION_PRELUDE = prec(15, token.immediate("@@")); |
33 | - const ADDITION_PRELUDE = prec(10, token.immediate("+")); |
34 | - const DELETION_PRELUDE = prec(5, token.immediate("-")); |
35 | + const LOCATION_PRELUDE = token.immediate(prec(PREC.LOCATION, "@@")); |
36 | + const ADDITION_PRELUDE = token.immediate(prec(PREC.ADDITION, "+")); |
37 | + const DELETION_PRELUDE = token.immediate(prec(PREC.DELETION, "-")); |
38 | |
39 | module.exports = grammar({ |
40 | name: "gitdiff", |
41 | @@ -23,6 +35,7 @@ module.exports = grammar({ |
42 | _line: ($) => |
43 | choice( |
44 | $.command, |
45 | + $.file_change, |
46 | $.index, |
47 | $.file, |
48 | $.location, |
49 | @@ -33,7 +46,10 @@ module.exports = grammar({ |
50 | |
51 | command: ($) => seq(COMMAND_PRELUDE, "--git", $.filename), |
52 | |
53 | - index: ($) => seq(INDEX_PRELUDE, $.commit, "..", $.commit, $.mode), |
54 | + file_change: ($) => seq(FILE_CHANGE_PRELUDE, "file", "mode", $.mode), |
55 | + |
56 | + index: ($) => |
57 | + seq(INDEX_PRELUDE, $.commit, "..", $.commit, optional($.mode)), |
58 | |
59 | file: ($) => seq(FILE_PRELUDE, $.filename), |
60 | |
61 | diff --git a/src/grammar.json b/src/grammar.json |
62 | index b9061f6..4a7f049 100644 |
63 | --- a/src/grammar.json |
64 | +++ b/src/grammar.json |
65 | @@ -26,6 +26,10 @@ |
66 | }, |
67 | { |
68 | "type": "SYMBOL", |
69 | + "name": "file_change" |
70 | + }, |
71 | + { |
72 | + "type": "SYMBOL", |
73 | "name": "index" |
74 | }, |
75 | { |
76 | @@ -54,10 +58,10 @@ |
77 | "type": "SEQ", |
78 | "members": [ |
79 | { |
80 | - "type": "PREC", |
81 | - "value": 30, |
82 | + "type": "IMMEDIATE_TOKEN", |
83 | "content": { |
84 | - "type": "IMMEDIATE_TOKEN", |
85 | + "type": "PREC", |
86 | + "value": 50, |
87 | "content": { |
88 | "type": "STRING", |
89 | "value": "diff" |
90 | @@ -74,14 +78,55 @@ |
91 | } |
92 | ] |
93 | }, |
94 | + "file_change": { |
95 | + "type": "SEQ", |
96 | + "members": [ |
97 | + { |
98 | + "type": "IMMEDIATE_TOKEN", |
99 | + "content": { |
100 | + "type": "PREC", |
101 | + "value": 47, |
102 | + "content": { |
103 | + "type": "FIELD", |
104 | + "name": "kind", |
105 | + "content": { |
106 | + "type": "CHOICE", |
107 | + "members": [ |
108 | + { |
109 | + "type": "STRING", |
110 | + "value": "new" |
111 | + }, |
112 | + { |
113 | + "type": "STRING", |
114 | + "value": "deleted" |
115 | + } |
116 | + ] |
117 | + } |
118 | + } |
119 | + } |
120 | + }, |
121 | + { |
122 | + "type": "STRING", |
123 | + "value": "file" |
124 | + }, |
125 | + { |
126 | + "type": "STRING", |
127 | + "value": "mode" |
128 | + }, |
129 | + { |
130 | + "type": "SYMBOL", |
131 | + "name": "mode" |
132 | + } |
133 | + ] |
134 | + }, |
135 | "index": { |
136 | "type": "SEQ", |
137 | "members": [ |
138 | { |
139 | - "type": "PREC", |
140 | - "value": 25, |
141 | + "type": "IMMEDIATE_TOKEN", |
142 | "content": { |
143 | - "type": "IMMEDIATE_TOKEN", |
144 | + "type": "PREC", |
145 | + "value": 45, |
146 | "content": { |
147 | "type": "STRING", |
148 | "value": "index" |
149 | @@ -101,8 +146,16 @@ |
150 | "name": "commit" |
151 | }, |
152 | { |
153 | - "type": "SYMBOL", |
154 | - "name": "mode" |
155 | + "type": "CHOICE", |
156 | + "members": [ |
157 | + { |
158 | + "type": "SYMBOL", |
159 | + "name": "mode" |
160 | + }, |
161 | + { |
162 | + "type": "BLANK" |
163 | + } |
164 | + ] |
165 | } |
166 | ] |
167 | }, |
168 | @@ -110,10 +163,10 @@ |
169 | "type": "SEQ", |
170 | "members": [ |
171 | { |
172 | - "type": "PREC", |
173 | - "value": 20, |
174 | + "type": "IMMEDIATE_TOKEN", |
175 | "content": { |
176 | - "type": "IMMEDIATE_TOKEN", |
177 | + "type": "PREC", |
178 | + "value": 40, |
179 | "content": { |
180 | "type": "FIELD", |
181 | "name": "kind", |
182 | @@ -143,10 +196,10 @@ |
183 | "type": "SEQ", |
184 | "members": [ |
185 | { |
186 | - "type": "PREC", |
187 | - "value": 15, |
188 | + "type": "IMMEDIATE_TOKEN", |
189 | "content": { |
190 | - "type": "IMMEDIATE_TOKEN", |
191 | + "type": "PREC", |
192 | + "value": 35, |
193 | "content": { |
194 | "type": "STRING", |
195 | "value": "@@" |
196 | @@ -175,10 +228,10 @@ |
197 | "type": "SEQ", |
198 | "members": [ |
199 | { |
200 | - "type": "PREC", |
201 | - "value": 10, |
202 | + "type": "IMMEDIATE_TOKEN", |
203 | "content": { |
204 | - "type": "IMMEDIATE_TOKEN", |
205 | + "type": "PREC", |
206 | + "value": 30, |
207 | "content": { |
208 | "type": "STRING", |
209 | "value": "+" |
210 | @@ -203,10 +256,10 @@ |
211 | "type": "SEQ", |
212 | "members": [ |
213 | { |
214 | - "type": "PREC", |
215 | - "value": 5, |
216 | + "type": "IMMEDIATE_TOKEN", |
217 | "content": { |
218 | - "type": "IMMEDIATE_TOKEN", |
219 | + "type": "PREC", |
220 | + "value": 25, |
221 | "content": { |
222 | "type": "STRING", |
223 | "value": "-" |
224 | diff --git a/src/node-types.json b/src/node-types.json |
225 | index 51fc099..0d08ca2 100644 |
226 | --- a/src/node-types.json |
227 | +++ b/src/node-types.json |
228 | @@ -40,6 +40,21 @@ |
229 | } |
230 | }, |
231 | { |
232 | + "type": "file_change", |
233 | + "named": true, |
234 | + "fields": {}, |
235 | + "children": { |
236 | + "multiple": false, |
237 | + "required": true, |
238 | + "types": [ |
239 | + { |
240 | + "type": "mode", |
241 | + "named": true |
242 | + } |
243 | + ] |
244 | + } |
245 | + }, |
246 | + { |
247 | "type": "filename", |
248 | "named": true, |
249 | "fields": {} |
250 | @@ -107,6 +122,10 @@ |
251 | "named": true |
252 | }, |
253 | { |
254 | + "type": "file_change", |
255 | + "named": true |
256 | + }, |
257 | + { |
258 | "type": "index", |
259 | "named": true |
260 | }, |
261 | @@ -150,6 +169,10 @@ |
262 | "named": false |
263 | }, |
264 | { |
265 | + "type": "file", |
266 | + "named": false |
267 | + }, |
268 | + { |
269 | "type": "index", |
270 | "named": false |
271 | }, |
272 | @@ -160,5 +183,9 @@ |
273 | { |
274 | "type": "mode", |
275 | "named": true |
276 | + }, |
277 | + { |
278 | + "type": "mode", |
279 | + "named": false |
280 | } |
281 | ] |
282 | \ No newline at end of file |
283 | diff --git a/src/parser.c b/src/parser.c |
284 | index f5f5299..a5d7b93 100644 |
285 | --- a/src/parser.c |
286 | +++ b/src/parser.c |
287 | @@ -6,11 +6,11 @@ |
288 | #endif |
289 | |
290 | #define LANGUAGE_VERSION 13 |
291 | - #define STATE_COUNT 27 |
292 | + #define STATE_COUNT 31 |
293 | #define LARGE_STATE_COUNT 4 |
294 | - #define SYMBOL_COUNT 26 |
295 | + #define SYMBOL_COUNT 30 |
296 | #define ALIAS_COUNT 0 |
297 | - #define TOKEN_COUNT 16 |
298 | + #define TOKEN_COUNT 19 |
299 | #define EXTERNAL_TOKEN_COUNT 0 |
300 | #define FIELD_COUNT 0 |
301 | #define MAX_ALIAS_SEQUENCE_LENGTH 5 |
302 | @@ -20,28 +20,32 @@ enum { |
303 | aux_sym_source_token1 = 1, |
304 | anon_sym_diff = 2, |
305 | anon_sym_DASH_DASHgit = 3, |
306 | - anon_sym_index = 4, |
307 | - anon_sym_DOT_DOT = 5, |
308 | - aux_sym_file_token1 = 6, |
309 | - anon_sym_AT_AT = 7, |
310 | - anon_sym_AT_AT2 = 8, |
311 | - aux_sym_location_token1 = 9, |
312 | - anon_sym_PLUS = 10, |
313 | - anon_sym_DASH = 11, |
314 | - sym_context = 12, |
315 | - sym_linerange = 13, |
316 | - sym_commit = 14, |
317 | - sym_mode = 15, |
318 | - sym_source = 16, |
319 | - sym__line = 17, |
320 | - sym_command = 18, |
321 | - sym_index = 19, |
322 | - sym_file = 20, |
323 | - sym_location = 21, |
324 | - sym_addition = 22, |
325 | - sym_deletion = 23, |
326 | - sym_filename = 24, |
327 | - aux_sym_source_repeat1 = 25, |
328 | + aux_sym_file_change_token1 = 4, |
329 | + anon_sym_file = 5, |
330 | + anon_sym_mode = 6, |
331 | + anon_sym_index = 7, |
332 | + anon_sym_DOT_DOT = 8, |
333 | + aux_sym_file_token1 = 9, |
334 | + anon_sym_AT_AT = 10, |
335 | + anon_sym_AT_AT2 = 11, |
336 | + aux_sym_location_token1 = 12, |
337 | + anon_sym_PLUS = 13, |
338 | + anon_sym_DASH = 14, |
339 | + sym_context = 15, |
340 | + sym_linerange = 16, |
341 | + sym_commit = 17, |
342 | + sym_mode = 18, |
343 | + sym_source = 19, |
344 | + sym__line = 20, |
345 | + sym_command = 21, |
346 | + sym_file_change = 22, |
347 | + sym_index = 23, |
348 | + sym_file = 24, |
349 | + sym_location = 25, |
350 | + sym_addition = 26, |
351 | + sym_deletion = 27, |
352 | + sym_filename = 28, |
353 | + aux_sym_source_repeat1 = 29, |
354 | }; |
355 | |
356 | static const char * const ts_symbol_names[] = { |
357 | @@ -49,6 +53,9 @@ static const char * const ts_symbol_names[] = { |
358 | [aux_sym_source_token1] = "source_token1", |
359 | [anon_sym_diff] = "diff", |
360 | [anon_sym_DASH_DASHgit] = "--git", |
361 | + [aux_sym_file_change_token1] = "file_change_token1", |
362 | + [anon_sym_file] = "file", |
363 | + [anon_sym_mode] = "mode", |
364 | [anon_sym_index] = "index", |
365 | [anon_sym_DOT_DOT] = "..", |
366 | [aux_sym_file_token1] = "file_token1", |
367 | @@ -64,6 +71,7 @@ static const char * const ts_symbol_names[] = { |
368 | [sym_source] = "source", |
369 | [sym__line] = "_line", |
370 | [sym_command] = "command", |
371 | + [sym_file_change] = "file_change", |
372 | [sym_index] = "index", |
373 | [sym_file] = "file", |
374 | [sym_location] = "location", |
375 | @@ -78,6 +86,9 @@ static const TSSymbol ts_symbol_map[] = { |
376 | [aux_sym_source_token1] = aux_sym_source_token1, |
377 | [anon_sym_diff] = anon_sym_diff, |
378 | [anon_sym_DASH_DASHgit] = anon_sym_DASH_DASHgit, |
379 | + [aux_sym_file_change_token1] = aux_sym_file_change_token1, |
380 | + [anon_sym_file] = anon_sym_file, |
381 | + [anon_sym_mode] = anon_sym_mode, |
382 | [anon_sym_index] = anon_sym_index, |
383 | [anon_sym_DOT_DOT] = anon_sym_DOT_DOT, |
384 | [aux_sym_file_token1] = aux_sym_file_token1, |
385 | @@ -93,6 +104,7 @@ static const TSSymbol ts_symbol_map[] = { |
386 | [sym_source] = sym_source, |
387 | [sym__line] = sym__line, |
388 | [sym_command] = sym_command, |
389 | + [sym_file_change] = sym_file_change, |
390 | [sym_index] = sym_index, |
391 | [sym_file] = sym_file, |
392 | [sym_location] = sym_location, |
393 | @@ -119,6 +131,18 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { |
394 | .visible = true, |
395 | .named = false, |
396 | }, |
397 | + [aux_sym_file_change_token1] = { |
398 | + .visible = false, |
399 | + .named = false, |
400 | + }, |
401 | + [anon_sym_file] = { |
402 | + .visible = true, |
403 | + .named = false, |
404 | + }, |
405 | + [anon_sym_mode] = { |
406 | + .visible = true, |
407 | + .named = false, |
408 | + }, |
409 | [anon_sym_index] = { |
410 | .visible = true, |
411 | .named = false, |
412 | @@ -179,6 +203,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { |
413 | .visible = true, |
414 | .named = true, |
415 | }, |
416 | + [sym_file_change] = { |
417 | + .visible = true, |
418 | + .named = true, |
419 | + }, |
420 | [sym_index] = { |
421 | .visible = true, |
422 | .named = true, |
423 | @@ -222,468 +250,580 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { |
424 | eof = lexer->eof(lexer); |
425 | switch (state) { |
426 | case 0: |
427 | - if (eof) ADVANCE(31); |
428 | - if (lookahead == '\n') ADVANCE(32); |
429 | + if (eof) ADVANCE(44); |
430 | + if (lookahead == '\n') ADVANCE(45); |
431 | if (lookahead == '\r') ADVANCE(1); |
432 | - if (lookahead == '+') ADVANCE(42); |
433 | - if (lookahead == '-') ADVANCE(44); |
434 | + if (lookahead == '+') ADVANCE(58); |
435 | + if (lookahead == '-') ADVANCE(60); |
436 | if (lookahead == '.') ADVANCE(8); |
437 | if (lookahead == '@') ADVANCE(9); |
438 | - if (lookahead == 'd') ADVANCE(16); |
439 | - if (lookahead == 'i') ADVANCE(18); |
440 | + if (lookahead == 'd') ADVANCE(14); |
441 | + if (lookahead == 'f') ADVANCE(24); |
442 | + if (lookahead == 'i') ADVANCE(28); |
443 | + if (lookahead == 'm') ADVANCE(29); |
444 | + if (lookahead == 'n') ADVANCE(15); |
445 | if (('\t' <= lookahead && lookahead <= '\f') || |
446 | - lookahead == ' ') SKIP(29) |
447 | + lookahead == ' ') SKIP(42) |
448 | if (('0' <= lookahead && lookahead <= '9') || |
449 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(28); |
450 | + ('a' <= lookahead && lookahead <= 'e')) ADVANCE(41); |
451 | END_STATE(); |
452 | case 1: |
453 | - if (lookahead == '\n') ADVANCE(32); |
454 | + if (lookahead == '\n') ADVANCE(45); |
455 | END_STATE(); |
456 | case 2: |
457 | - if (lookahead == '\n') ADVANCE(32); |
458 | + if (lookahead == '\n') ADVANCE(45); |
459 | if (lookahead == '\r') ADVANCE(1); |
460 | + if (lookahead == '+') ADVANCE(34); |
461 | + if (lookahead == '-') ADVANCE(7); |
462 | + if (lookahead == '@') ADVANCE(10); |
463 | if (('\t' <= lookahead && lookahead <= '\f') || |
464 | - lookahead == ' ') ADVANCE(40); |
465 | - if (lookahead != 0) ADVANCE(41); |
466 | + lookahead == ' ') SKIP(2) |
467 | + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(116); |
468 | END_STATE(); |
469 | case 3: |
470 | - if (lookahead == '+') ADVANCE(37); |
471 | + if (lookahead == '\n') ADVANCE(45); |
472 | + if (lookahead == '\r') ADVANCE(1); |
473 | + if (('\t' <= lookahead && lookahead <= '\f') || |
474 | + lookahead == ' ') ADVANCE(56); |
475 | + if (lookahead != 0) ADVANCE(57); |
476 | END_STATE(); |
477 | case 4: |
478 | - if (lookahead == '+') ADVANCE(21); |
479 | - if (lookahead == '-') ADVANCE(7); |
480 | - if (lookahead == '@') ADVANCE(10); |
481 | - if (lookahead == '\t' || |
482 | - lookahead == 11 || |
483 | - lookahead == '\f' || |
484 | - lookahead == ' ') SKIP(4) |
485 | - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(93); |
486 | + if (lookahead == '+') ADVANCE(53); |
487 | END_STATE(); |
488 | case 5: |
489 | - if (lookahead == ',') ADVANCE(22); |
490 | + if (lookahead == ',') ADVANCE(35); |
491 | if (('0' <= lookahead && lookahead <= '9')) ADVANCE(5); |
492 | END_STATE(); |
493 | case 6: |
494 | - if (lookahead == '-') ADVANCE(37); |
495 | + if (lookahead == '-') ADVANCE(53); |
496 | + if (lookahead == 'g') ADVANCE(25); |
497 | END_STATE(); |
498 | case 7: |
499 | - if (lookahead == '-') ADVANCE(15); |
500 | + if (lookahead == '-') ADVANCE(23); |
501 | if (('0' <= lookahead && lookahead <= '9')) ADVANCE(5); |
502 | END_STATE(); |
503 | case 8: |
504 | - if (lookahead == '.') ADVANCE(36); |
505 | + if (lookahead == '.') ADVANCE(52); |
506 | END_STATE(); |
507 | case 9: |
508 | - if (lookahead == '@') ADVANCE(38); |
509 | + if (lookahead == '@') ADVANCE(54); |
510 | END_STATE(); |
511 | case 10: |
512 | - if (lookahead == '@') ADVANCE(39); |
513 | + if (lookahead == '@') ADVANCE(55); |
514 | END_STATE(); |
515 | case 11: |
516 | - if (lookahead == 'd') ADVANCE(12); |
517 | + if (lookahead == 'd') ADVANCE(48); |
518 | END_STATE(); |
519 | case 12: |
520 | - if (lookahead == 'e') ADVANCE(20); |
521 | + if (lookahead == 'd') ADVANCE(17); |
522 | END_STATE(); |
523 | case 13: |
524 | - if (lookahead == 'f') ADVANCE(33); |
525 | + if (lookahead == 'd') ADVANCE(18); |
526 | END_STATE(); |
527 | case 14: |
528 | - if (lookahead == 'f') ADVANCE(13); |
529 | + if (lookahead == 'e') ADVANCE(26); |
530 | + if (lookahead == 'i') ADVANCE(22); |
531 | + if (('0' <= lookahead && lookahead <= '9') || |
532 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(40); |
533 | END_STATE(); |
534 | case 15: |
535 | - if (lookahead == 'g') ADVANCE(17); |
536 | + if (lookahead == 'e') ADVANCE(32); |
537 | END_STATE(); |
538 | case 16: |
539 | - if (lookahead == 'i') ADVANCE(14); |
540 | - if (('0' <= lookahead && lookahead <= '9') || |
541 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(27); |
542 | + if (lookahead == 'e') ADVANCE(49); |
543 | END_STATE(); |
544 | case 17: |
545 | - if (lookahead == 'i') ADVANCE(19); |
546 | + if (lookahead == 'e') ADVANCE(33); |
547 | END_STATE(); |
548 | case 18: |
549 | - if (lookahead == 'n') ADVANCE(11); |
550 | + if (lookahead == 'e') ADVANCE(50); |
551 | END_STATE(); |
552 | case 19: |
553 | - if (lookahead == 't') ADVANCE(34); |
554 | + if (lookahead == 'e') ADVANCE(11); |
555 | END_STATE(); |
556 | case 20: |
557 | - if (lookahead == 'x') ADVANCE(35); |
558 | + if (lookahead == 'e') ADVANCE(31); |
559 | END_STATE(); |
560 | case 21: |
561 | - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(5); |
562 | + if (lookahead == 'f') ADVANCE(46); |
563 | END_STATE(); |
564 | case 22: |
565 | - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(58); |
566 | + if (lookahead == 'f') ADVANCE(21); |
567 | END_STATE(); |
568 | case 23: |
569 | - if (('0' <= lookahead && lookahead <= '9') || |
570 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(92); |
571 | + if (lookahead == 'g') ADVANCE(25); |
572 | END_STATE(); |
573 | case 24: |
574 | + if (lookahead == 'i') ADVANCE(27); |
575 | if (('0' <= lookahead && lookahead <= '9') || |
576 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(23); |
577 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(40); |
578 | END_STATE(); |
579 | case 25: |
580 | - if (('0' <= lookahead && lookahead <= '9') || |
581 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(24); |
582 | + if (lookahead == 'i') ADVANCE(30); |
583 | END_STATE(); |
584 | case 26: |
585 | + if (lookahead == 'l') ADVANCE(20); |
586 | if (('0' <= lookahead && lookahead <= '9') || |
587 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(25); |
588 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(39); |
589 | END_STATE(); |
590 | case 27: |
591 | - if (('0' <= lookahead && lookahead <= '9') || |
592 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(26); |
593 | + if (lookahead == 'l') ADVANCE(16); |
594 | END_STATE(); |
595 | case 28: |
596 | - if (('0' <= lookahead && lookahead <= '9') || |
597 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(27); |
598 | + if (lookahead == 'n') ADVANCE(12); |
599 | END_STATE(); |
600 | case 29: |
601 | - if (eof) ADVANCE(31); |
602 | - if (lookahead == '\n') ADVANCE(32); |
603 | + if (lookahead == 'o') ADVANCE(13); |
604 | + END_STATE(); |
605 | + case 30: |
606 | + if (lookahead == 't') ADVANCE(47); |
607 | + END_STATE(); |
608 | + case 31: |
609 | + if (lookahead == 't') ADVANCE(19); |
610 | + END_STATE(); |
611 | + case 32: |
612 | + if (lookahead == 'w') ADVANCE(48); |
613 | + END_STATE(); |
614 | + case 33: |
615 | + if (lookahead == 'x') ADVANCE(51); |
616 | + END_STATE(); |
617 | + case 34: |
618 | + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(5); |
619 | + END_STATE(); |
620 | + case 35: |
621 | + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(81); |
622 | + END_STATE(); |
623 | + case 36: |
624 | + if (('0' <= lookahead && lookahead <= '9') || |
625 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(115); |
626 | + END_STATE(); |
627 | + case 37: |
628 | + if (('0' <= lookahead && lookahead <= '9') || |
629 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(36); |
630 | + END_STATE(); |
631 | + case 38: |
632 | + if (('0' <= lookahead && lookahead <= '9') || |
633 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(37); |
634 | + END_STATE(); |
635 | + case 39: |
636 | + if (('0' <= lookahead && lookahead <= '9') || |
637 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(38); |
638 | + END_STATE(); |
639 | + case 40: |
640 | + if (('0' <= lookahead && lookahead <= '9') || |
641 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(39); |
642 | + END_STATE(); |
643 | + case 41: |
644 | + if (('0' <= lookahead && lookahead <= '9') || |
645 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(40); |
646 | + END_STATE(); |
647 | + case 42: |
648 | + if (eof) ADVANCE(44); |
649 | + if (lookahead == '\n') ADVANCE(45); |
650 | if (lookahead == '\r') ADVANCE(1); |
651 | + if (lookahead == '+') ADVANCE(34); |
652 | + if (lookahead == '-') ADVANCE(7); |
653 | if (lookahead == '.') ADVANCE(8); |
654 | if (lookahead == '@') ADVANCE(10); |
655 | + if (lookahead == 'f') ADVANCE(24); |
656 | + if (lookahead == 'm') ADVANCE(29); |
657 | if (('\t' <= lookahead && lookahead <= '\f') || |
658 | - lookahead == ' ') SKIP(29) |
659 | + lookahead == ' ') SKIP(42) |
660 | if (('0' <= lookahead && lookahead <= '9') || |
661 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(28); |
662 | + ('a' <= lookahead && lookahead <= 'e')) ADVANCE(41); |
663 | END_STATE(); |
664 | - case 30: |
665 | - if (eof) ADVANCE(31); |
666 | - if (lookahead == '+') ADVANCE(43); |
667 | - if (lookahead == '-') ADVANCE(45); |
668 | - if (lookahead == '@') ADVANCE(48); |
669 | - if (lookahead == 'd') ADVANCE(53); |
670 | - if (lookahead == 'i') ADVANCE(54); |
671 | + case 43: |
672 | + if (eof) ADVANCE(44); |
673 | + if (lookahead == '+') ADVANCE(59); |
674 | + if (lookahead == '-') ADVANCE(61); |
675 | + if (lookahead == '@') ADVANCE(64); |
676 | + if (lookahead == 'd') ADVANCE(67); |
677 | + if (lookahead == 'i') ADVANCE(75); |
678 | + if (lookahead == 'n') ADVANCE(68); |
679 | if (lookahead == '\t' || |
680 | lookahead == 11 || |
681 | lookahead == '\f' || |
682 | - lookahead == ' ') ADVANCE(56); |
683 | + lookahead == ' ') ADVANCE(79); |
684 | if (lookahead != 0 && |
685 | - (lookahead < '\n' || '\r' < lookahead)) ADVANCE(57); |
686 | + (lookahead < '\n' || '\r' < lookahead)) ADVANCE(80); |
687 | END_STATE(); |
688 | - case 31: |
689 | + case 44: |
690 | ACCEPT_TOKEN(ts_builtin_sym_end); |
691 | END_STATE(); |
692 | - case 32: |
693 | + case 45: |
694 | ACCEPT_TOKEN(aux_sym_source_token1); |
695 | END_STATE(); |
696 | - case 33: |
697 | + case 46: |
698 | ACCEPT_TOKEN(anon_sym_diff); |
699 | END_STATE(); |
700 | - case 34: |
701 | + case 47: |
702 | ACCEPT_TOKEN(anon_sym_DASH_DASHgit); |
703 | END_STATE(); |
704 | - case 35: |
705 | + case 48: |
706 | + ACCEPT_TOKEN(aux_sym_file_change_token1); |
707 | + END_STATE(); |
708 | + case 49: |
709 | + ACCEPT_TOKEN(anon_sym_file); |
710 | + END_STATE(); |
711 | + case 50: |
712 | + ACCEPT_TOKEN(anon_sym_mode); |
713 | + END_STATE(); |
714 | + case 51: |
715 | ACCEPT_TOKEN(anon_sym_index); |
716 | END_STATE(); |
717 | - case 36: |
718 | + case 52: |
719 | ACCEPT_TOKEN(anon_sym_DOT_DOT); |
720 | END_STATE(); |
721 | - case 37: |
722 | + case 53: |
723 | ACCEPT_TOKEN(aux_sym_file_token1); |
724 | END_STATE(); |
725 | - case 38: |
726 | + case 54: |
727 | ACCEPT_TOKEN(anon_sym_AT_AT); |
728 | END_STATE(); |
729 | - case 39: |
730 | + case 55: |
731 | ACCEPT_TOKEN(anon_sym_AT_AT2); |
732 | END_STATE(); |
733 | - case 40: |
734 | + case 56: |
735 | ACCEPT_TOKEN(aux_sym_location_token1); |
736 | if (lookahead == '\t' || |
737 | lookahead == 11 || |
738 | lookahead == '\f' || |
739 | - lookahead == ' ') ADVANCE(40); |
740 | + lookahead == ' ') ADVANCE(56); |
741 | if (lookahead != 0 && |
742 | - (lookahead < '\n' || '\r' < lookahead)) ADVANCE(41); |
743 | + (lookahead < '\n' || '\r' < lookahead)) ADVANCE(57); |
744 | END_STATE(); |
745 | - case 41: |
746 | + case 57: |
747 | ACCEPT_TOKEN(aux_sym_location_token1); |
748 | if (lookahead != 0 && |
749 | lookahead != '\n' && |
750 | - lookahead != '\r') ADVANCE(41); |
751 | + lookahead != '\r') ADVANCE(57); |
752 | END_STATE(); |
753 | - case 42: |
754 | + case 58: |
755 | ACCEPT_TOKEN(anon_sym_PLUS); |
756 | - if (lookahead == '+') ADVANCE(3); |
757 | + if (lookahead == '+') ADVANCE(4); |
758 | END_STATE(); |
759 | - case 43: |
760 | + case 59: |
761 | ACCEPT_TOKEN(anon_sym_PLUS); |
762 | - if (lookahead == '+') ADVANCE(46); |
763 | + if (lookahead == '+') ADVANCE(62); |
764 | END_STATE(); |
765 | - case 44: |
766 | + case 60: |
767 | ACCEPT_TOKEN(anon_sym_DASH); |
768 | if (lookahead == '-') ADVANCE(6); |
769 | END_STATE(); |
770 | - case 45: |
771 | + case 61: |
772 | ACCEPT_TOKEN(anon_sym_DASH); |
773 | - if (lookahead == '-') ADVANCE(47); |
774 | + if (lookahead == '-') ADVANCE(63); |
775 | END_STATE(); |
776 | - case 46: |
777 | + case 62: |
778 | ACCEPT_TOKEN(sym_context); |
779 | - if (lookahead == '+') ADVANCE(37); |
780 | + if (lookahead == '+') ADVANCE(53); |
781 | if (lookahead != 0 && |
782 | lookahead != '\n' && |
783 | - lookahead != '\r') ADVANCE(57); |
784 | + lookahead != '\r') ADVANCE(80); |
785 | END_STATE(); |
786 | - case 47: |
787 | + case 63: |
788 | ACCEPT_TOKEN(sym_context); |
789 | - if (lookahead == '-') ADVANCE(37); |
790 | + if (lookahead == '-') ADVANCE(53); |
791 | if (lookahead != 0 && |
792 | lookahead != '\n' && |
793 | - lookahead != '\r') ADVANCE(57); |
794 | + lookahead != '\r') ADVANCE(80); |
795 | END_STATE(); |
796 | - case 48: |
797 | + case 64: |
798 | ACCEPT_TOKEN(sym_context); |
799 | - if (lookahead == '@') ADVANCE(38); |
800 | + if (lookahead == '@') ADVANCE(54); |
801 | if (lookahead != 0 && |
802 | lookahead != '\n' && |
803 | - lookahead != '\r') ADVANCE(57); |
804 | + lookahead != '\r') ADVANCE(80); |
805 | END_STATE(); |
806 | - case 49: |
807 | + case 65: |
808 | ACCEPT_TOKEN(sym_context); |
809 | - if (lookahead == 'd') ADVANCE(50); |
810 | + if (lookahead == 'd') ADVANCE(48); |
811 | if (lookahead != 0 && |
812 | lookahead != '\n' && |
813 | - lookahead != '\r') ADVANCE(57); |
814 | + lookahead != '\r') ADVANCE(80); |
815 | END_STATE(); |
816 | - case 50: |
817 | + case 66: |
818 | ACCEPT_TOKEN(sym_context); |
819 | - if (lookahead == 'e') ADVANCE(55); |
820 | + if (lookahead == 'd') ADVANCE(70); |
821 | if (lookahead != 0 && |
822 | lookahead != '\n' && |
823 | - lookahead != '\r') ADVANCE(57); |
824 | + lookahead != '\r') ADVANCE(80); |
825 | END_STATE(); |
826 | - case 51: |
827 | + case 67: |
828 | ACCEPT_TOKEN(sym_context); |
829 | - if (lookahead == 'f') ADVANCE(33); |
830 | + if (lookahead == 'e') ADVANCE(74); |
831 | + if (lookahead == 'i') ADVANCE(73); |
832 | if (lookahead != 0 && |
833 | lookahead != '\n' && |
834 | - lookahead != '\r') ADVANCE(57); |
835 | + lookahead != '\r') ADVANCE(80); |
836 | END_STATE(); |
837 | - case 52: |
838 | + case 68: |
839 | ACCEPT_TOKEN(sym_context); |
840 | - if (lookahead == 'f') ADVANCE(51); |
841 | + if (lookahead == 'e') ADVANCE(77); |
842 | if (lookahead != 0 && |
843 | lookahead != '\n' && |
844 | - lookahead != '\r') ADVANCE(57); |
845 | + lookahead != '\r') ADVANCE(80); |
846 | END_STATE(); |
847 | - case 53: |
848 | + case 69: |
849 | ACCEPT_TOKEN(sym_context); |
850 | - if (lookahead == 'i') ADVANCE(52); |
851 | + if (lookahead == 'e') ADVANCE(76); |
852 | if (lookahead != 0 && |
853 | lookahead != '\n' && |
854 | - lookahead != '\r') ADVANCE(57); |
855 | + lookahead != '\r') ADVANCE(80); |
856 | END_STATE(); |
857 | - case 54: |
858 | + case 70: |
859 | ACCEPT_TOKEN(sym_context); |
860 | - if (lookahead == 'n') ADVANCE(49); |
861 | + if (lookahead == 'e') ADVANCE(78); |
862 | if (lookahead != 0 && |
863 | lookahead != '\n' && |
864 | - lookahead != '\r') ADVANCE(57); |
865 | + lookahead != '\r') ADVANCE(80); |
866 | END_STATE(); |
867 | - case 55: |
868 | + case 71: |
869 | ACCEPT_TOKEN(sym_context); |
870 | - if (lookahead == 'x') ADVANCE(35); |
871 | + if (lookahead == 'e') ADVANCE(65); |
872 | if (lookahead != 0 && |
873 | lookahead != '\n' && |
874 | - lookahead != '\r') ADVANCE(57); |
875 | + lookahead != '\r') ADVANCE(80); |
876 | END_STATE(); |
877 | - case 56: |
878 | + case 72: |
879 | + ACCEPT_TOKEN(sym_context); |
880 | + if (lookahead == 'f') ADVANCE(46); |
881 | + if (lookahead != 0 && |
882 | + lookahead != '\n' && |
883 | + lookahead != '\r') ADVANCE(80); |
884 | + END_STATE(); |
885 | + case 73: |
886 | + ACCEPT_TOKEN(sym_context); |
887 | + if (lookahead == 'f') ADVANCE(72); |
888 | + if (lookahead != 0 && |
889 | + lookahead != '\n' && |
890 | + lookahead != '\r') ADVANCE(80); |
891 | + END_STATE(); |
892 | + case 74: |
893 | + ACCEPT_TOKEN(sym_context); |
894 | + if (lookahead == 'l') ADVANCE(69); |
895 | + if (lookahead != 0 && |
896 | + lookahead != '\n' && |
897 | + lookahead != '\r') ADVANCE(80); |
898 | + END_STATE(); |
899 | + case 75: |
900 | + ACCEPT_TOKEN(sym_context); |
901 | + if (lookahead == 'n') ADVANCE(66); |
902 | + if (lookahead != 0 && |
903 | + lookahead != '\n' && |
904 | + lookahead != '\r') ADVANCE(80); |
905 | + END_STATE(); |
906 | + case 76: |
907 | + ACCEPT_TOKEN(sym_context); |
908 | + if (lookahead == 't') ADVANCE(71); |
909 | + if (lookahead != 0 && |
910 | + lookahead != '\n' && |
911 | + lookahead != '\r') ADVANCE(80); |
912 | + END_STATE(); |
913 | + case 77: |
914 | + ACCEPT_TOKEN(sym_context); |
915 | + if (lookahead == 'w') ADVANCE(48); |
916 | + if (lookahead != 0 && |
917 | + lookahead != '\n' && |
918 | + lookahead != '\r') ADVANCE(80); |
919 | + END_STATE(); |
920 | + case 78: |
921 | + ACCEPT_TOKEN(sym_context); |
922 | + if (lookahead == 'x') ADVANCE(51); |
923 | + if (lookahead != 0 && |
924 | + lookahead != '\n' && |
925 | + lookahead != '\r') ADVANCE(80); |
926 | + END_STATE(); |
927 | + case 79: |
928 | ACCEPT_TOKEN(sym_context); |
929 | if (lookahead == '\t' || |
930 | lookahead == 11 || |
931 | lookahead == '\f' || |
932 | - lookahead == ' ') ADVANCE(56); |
933 | + lookahead == ' ') ADVANCE(79); |
934 | if (lookahead != 0 && |
935 | - (lookahead < '\n' || '\r' < lookahead)) ADVANCE(57); |
936 | + (lookahead < '\n' || '\r' < lookahead)) ADVANCE(80); |
937 | END_STATE(); |
938 | - case 57: |
939 | + case 80: |
940 | ACCEPT_TOKEN(sym_context); |
941 | if (lookahead != 0 && |
942 | lookahead != '\n' && |
943 | - lookahead != '\r') ADVANCE(57); |
944 | + lookahead != '\r') ADVANCE(80); |
945 | END_STATE(); |
946 | - case 58: |
947 | + case 81: |
948 | ACCEPT_TOKEN(sym_linerange); |
949 | - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(58); |
950 | + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(81); |
951 | END_STATE(); |
952 | - case 59: |
953 | + case 82: |
954 | ACCEPT_TOKEN(sym_commit); |
955 | END_STATE(); |
956 | - case 60: |
957 | + case 83: |
958 | ACCEPT_TOKEN(sym_commit); |
959 | if (('0' <= lookahead && lookahead <= '9') || |
960 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(59); |
961 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(82); |
962 | END_STATE(); |
963 | - case 61: |
964 | + case 84: |
965 | ACCEPT_TOKEN(sym_commit); |
966 | if (('0' <= lookahead && lookahead <= '9') || |
967 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(60); |
968 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(83); |
969 | END_STATE(); |
970 | - case 62: |
971 | + case 85: |
972 | ACCEPT_TOKEN(sym_commit); |
973 | if (('0' <= lookahead && lookahead <= '9') || |
974 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(61); |
975 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(84); |
976 | END_STATE(); |
977 | - case 63: |
978 | + case 86: |
979 | ACCEPT_TOKEN(sym_commit); |
980 | if (('0' <= lookahead && lookahead <= '9') || |
981 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(62); |
982 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(85); |
983 | END_STATE(); |
984 | - case 64: |
985 | + case 87: |
986 | ACCEPT_TOKEN(sym_commit); |
987 | if (('0' <= lookahead && lookahead <= '9') || |
988 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(63); |
989 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(86); |
990 | END_STATE(); |
991 | - case 65: |
992 | + case 88: |
993 | ACCEPT_TOKEN(sym_commit); |
994 | if (('0' <= lookahead && lookahead <= '9') || |
995 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(64); |
996 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(87); |
997 | END_STATE(); |
998 | - case 66: |
999 | + case 89: |
1000 | ACCEPT_TOKEN(sym_commit); |
1001 | if (('0' <= lookahead && lookahead <= '9') || |
1002 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(65); |
1003 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(88); |
1004 | END_STATE(); |
1005 | - case 67: |
1006 | + case 90: |
1007 | ACCEPT_TOKEN(sym_commit); |
1008 | if (('0' <= lookahead && lookahead <= '9') || |
1009 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(66); |
1010 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(89); |
1011 | END_STATE(); |
1012 | - case 68: |
1013 | + case 91: |
1014 | ACCEPT_TOKEN(sym_commit); |
1015 | if (('0' <= lookahead && lookahead <= '9') || |
1016 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(67); |
1017 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(90); |
1018 | END_STATE(); |
1019 | - case 69: |
1020 | + case 92: |
1021 | ACCEPT_TOKEN(sym_commit); |
1022 | if (('0' <= lookahead && lookahead <= '9') || |
1023 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(68); |
1024 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(91); |
1025 | END_STATE(); |
1026 | - case 70: |
1027 | + case 93: |
1028 | ACCEPT_TOKEN(sym_commit); |
1029 | if (('0' <= lookahead && lookahead <= '9') || |
1030 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(69); |
1031 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(92); |
1032 | END_STATE(); |
1033 | - case 71: |
1034 | + case 94: |
1035 | ACCEPT_TOKEN(sym_commit); |
1036 | if (('0' <= lookahead && lookahead <= '9') || |
1037 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(70); |
1038 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(93); |
1039 | END_STATE(); |
1040 | - case 72: |
1041 | + case 95: |
1042 | ACCEPT_TOKEN(sym_commit); |
1043 | if (('0' <= lookahead && lookahead <= '9') || |
1044 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(71); |
1045 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(94); |
1046 | END_STATE(); |
1047 | - case 73: |
1048 | + case 96: |
1049 | ACCEPT_TOKEN(sym_commit); |
1050 | if (('0' <= lookahead && lookahead <= '9') || |
1051 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(72); |
1052 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(95); |
1053 | END_STATE(); |
1054 | - case 74: |
1055 | + case 97: |
1056 | ACCEPT_TOKEN(sym_commit); |
1057 | if (('0' <= lookahead && lookahead <= '9') || |
1058 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(73); |
1059 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(96); |
1060 | END_STATE(); |
1061 | - case 75: |
1062 | + case 98: |
1063 | ACCEPT_TOKEN(sym_commit); |
1064 | if (('0' <= lookahead && lookahead <= '9') || |
1065 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(74); |
1066 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(97); |
1067 | END_STATE(); |
1068 | - case 76: |
1069 | + case 99: |
1070 | ACCEPT_TOKEN(sym_commit); |
1071 | if (('0' <= lookahead && lookahead <= '9') || |
1072 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(75); |
1073 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(98); |
1074 | END_STATE(); |
1075 | - case 77: |
1076 | + case 100: |
1077 | ACCEPT_TOKEN(sym_commit); |
1078 | if (('0' <= lookahead && lookahead <= '9') || |
1079 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(76); |
1080 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(99); |
1081 | END_STATE(); |
1082 | - case 78: |
1083 | + case 101: |
1084 | ACCEPT_TOKEN(sym_commit); |
1085 | if (('0' <= lookahead && lookahead <= '9') || |
1086 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(77); |
1087 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(100); |
1088 | END_STATE(); |
1089 | - case 79: |
1090 | + case 102: |
1091 | ACCEPT_TOKEN(sym_commit); |
1092 | if (('0' <= lookahead && lookahead <= '9') || |
1093 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(78); |
1094 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(101); |
1095 | END_STATE(); |
1096 | - case 80: |
1097 | + case 103: |
1098 | ACCEPT_TOKEN(sym_commit); |
1099 | if (('0' <= lookahead && lookahead <= '9') || |
1100 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(79); |
1101 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(102); |
1102 | END_STATE(); |
1103 | - case 81: |
1104 | + case 104: |
1105 | ACCEPT_TOKEN(sym_commit); |
1106 | if (('0' <= lookahead && lookahead <= '9') || |
1107 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(80); |
1108 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(103); |
1109 | END_STATE(); |
1110 | - case 82: |
1111 | + case 105: |
1112 | ACCEPT_TOKEN(sym_commit); |
1113 | if (('0' <= lookahead && lookahead <= '9') || |
1114 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(81); |
1115 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(104); |
1116 | END_STATE(); |
1117 | - case 83: |
1118 | + case 106: |
1119 | ACCEPT_TOKEN(sym_commit); |
1120 | if (('0' <= lookahead && lookahead <= '9') || |
1121 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(82); |
1122 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(105); |
1123 | END_STATE(); |
1124 | - case 84: |
1125 | + case 107: |
1126 | ACCEPT_TOKEN(sym_commit); |
1127 | if (('0' <= lookahead && lookahead <= '9') || |
1128 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(83); |
1129 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(106); |
1130 | END_STATE(); |
1131 | - case 85: |
1132 | + case 108: |
1133 | ACCEPT_TOKEN(sym_commit); |
1134 | if (('0' <= lookahead && lookahead <= '9') || |
1135 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(84); |
1136 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(107); |
1137 | END_STATE(); |
1138 | - case 86: |
1139 | + case 109: |
1140 | ACCEPT_TOKEN(sym_commit); |
1141 | if (('0' <= lookahead && lookahead <= '9') || |
1142 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(85); |
1143 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(108); |
1144 | END_STATE(); |
1145 | - case 87: |
1146 | + case 110: |
1147 | ACCEPT_TOKEN(sym_commit); |
1148 | if (('0' <= lookahead && lookahead <= '9') || |
1149 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(86); |
1150 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(109); |
1151 | END_STATE(); |
1152 | - case 88: |
1153 | + case 111: |
1154 | ACCEPT_TOKEN(sym_commit); |
1155 | if (('0' <= lookahead && lookahead <= '9') || |
1156 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(87); |
1157 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(110); |
1158 | END_STATE(); |
1159 | - case 89: |
1160 | + case 112: |
1161 | ACCEPT_TOKEN(sym_commit); |
1162 | if (('0' <= lookahead && lookahead <= '9') || |
1163 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(88); |
1164 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(111); |
1165 | END_STATE(); |
1166 | - case 90: |
1167 | + case 113: |
1168 | ACCEPT_TOKEN(sym_commit); |
1169 | if (('0' <= lookahead && lookahead <= '9') || |
1170 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(89); |
1171 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(112); |
1172 | END_STATE(); |
1173 | - case 91: |
1174 | + case 114: |
1175 | ACCEPT_TOKEN(sym_commit); |
1176 | if (('0' <= lookahead && lookahead <= '9') || |
1177 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(90); |
1178 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(113); |
1179 | END_STATE(); |
1180 | - case 92: |
1181 | + case 115: |
1182 | ACCEPT_TOKEN(sym_commit); |
1183 | if (('0' <= lookahead && lookahead <= '9') || |
1184 | - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(91); |
1185 | + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(114); |
1186 | END_STATE(); |
1187 | - case 93: |
1188 | + case 116: |
1189 | ACCEPT_TOKEN(sym_mode); |
1190 | - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(93); |
1191 | + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(116); |
1192 | END_STATE(); |
1193 | default: |
1194 | return false; |
1195 | @@ -692,32 +832,36 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { |
1196 | |
1197 | static const TSLexMode ts_lex_modes[STATE_COUNT] = { |
1198 | [0] = {.lex_state = 0}, |
1199 | - [1] = {.lex_state = 30}, |
1200 | - [2] = {.lex_state = 30}, |
1201 | - [3] = {.lex_state = 30}, |
1202 | - [4] = {.lex_state = 30}, |
1203 | - [5] = {.lex_state = 2}, |
1204 | - [6] = {.lex_state = 2}, |
1205 | - [7] = {.lex_state = 2}, |
1206 | + [1] = {.lex_state = 43}, |
1207 | + [2] = {.lex_state = 43}, |
1208 | + [3] = {.lex_state = 43}, |
1209 | + [4] = {.lex_state = 43}, |
1210 | + [5] = {.lex_state = 3}, |
1211 | + [6] = {.lex_state = 3}, |
1212 | + [7] = {.lex_state = 3}, |
1213 | [8] = {.lex_state = 2}, |
1214 | - [9] = {.lex_state = 0}, |
1215 | + [9] = {.lex_state = 3}, |
1216 | [10] = {.lex_state = 0}, |
1217 | [11] = {.lex_state = 0}, |
1218 | [12] = {.lex_state = 0}, |
1219 | [13] = {.lex_state = 0}, |
1220 | [14] = {.lex_state = 0}, |
1221 | - [15] = {.lex_state = 4}, |
1222 | - [16] = {.lex_state = 4}, |
1223 | - [17] = {.lex_state = 0}, |
1224 | - [18] = {.lex_state = 4}, |
1225 | + [15] = {.lex_state = 0}, |
1226 | + [16] = {.lex_state = 0}, |
1227 | + [17] = {.lex_state = 2}, |
1228 | + [18] = {.lex_state = 0}, |
1229 | [19] = {.lex_state = 0}, |
1230 | - [20] = {.lex_state = 0}, |
1231 | + [20] = {.lex_state = 2}, |
1232 | [21] = {.lex_state = 0}, |
1233 | - [22] = {.lex_state = 4}, |
1234 | - [23] = {.lex_state = 4}, |
1235 | - [24] = {.lex_state = 2}, |
1236 | - [25] = {.lex_state = 0}, |
1237 | + [22] = {.lex_state = 0}, |
1238 | + [23] = {.lex_state = 2}, |
1239 | + [24] = {.lex_state = 0}, |
1240 | + [25] = {.lex_state = 2}, |
1241 | [26] = {.lex_state = 0}, |
1242 | + [27] = {.lex_state = 2}, |
1243 | + [28] = {.lex_state = 3}, |
1244 | + [29] = {.lex_state = 0}, |
1245 | + [30] = {.lex_state = 0}, |
1246 | }; |
1247 | |
1248 | static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { |
1249 | @@ -725,6 +869,10 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { |
1250 | [ts_builtin_sym_end] = ACTIONS(1), |
1251 | [aux_sym_source_token1] = ACTIONS(1), |
1252 | [anon_sym_diff] = ACTIONS(1), |
1253 | + [anon_sym_DASH_DASHgit] = ACTIONS(1), |
1254 | + [aux_sym_file_change_token1] = ACTIONS(1), |
1255 | + [anon_sym_file] = ACTIONS(1), |
1256 | + [anon_sym_mode] = ACTIONS(1), |
1257 | [anon_sym_index] = ACTIONS(1), |
1258 | [anon_sym_DOT_DOT] = ACTIONS(1), |
1259 | [aux_sym_file_token1] = ACTIONS(1), |
1260 | @@ -732,223 +880,256 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { |
1261 | [anon_sym_AT_AT2] = ACTIONS(1), |
1262 | [anon_sym_PLUS] = ACTIONS(1), |
1263 | [anon_sym_DASH] = ACTIONS(1), |
1264 | + [sym_linerange] = ACTIONS(1), |
1265 | [sym_commit] = ACTIONS(1), |
1266 | }, |
1267 | [1] = { |
1268 | - [sym_source] = STATE(10), |
1269 | - [sym__line] = STATE(11), |
1270 | - [sym_command] = STATE(11), |
1271 | - [sym_index] = STATE(11), |
1272 | - [sym_file] = STATE(11), |
1273 | - [sym_location] = STATE(11), |
1274 | - [sym_addition] = STATE(11), |
1275 | - [sym_deletion] = STATE(11), |
1276 | - [aux_sym_source_repeat1] = STATE(2), |
1277 | + [sym_source] = STATE(11), |
1278 | + [sym__line] = STATE(12), |
1279 | + [sym_command] = STATE(12), |
1280 | + [sym_file_change] = STATE(12), |
1281 | + [sym_index] = STATE(12), |
1282 | + [sym_file] = STATE(12), |
1283 | + [sym_location] = STATE(12), |
1284 | + [sym_addition] = STATE(12), |
1285 | + [sym_deletion] = STATE(12), |
1286 | + [aux_sym_source_repeat1] = STATE(3), |
1287 | [ts_builtin_sym_end] = ACTIONS(3), |
1288 | [anon_sym_diff] = ACTIONS(5), |
1289 | - [anon_sym_index] = ACTIONS(7), |
1290 | - [aux_sym_file_token1] = ACTIONS(9), |
1291 | - [anon_sym_AT_AT] = ACTIONS(11), |
1292 | - [anon_sym_PLUS] = ACTIONS(13), |
1293 | - [anon_sym_DASH] = ACTIONS(15), |
1294 | - [sym_context] = ACTIONS(17), |
1295 | + [aux_sym_file_change_token1] = ACTIONS(7), |
1296 | + [anon_sym_index] = ACTIONS(9), |
1297 | + [aux_sym_file_token1] = ACTIONS(11), |
1298 | + [anon_sym_AT_AT] = ACTIONS(13), |
1299 | + [anon_sym_PLUS] = ACTIONS(15), |
1300 | + [anon_sym_DASH] = ACTIONS(17), |
1301 | + [sym_context] = ACTIONS(19), |
1302 | }, |
1303 | [2] = { |
1304 | - [sym__line] = STATE(11), |
1305 | - [sym_command] = STATE(11), |
1306 | - [sym_index] = STATE(11), |
1307 | - [sym_file] = STATE(11), |
1308 | - [sym_location] = STATE(11), |
1309 | - [sym_addition] = STATE(11), |
1310 | - [sym_deletion] = STATE(11), |
1311 | - [aux_sym_source_repeat1] = STATE(3), |
1312 | - [ts_builtin_sym_end] = ACTIONS(19), |
1313 | - [anon_sym_diff] = ACTIONS(5), |
1314 | - [anon_sym_index] = ACTIONS(7), |
1315 | - [aux_sym_file_token1] = ACTIONS(9), |
1316 | - [anon_sym_AT_AT] = ACTIONS(11), |
1317 | - [anon_sym_PLUS] = ACTIONS(13), |
1318 | - [anon_sym_DASH] = ACTIONS(15), |
1319 | - [sym_context] = ACTIONS(17), |
1320 | - }, |
1321 | - [3] = { |
1322 | - [sym__line] = STATE(11), |
1323 | - [sym_command] = STATE(11), |
1324 | - [sym_index] = STATE(11), |
1325 | - [sym_file] = STATE(11), |
1326 | - [sym_location] = STATE(11), |
1327 | - [sym_addition] = STATE(11), |
1328 | - [sym_deletion] = STATE(11), |
1329 | - [aux_sym_source_repeat1] = STATE(3), |
1330 | + [sym__line] = STATE(12), |
1331 | + [sym_command] = STATE(12), |
1332 | + [sym_file_change] = STATE(12), |
1333 | + [sym_index] = STATE(12), |
1334 | + [sym_file] = STATE(12), |
1335 | + [sym_location] = STATE(12), |
1336 | + [sym_addition] = STATE(12), |
1337 | + [sym_deletion] = STATE(12), |
1338 | + [aux_sym_source_repeat1] = STATE(2), |
1339 | [ts_builtin_sym_end] = ACTIONS(21), |
1340 | [anon_sym_diff] = ACTIONS(23), |
1341 | - [anon_sym_index] = ACTIONS(26), |
1342 | - [aux_sym_file_token1] = ACTIONS(29), |
1343 | - [anon_sym_AT_AT] = ACTIONS(32), |
1344 | - [anon_sym_PLUS] = ACTIONS(35), |
1345 | - [anon_sym_DASH] = ACTIONS(38), |
1346 | - [sym_context] = ACTIONS(41), |
1347 | + [aux_sym_file_change_token1] = ACTIONS(26), |
1348 | + [anon_sym_index] = ACTIONS(29), |
1349 | + [aux_sym_file_token1] = ACTIONS(32), |
1350 | + [anon_sym_AT_AT] = ACTIONS(35), |
1351 | + [anon_sym_PLUS] = ACTIONS(38), |
1352 | + [anon_sym_DASH] = ACTIONS(41), |
1353 | + [sym_context] = ACTIONS(44), |
1354 | + }, |
1355 | + [3] = { |
1356 | + [sym__line] = STATE(12), |
1357 | + [sym_command] = STATE(12), |
1358 | + [sym_file_change] = STATE(12), |
1359 | + [sym_index] = STATE(12), |
1360 | + [sym_file] = STATE(12), |
1361 | + [sym_location] = STATE(12), |
1362 | + [sym_addition] = STATE(12), |
1363 | + [sym_deletion] = STATE(12), |
1364 | + [aux_sym_source_repeat1] = STATE(2), |
1365 | + [ts_builtin_sym_end] = ACTIONS(47), |
1366 | + [anon_sym_diff] = ACTIONS(5), |
1367 | + [aux_sym_file_change_token1] = ACTIONS(7), |
1368 | + [anon_sym_index] = ACTIONS(9), |
1369 | + [aux_sym_file_token1] = ACTIONS(11), |
1370 | + [anon_sym_AT_AT] = ACTIONS(13), |
1371 | + [anon_sym_PLUS] = ACTIONS(15), |
1372 | + [anon_sym_DASH] = ACTIONS(17), |
1373 | + [sym_context] = ACTIONS(19), |
1374 | }, |
1375 | }; |
1376 | |
1377 | static const uint16_t ts_small_parse_table[] = { |
1378 | [0] = 2, |
1379 | - ACTIONS(44), 3, |
1380 | + ACTIONS(49), 3, |
1381 | anon_sym_PLUS, |
1382 | anon_sym_DASH, |
1383 | sym_context, |
1384 | - ACTIONS(21), 5, |
1385 | + ACTIONS(21), 6, |
1386 | ts_builtin_sym_end, |
1387 | anon_sym_diff, |
1388 | + aux_sym_file_change_token1, |
1389 | anon_sym_index, |
1390 | aux_sym_file_token1, |
1391 | anon_sym_AT_AT, |
1392 | - [13] = 2, |
1393 | - ACTIONS(46), 1, |
1394 | + [14] = 2, |
1395 | + ACTIONS(51), 1, |
1396 | aux_sym_source_token1, |
1397 | - ACTIONS(48), 1, |
1398 | + ACTIONS(53), 1, |
1399 | aux_sym_location_token1, |
1400 | - [20] = 2, |
1401 | - ACTIONS(50), 1, |
1402 | + [21] = 2, |
1403 | + ACTIONS(55), 1, |
1404 | aux_sym_location_token1, |
1405 | - STATE(20), 1, |
1406 | + STATE(22), 1, |
1407 | sym_filename, |
1408 | - [27] = 2, |
1409 | - ACTIONS(50), 1, |
1410 | + [28] = 2, |
1411 | + ACTIONS(55), 1, |
1412 | aux_sym_location_token1, |
1413 | - STATE(14), 1, |
1414 | + STATE(16), 1, |
1415 | sym_filename, |
1416 | - [34] = 2, |
1417 | - ACTIONS(52), 1, |
1418 | + [35] = 2, |
1419 | + ACTIONS(57), 1, |
1420 | aux_sym_source_token1, |
1421 | - ACTIONS(54), 1, |
1422 | - aux_sym_location_token1, |
1423 | - [41] = 1, |
1424 | - ACTIONS(56), 1, |
1425 | + ACTIONS(59), 1, |
1426 | + sym_mode, |
1427 | + [42] = 2, |
1428 | + ACTIONS(61), 1, |
1429 | aux_sym_source_token1, |
1430 | - [45] = 1, |
1431 | - ACTIONS(58), 1, |
1432 | - ts_builtin_sym_end, |
1433 | + ACTIONS(63), 1, |
1434 | + aux_sym_location_token1, |
1435 | [49] = 1, |
1436 | - ACTIONS(60), 1, |
1437 | + ACTIONS(65), 1, |
1438 | aux_sym_source_token1, |
1439 | [53] = 1, |
1440 | - ACTIONS(62), 1, |
1441 | - anon_sym_DOT_DOT, |
1442 | + ACTIONS(67), 1, |
1443 | + ts_builtin_sym_end, |
1444 | [57] = 1, |
1445 | - ACTIONS(64), 1, |
1446 | + ACTIONS(69), 1, |
1447 | aux_sym_source_token1, |
1448 | [61] = 1, |
1449 | - ACTIONS(66), 1, |
1450 | - aux_sym_source_token1, |
1451 | + ACTIONS(71), 1, |
1452 | + anon_sym_mode, |
1453 | [65] = 1, |
1454 | - ACTIONS(68), 1, |
1455 | - sym_linerange, |
1456 | + ACTIONS(73), 1, |
1457 | + anon_sym_DOT_DOT, |
1458 | [69] = 1, |
1459 | - ACTIONS(70), 1, |
1460 | - sym_linerange, |
1461 | + ACTIONS(75), 1, |
1462 | + aux_sym_source_token1, |
1463 | [73] = 1, |
1464 | - ACTIONS(72), 1, |
1465 | + ACTIONS(77), 1, |
1466 | aux_sym_source_token1, |
1467 | [77] = 1, |
1468 | - ACTIONS(74), 1, |
1469 | - anon_sym_DASH_DASHgit, |
1470 | + ACTIONS(79), 1, |
1471 | + sym_linerange, |
1472 | [81] = 1, |
1473 | - ACTIONS(76), 1, |
1474 | + ACTIONS(81), 1, |
1475 | sym_commit, |
1476 | [85] = 1, |
1477 | - ACTIONS(78), 1, |
1478 | + ACTIONS(83), 1, |
1479 | aux_sym_source_token1, |
1480 | [89] = 1, |
1481 | - ACTIONS(80), 1, |
1482 | - sym_commit, |
1483 | + ACTIONS(85), 1, |
1484 | + anon_sym_DASH_DASHgit, |
1485 | [93] = 1, |
1486 | - ACTIONS(82), 1, |
1487 | - anon_sym_AT_AT2, |
1488 | + ACTIONS(87), 1, |
1489 | + anon_sym_file, |
1490 | [97] = 1, |
1491 | - ACTIONS(84), 1, |
1492 | - sym_mode, |
1493 | + ACTIONS(89), 1, |
1494 | + aux_sym_source_token1, |
1495 | [101] = 1, |
1496 | - ACTIONS(86), 1, |
1497 | - aux_sym_location_token1, |
1498 | + ACTIONS(91), 1, |
1499 | + sym_mode, |
1500 | [105] = 1, |
1501 | - ACTIONS(88), 1, |
1502 | - aux_sym_source_token1, |
1503 | + ACTIONS(93), 1, |
1504 | + sym_commit, |
1505 | [109] = 1, |
1506 | - ACTIONS(90), 1, |
1507 | + ACTIONS(95), 1, |
1508 | + anon_sym_AT_AT2, |
1509 | + [113] = 1, |
1510 | + ACTIONS(97), 1, |
1511 | + aux_sym_source_token1, |
1512 | + [117] = 1, |
1513 | + ACTIONS(99), 1, |
1514 | + sym_linerange, |
1515 | + [121] = 1, |
1516 | + ACTIONS(101), 1, |
1517 | + aux_sym_location_token1, |
1518 | + [125] = 1, |
1519 | + ACTIONS(103), 1, |
1520 | + aux_sym_source_token1, |
1521 | + [129] = 1, |
1522 | + ACTIONS(105), 1, |
1523 | aux_sym_source_token1, |
1524 | }; |
1525 | |
1526 | static const uint32_t ts_small_parse_table_map[] = { |
1527 | [SMALL_STATE(4)] = 0, |
1528 | - [SMALL_STATE(5)] = 13, |
1529 | - [SMALL_STATE(6)] = 20, |
1530 | - [SMALL_STATE(7)] = 27, |
1531 | - [SMALL_STATE(8)] = 34, |
1532 | - [SMALL_STATE(9)] = 41, |
1533 | - [SMALL_STATE(10)] = 45, |
1534 | - [SMALL_STATE(11)] = 49, |
1535 | - [SMALL_STATE(12)] = 53, |
1536 | - [SMALL_STATE(13)] = 57, |
1537 | - [SMALL_STATE(14)] = 61, |
1538 | - [SMALL_STATE(15)] = 65, |
1539 | - [SMALL_STATE(16)] = 69, |
1540 | - [SMALL_STATE(17)] = 73, |
1541 | - [SMALL_STATE(18)] = 77, |
1542 | - [SMALL_STATE(19)] = 81, |
1543 | - [SMALL_STATE(20)] = 85, |
1544 | - [SMALL_STATE(21)] = 89, |
1545 | - [SMALL_STATE(22)] = 93, |
1546 | - [SMALL_STATE(23)] = 97, |
1547 | - [SMALL_STATE(24)] = 101, |
1548 | - [SMALL_STATE(25)] = 105, |
1549 | - [SMALL_STATE(26)] = 109, |
1550 | + [SMALL_STATE(5)] = 14, |
1551 | + [SMALL_STATE(6)] = 21, |
1552 | + [SMALL_STATE(7)] = 28, |
1553 | + [SMALL_STATE(8)] = 35, |
1554 | + [SMALL_STATE(9)] = 42, |
1555 | + [SMALL_STATE(10)] = 49, |
1556 | + [SMALL_STATE(11)] = 53, |
1557 | + [SMALL_STATE(12)] = 57, |
1558 | + [SMALL_STATE(13)] = 61, |
1559 | + [SMALL_STATE(14)] = 65, |
1560 | + [SMALL_STATE(15)] = 69, |
1561 | + [SMALL_STATE(16)] = 73, |
1562 | + [SMALL_STATE(17)] = 77, |
1563 | + [SMALL_STATE(18)] = 81, |
1564 | + [SMALL_STATE(19)] = 85, |
1565 | + [SMALL_STATE(20)] = 89, |
1566 | + [SMALL_STATE(21)] = 93, |
1567 | + [SMALL_STATE(22)] = 97, |
1568 | + [SMALL_STATE(23)] = 101, |
1569 | + [SMALL_STATE(24)] = 105, |
1570 | + [SMALL_STATE(25)] = 109, |
1571 | + [SMALL_STATE(26)] = 113, |
1572 | + [SMALL_STATE(27)] = 117, |
1573 | + [SMALL_STATE(28)] = 121, |
1574 | + [SMALL_STATE(29)] = 125, |
1575 | + [SMALL_STATE(30)] = 129, |
1576 | }; |
1577 | |
1578 | static const TSParseActionEntry ts_parse_actions[] = { |
1579 | [0] = {.entry = {.count = 0, .reusable = false}}, |
1580 | [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), |
1581 | [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 0), |
1582 | - [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), |
1583 | - [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), |
1584 | - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), |
1585 | - [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), |
1586 | - [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), |
1587 | - [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), |
1588 | - [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), |
1589 | - [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1), |
1590 | + [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), |
1591 | + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), |
1592 | + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), |
1593 | + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), |
1594 | + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), |
1595 | + [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), |
1596 | + [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), |
1597 | + [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), |
1598 | [21] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), |
1599 | - [23] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(18), |
1600 | - [26] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(19), |
1601 | - [29] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(7), |
1602 | - [32] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(16), |
1603 | - [35] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(5), |
1604 | - [38] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(8), |
1605 | - [41] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(11), |
1606 | - [44] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), |
1607 | - [46] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_addition, 1), |
1608 | - [48] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), |
1609 | - [50] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), |
1610 | - [52] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_deletion, 1), |
1611 | - [54] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), |
1612 | - [56] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_addition, 2), |
1613 | - [58] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), |
1614 | - [60] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), |
1615 | - [62] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), |
1616 | - [64] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_filename, 1), |
1617 | - [66] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_file, 2), |
1618 | - [68] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), |
1619 | - [70] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), |
1620 | - [72] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_deletion, 2), |
1621 | - [74] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), |
1622 | - [76] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), |
1623 | - [78] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_command, 3), |
1624 | - [80] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), |
1625 | - [82] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), |
1626 | - [84] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), |
1627 | - [86] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), |
1628 | - [88] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_index, 5), |
1629 | - [90] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_location, 5), |
1630 | + [23] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(20), |
1631 | + [26] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(21), |
1632 | + [29] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(18), |
1633 | + [32] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(7), |
1634 | + [35] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(27), |
1635 | + [38] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(5), |
1636 | + [41] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(9), |
1637 | + [44] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(12), |
1638 | + [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1), |
1639 | + [49] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), |
1640 | + [51] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_addition, 1), |
1641 | + [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), |
1642 | + [55] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), |
1643 | + [57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_index, 4), |
1644 | + [59] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), |
1645 | + [61] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_deletion, 1), |
1646 | + [63] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), |
1647 | + [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_addition, 2), |
1648 | + [67] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), |
1649 | + [69] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), |
1650 | + [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), |
1651 | + [73] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), |
1652 | + [75] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_filename, 1), |
1653 | + [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_file, 2), |
1654 | + [79] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), |
1655 | + [81] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), |
1656 | + [83] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_deletion, 2), |
1657 | + [85] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), |
1658 | + [87] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), |
1659 | + [89] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_command, 3), |
1660 | + [91] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), |
1661 | + [93] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), |
1662 | + [95] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), |
1663 | + [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_file_change, 4), |
1664 | + [99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), |
1665 | + [101] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), |
1666 | + [103] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_index, 5), |
1667 | + [105] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_location, 5), |
1668 | }; |
1669 | |
1670 | #ifdef __cplusplus |
1671 | diff --git a/test/corpus/text.txt b/test/corpus/text.txt |
1672 | index 1f85731..d2ca863 100644 |
1673 | --- a/test/corpus/text.txt |
1674 | +++ b/test/corpus/text.txt |
1675 | @@ -41,3 +41,31 @@ index dc36969..f37fde0 100644 |
1676 | (addition) |
1677 | (context) |
1678 | (context)) |
1679 | + |
1680 | + ================================================================================ |
1681 | + New empty file |
1682 | + ================================================================================ |
1683 | + diff --git a/tmp.txt b/tmp.txt |
1684 | + new file mode 100644 |
1685 | + index 0000000..e69de29 |
1686 | + |
1687 | + -------------------------------------------------------------------------------- |
1688 | + |
1689 | + (source |
1690 | + (command (filename)) |
1691 | + (file_change (mode)) |
1692 | + (index (commit) (commit))) |
1693 | + |
1694 | + ================================================================================ |
1695 | + Deleted empty file |
1696 | + ================================================================================ |
1697 | + diff --git a/tmp.txt b/tmp.txt |
1698 | + deleted file mode 100644 |
1699 | + index e69de29..0000000 |
1700 | + |
1701 | + -------------------------------------------------------------------------------- |
1702 | + |
1703 | + (source |
1704 | + (command (filename)) |
1705 | + (file_change (mode)) |
1706 | + (index (commit) (commit))) |