Commit
Author: Michael Davis [mcarsondavis@gmail.com]
Hash: fe0c56a6d737d15a5bb23917a8b628105ec87cef
Timestamp: Fri, 24 Dec 2021 01:04:12 +0000 (2 years ago)

+978 -519 +/-5 browse
parse file renames
1diff --git a/grammar.js b/grammar.js
2index f5e0ada..f11c850 100644
3--- a/grammar.js
4+++ b/grammar.js
5 @@ -6,6 +6,7 @@ const PREC = {
6 COMMAND: 50,
7 FILE_CHANGE: 47,
8 INDEX: 45,
9+ SIMILARITY: 43,
10 FILE: 40,
11 LOCATION: 35,
12 ADDITION: 30,
13 @@ -14,9 +15,10 @@ const PREC = {
14
15 const COMMAND_PRELUDE = token.immediate(prec(PREC.COMMAND, "diff"));
16 const FILE_CHANGE_PRELUDE = token.immediate(
17- prec(PREC.FILE_CHANGE, field("kind", choice("new", "deleted")))
18+ prec(PREC.FILE_CHANGE, field("kind", choice("new", "deleted", "rename")))
19 );
20 const INDEX_PRELUDE = token.immediate(prec(PREC.INDEX, "index"));
21+ const SIMILARITY_PRELUDE = token.immediate(prec(PREC.SIMILARITY, "similarity"));
22 const FILE_PRELUDE = token.immediate(
23 prec(PREC.FILE, field("kind", choice("---", "+++")))
24 );
25 @@ -37,6 +39,7 @@ module.exports = grammar({
26 $.command,
27 $.file_change,
28 $.index,
29+ $.similarity,
30 $.file,
31 $.location,
32 $.addition,
33 @@ -46,11 +49,17 @@ module.exports = grammar({
34
35 command: ($) => seq(COMMAND_PRELUDE, "--git", $.filename),
36
37- file_change: ($) => seq(FILE_CHANGE_PRELUDE, "file", "mode", $.mode),
38+ file_change: ($) =>
39+ choice(
40+ seq(FILE_CHANGE_PRELUDE, "file", "mode", $.mode),
41+ seq(FILE_CHANGE_PRELUDE, choice("from", "to"), $.filename)
42+ ),
43
44 index: ($) =>
45 seq(INDEX_PRELUDE, $.commit, "..", $.commit, optional($.mode)),
46
47+ similarity: ($) => seq(SIMILARITY_PRELUDE, "index", field("score", /\d+%/)),
48+
49 file: ($) => seq(FILE_PRELUDE, $.filename),
50
51 location: ($) =>
52 diff --git a/src/grammar.json b/src/grammar.json
53index 4a7f049..bb74c57 100644
54--- a/src/grammar.json
55+++ b/src/grammar.json
56 @@ -34,6 +34,10 @@
57 },
58 {
59 "type": "SYMBOL",
60+ "name": "similarity"
61+ },
62+ {
63+ "type": "SYMBOL",
64 "name": "file"
65 },
66 {
67 @@ -79,43 +83,102 @@
68 ]
69 },
70 "file_change": {
71- "type": "SEQ",
72+ "type": "CHOICE",
73 "members": [
74 {
75- "type": "IMMEDIATE_TOKEN",
76- "content": {
77- "type": "PREC",
78- "value": 47,
79- "content": {
80- "type": "FIELD",
81- "name": "kind",
82+ "type": "SEQ",
83+ "members": [
84+ {
85+ "type": "IMMEDIATE_TOKEN",
86 "content": {
87- "type": "CHOICE",
88- "members": [
89- {
90- "type": "STRING",
91- "value": "new"
92- },
93- {
94- "type": "STRING",
95- "value": "deleted"
96+ "type": "PREC",
97+ "value": 47,
98+ "content": {
99+ "type": "FIELD",
100+ "name": "kind",
101+ "content": {
102+ "type": "CHOICE",
103+ "members": [
104+ {
105+ "type": "STRING",
106+ "value": "new"
107+ },
108+ {
109+ "type": "STRING",
110+ "value": "deleted"
111+ },
112+ {
113+ "type": "STRING",
114+ "value": "rename"
115+ }
116+ ]
117 }
118- ]
119+ }
120 }
121+ },
122+ {
123+ "type": "STRING",
124+ "value": "file"
125+ },
126+ {
127+ "type": "STRING",
128+ "value": "mode"
129+ },
130+ {
131+ "type": "SYMBOL",
132+ "name": "mode"
133 }
134- }
135- },
136- {
137- "type": "STRING",
138- "value": "file"
139- },
140- {
141- "type": "STRING",
142- "value": "mode"
143+ ]
144 },
145 {
146- "type": "SYMBOL",
147- "name": "mode"
148+ "type": "SEQ",
149+ "members": [
150+ {
151+ "type": "IMMEDIATE_TOKEN",
152+ "content": {
153+ "type": "PREC",
154+ "value": 47,
155+ "content": {
156+ "type": "FIELD",
157+ "name": "kind",
158+ "content": {
159+ "type": "CHOICE",
160+ "members": [
161+ {
162+ "type": "STRING",
163+ "value": "new"
164+ },
165+ {
166+ "type": "STRING",
167+ "value": "deleted"
168+ },
169+ {
170+ "type": "STRING",
171+ "value": "rename"
172+ }
173+ ]
174+ }
175+ }
176+ }
177+ },
178+ {
179+ "type": "CHOICE",
180+ "members": [
181+ {
182+ "type": "STRING",
183+ "value": "from"
184+ },
185+ {
186+ "type": "STRING",
187+ "value": "to"
188+ }
189+ ]
190+ },
191+ {
192+ "type": "SYMBOL",
193+ "name": "filename"
194+ }
195+ ]
196 }
197 ]
198 },
199 @@ -159,6 +222,34 @@
200 }
201 ]
202 },
203+ "similarity": {
204+ "type": "SEQ",
205+ "members": [
206+ {
207+ "type": "IMMEDIATE_TOKEN",
208+ "content": {
209+ "type": "PREC",
210+ "value": 43,
211+ "content": {
212+ "type": "STRING",
213+ "value": "similarity"
214+ }
215+ }
216+ },
217+ {
218+ "type": "STRING",
219+ "value": "index"
220+ },
221+ {
222+ "type": "FIELD",
223+ "name": "score",
224+ "content": {
225+ "type": "PATTERN",
226+ "value": "\\d+%"
227+ }
228+ }
229+ ]
230+ },
231 "file": {
232 "type": "SEQ",
233 "members": [
234 diff --git a/src/node-types.json b/src/node-types.json
235index 0d08ca2..c14ca0f 100644
236--- a/src/node-types.json
237+++ b/src/node-types.json
238 @@ -48,6 +48,10 @@
239 "required": true,
240 "types": [
241 {
242+ "type": "filename",
243+ "named": true
244+ },
245+ {
246 "type": "mode",
247 "named": true
248 }
249 @@ -94,6 +98,11 @@
250 }
251 },
252 {
253+ "type": "similarity",
254+ "named": true,
255+ "fields": {}
256+ },
257+ {
258 "type": "source",
259 "named": true,
260 "fields": {},
261 @@ -132,6 +141,10 @@
262 {
263 "type": "location",
264 "named": true
265+ },
266+ {
267+ "type": "similarity",
268+ "named": true
269 }
270 ]
271 }
272 @@ -173,6 +186,10 @@
273 "named": false
274 },
275 {
276+ "type": "from",
277+ "named": false
278+ },
279+ {
280 "type": "index",
281 "named": false
282 },
283 @@ -182,10 +199,18 @@
284 },
285 {
286 "type": "mode",
287- "named": true
288+ "named": false
289 },
290 {
291 "type": "mode",
292+ "named": true
293+ },
294+ {
295+ "type": "similarity",
296+ "named": false
297+ },
298+ {
299+ "type": "to",
300 "named": false
301 }
302 ]
303\ No newline at end of file
304 diff --git a/src/parser.c b/src/parser.c
305index a5d7b93..8734703 100644
306--- a/src/parser.c
307+++ b/src/parser.c
308 @@ -6,15 +6,15 @@
309 #endif
310
311 #define LANGUAGE_VERSION 13
312- #define STATE_COUNT 31
313+ #define STATE_COUNT 36
314 #define LARGE_STATE_COUNT 4
315- #define SYMBOL_COUNT 30
316+ #define SYMBOL_COUNT 36
317 #define ALIAS_COUNT 0
318- #define TOKEN_COUNT 19
319+ #define TOKEN_COUNT 24
320 #define EXTERNAL_TOKEN_COUNT 0
321- #define FIELD_COUNT 0
322+ #define FIELD_COUNT 1
323 #define MAX_ALIAS_SEQUENCE_LENGTH 5
324- #define PRODUCTION_ID_COUNT 1
325+ #define PRODUCTION_ID_COUNT 2
326
327 enum {
328 aux_sym_source_token1 = 1,
329 @@ -23,29 +23,35 @@ enum {
330 aux_sym_file_change_token1 = 4,
331 anon_sym_file = 5,
332 anon_sym_mode = 6,
333- anon_sym_index = 7,
334- anon_sym_DOT_DOT = 8,
335- aux_sym_file_token1 = 9,
336- anon_sym_AT_AT = 10,
337- anon_sym_AT_AT2 = 11,
338- aux_sym_location_token1 = 12,
339- anon_sym_PLUS = 13,
340- anon_sym_DASH = 14,
341- sym_context = 15,
342- sym_linerange = 16,
343- sym_commit = 17,
344- sym_mode = 18,
345- sym_source = 19,
346- sym__line = 20,
347- sym_command = 21,
348- sym_file_change = 22,
349- sym_index = 23,
350- sym_file = 24,
351- sym_location = 25,
352- sym_addition = 26,
353- sym_deletion = 27,
354- sym_filename = 28,
355- aux_sym_source_repeat1 = 29,
356+ anon_sym_from = 7,
357+ anon_sym_to = 8,
358+ anon_sym_index = 9,
359+ anon_sym_DOT_DOT = 10,
360+ anon_sym_similarity = 11,
361+ anon_sym_index2 = 12,
362+ aux_sym_similarity_token1 = 13,
363+ aux_sym_file_token1 = 14,
364+ anon_sym_AT_AT = 15,
365+ anon_sym_AT_AT2 = 16,
366+ aux_sym_location_token1 = 17,
367+ anon_sym_PLUS = 18,
368+ anon_sym_DASH = 19,
369+ sym_context = 20,
370+ sym_linerange = 21,
371+ sym_commit = 22,
372+ sym_mode = 23,
373+ sym_source = 24,
374+ sym__line = 25,
375+ sym_command = 26,
376+ sym_file_change = 27,
377+ sym_index = 28,
378+ sym_similarity = 29,
379+ sym_file = 30,
380+ sym_location = 31,
381+ sym_addition = 32,
382+ sym_deletion = 33,
383+ sym_filename = 34,
384+ aux_sym_source_repeat1 = 35,
385 };
386
387 static const char * const ts_symbol_names[] = {
388 @@ -56,8 +62,13 @@ static const char * const ts_symbol_names[] = {
389 [aux_sym_file_change_token1] = "file_change_token1",
390 [anon_sym_file] = "file",
391 [anon_sym_mode] = "mode",
392+ [anon_sym_from] = "from",
393+ [anon_sym_to] = "to",
394 [anon_sym_index] = "index",
395 [anon_sym_DOT_DOT] = "..",
396+ [anon_sym_similarity] = "similarity",
397+ [anon_sym_index2] = "index",
398+ [aux_sym_similarity_token1] = "similarity_token1",
399 [aux_sym_file_token1] = "file_token1",
400 [anon_sym_AT_AT] = "@@",
401 [anon_sym_AT_AT2] = "@@",
402 @@ -73,6 +84,7 @@ static const char * const ts_symbol_names[] = {
403 [sym_command] = "command",
404 [sym_file_change] = "file_change",
405 [sym_index] = "index",
406+ [sym_similarity] = "similarity",
407 [sym_file] = "file",
408 [sym_location] = "location",
409 [sym_addition] = "addition",
410 @@ -89,8 +101,13 @@ static const TSSymbol ts_symbol_map[] = {
411 [aux_sym_file_change_token1] = aux_sym_file_change_token1,
412 [anon_sym_file] = anon_sym_file,
413 [anon_sym_mode] = anon_sym_mode,
414+ [anon_sym_from] = anon_sym_from,
415+ [anon_sym_to] = anon_sym_to,
416 [anon_sym_index] = anon_sym_index,
417 [anon_sym_DOT_DOT] = anon_sym_DOT_DOT,
418+ [anon_sym_similarity] = anon_sym_similarity,
419+ [anon_sym_index2] = anon_sym_index,
420+ [aux_sym_similarity_token1] = aux_sym_similarity_token1,
421 [aux_sym_file_token1] = aux_sym_file_token1,
422 [anon_sym_AT_AT] = anon_sym_AT_AT,
423 [anon_sym_AT_AT2] = anon_sym_AT_AT,
424 @@ -106,6 +123,7 @@ static const TSSymbol ts_symbol_map[] = {
425 [sym_command] = sym_command,
426 [sym_file_change] = sym_file_change,
427 [sym_index] = sym_index,
428+ [sym_similarity] = sym_similarity,
429 [sym_file] = sym_file,
430 [sym_location] = sym_location,
431 [sym_addition] = sym_addition,
432 @@ -143,6 +161,14 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
433 .visible = true,
434 .named = false,
435 },
436+ [anon_sym_from] = {
437+ .visible = true,
438+ .named = false,
439+ },
440+ [anon_sym_to] = {
441+ .visible = true,
442+ .named = false,
443+ },
444 [anon_sym_index] = {
445 .visible = true,
446 .named = false,
447 @@ -151,6 +177,18 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
448 .visible = true,
449 .named = false,
450 },
451+ [anon_sym_similarity] = {
452+ .visible = true,
453+ .named = false,
454+ },
455+ [anon_sym_index2] = {
456+ .visible = true,
457+ .named = false,
458+ },
459+ [aux_sym_similarity_token1] = {
460+ .visible = false,
461+ .named = false,
462+ },
463 [aux_sym_file_token1] = {
464 .visible = false,
465 .named = false,
466 @@ -211,6 +249,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
467 .visible = true,
468 .named = true,
469 },
470+ [sym_similarity] = {
471+ .visible = true,
472+ .named = true,
473+ },
474 [sym_file] = {
475 .visible = true,
476 .named = true,
477 @@ -237,6 +279,24 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
478 },
479 };
480
481+ enum {
482+ field_score = 1,
483+ };
484+
485+ static const char * const ts_field_names[] = {
486+ [0] = NULL,
487+ [field_score] = "score",
488+ };
489+
490+ static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = {
491+ [1] = {.index = 0, .length = 1},
492+ };
493+
494+ static const TSFieldMapEntry ts_field_map_entries[] = {
495+ [0] =
496+ {field_score, 2},
497+ };
498+
499 static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = {
500 [0] = {0},
501 };
502 @@ -250,580 +310,776 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
503 eof = lexer->eof(lexer);
504 switch (state) {
505 case 0:
506- if (eof) ADVANCE(44);
507- if (lookahead == '\n') ADVANCE(45);
508+ if (eof) ADVANCE(67);
509+ if (lookahead == '\n') ADVANCE(68);
510 if (lookahead == '\r') ADVANCE(1);
511- if (lookahead == '+') ADVANCE(58);
512- if (lookahead == '-') ADVANCE(60);
513- if (lookahead == '.') ADVANCE(8);
514- if (lookahead == '@') ADVANCE(9);
515- if (lookahead == 'd') ADVANCE(14);
516- if (lookahead == 'f') ADVANCE(24);
517- if (lookahead == 'i') ADVANCE(28);
518- if (lookahead == 'm') ADVANCE(29);
519- if (lookahead == 'n') ADVANCE(15);
520+ if (lookahead == '+') ADVANCE(86);
521+ if (lookahead == '-') ADVANCE(88);
522+ if (lookahead == '.') ADVANCE(9);
523+ if (lookahead == '@') ADVANCE(10);
524+ if (lookahead == 'd') ADVANCE(18);
525+ if (lookahead == 'f') ADVANCE(31);
526+ if (lookahead == 'i') ADVANCE(42);
527+ if (lookahead == 'm') ADVANCE(47);
528+ if (lookahead == 'n') ADVANCE(19);
529+ if (lookahead == 'r') ADVANCE(24);
530+ if (lookahead == 's') ADVANCE(32);
531+ if (lookahead == 't') ADVANCE(45);
532 if (('\t' <= lookahead && lookahead <= '\f') ||
533- lookahead == ' ') SKIP(42)
534+ lookahead == ' ') SKIP(65)
535 if (('0' <= lookahead && lookahead <= '9') ||
536- ('a' <= lookahead && lookahead <= 'e')) ADVANCE(41);
537+ ('a' <= lookahead && lookahead <= 'e')) ADVANCE(64);
538 END_STATE();
539 case 1:
540- if (lookahead == '\n') ADVANCE(45);
541+ if (lookahead == '\n') ADVANCE(68);
542 END_STATE();
543 case 2:
544- if (lookahead == '\n') ADVANCE(45);
545+ if (lookahead == '\n') ADVANCE(68);
546 if (lookahead == '\r') ADVANCE(1);
547- if (lookahead == '+') ADVANCE(34);
548- if (lookahead == '-') ADVANCE(7);
549- if (lookahead == '@') ADVANCE(10);
550+ if (lookahead == '+') ADVANCE(57);
551+ if (lookahead == '-') ADVANCE(8);
552+ if (lookahead == '@') ADVANCE(11);
553+ if (lookahead == 'i') ADVANCE(44);
554 if (('\t' <= lookahead && lookahead <= '\f') ||
555 lookahead == ' ') SKIP(2)
556- if (('0' <= lookahead && lookahead <= '9')) ADVANCE(116);
557+ if (('0' <= lookahead && lookahead <= '9')) ADVANCE(158);
558 END_STATE();
559 case 3:
560- if (lookahead == '\n') ADVANCE(45);
561+ if (lookahead == '\n') ADVANCE(68);
562 if (lookahead == '\r') ADVANCE(1);
563 if (('\t' <= lookahead && lookahead <= '\f') ||
564- lookahead == ' ') ADVANCE(56);
565- if (lookahead != 0) ADVANCE(57);
566+ lookahead == ' ') ADVANCE(84);
567+ if (lookahead != 0) ADVANCE(85);
568 END_STATE();
569 case 4:
570- if (lookahead == '+') ADVANCE(53);
571+ if (lookahead == '%') ADVANCE(80);
572+ if (('0' <= lookahead && lookahead <= '9')) ADVANCE(4);
573 END_STATE();
574 case 5:
575- if (lookahead == ',') ADVANCE(35);
576- if (('0' <= lookahead && lookahead <= '9')) ADVANCE(5);
577+ if (lookahead == '+') ADVANCE(81);
578 END_STATE();
579 case 6:
580- if (lookahead == '-') ADVANCE(53);
581- if (lookahead == 'g') ADVANCE(25);
582+ if (lookahead == ',') ADVANCE(58);
583+ if (('0' <= lookahead && lookahead <= '9')) ADVANCE(6);
584 END_STATE();
585 case 7:
586- if (lookahead == '-') ADVANCE(23);
587- if (('0' <= lookahead && lookahead <= '9')) ADVANCE(5);
588+ if (lookahead == '-') ADVANCE(81);
589+ if (lookahead == 'g') ADVANCE(33);
590 END_STATE();
591 case 8:
592- if (lookahead == '.') ADVANCE(52);
593+ if (lookahead == '-') ADVANCE(30);
594+ if (('0' <= lookahead && lookahead <= '9')) ADVANCE(6);
595 END_STATE();
596 case 9:
597- if (lookahead == '@') ADVANCE(54);
598+ if (lookahead == '.') ADVANCE(77);
599 END_STATE();
600 case 10:
601- if (lookahead == '@') ADVANCE(55);
602+ if (lookahead == '@') ADVANCE(82);
603 END_STATE();
604 case 11:
605- if (lookahead == 'd') ADVANCE(48);
606+ if (lookahead == '@') ADVANCE(83);
607 END_STATE();
608 case 12:
609- if (lookahead == 'd') ADVANCE(17);
610+ if (lookahead == 'a') ADVANCE(48);
611 END_STATE();
612 case 13:
613- if (lookahead == 'd') ADVANCE(18);
614+ if (lookahead == 'a') ADVANCE(41);
615 END_STATE();
616 case 14:
617- if (lookahead == 'e') ADVANCE(26);
618- if (lookahead == 'i') ADVANCE(22);
619- if (('0' <= lookahead && lookahead <= '9') ||
620- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(40);
621+ if (lookahead == 'd') ADVANCE(71);
622 END_STATE();
623 case 15:
624- if (lookahead == 'e') ADVANCE(32);
625+ if (lookahead == 'd') ADVANCE(22);
626 END_STATE();
627 case 16:
628- if (lookahead == 'e') ADVANCE(49);
629+ if (lookahead == 'd') ADVANCE(23);
630 END_STATE();
631 case 17:
632- if (lookahead == 'e') ADVANCE(33);
633+ if (lookahead == 'd') ADVANCE(27);
634 END_STATE();
635 case 18:
636- if (lookahead == 'e') ADVANCE(50);
637+ if (lookahead == 'e') ADVANCE(37);
638+ if (lookahead == 'i') ADVANCE(29);
639+ if (('0' <= lookahead && lookahead <= '9') ||
640+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(63);
641 END_STATE();
642 case 19:
643- if (lookahead == 'e') ADVANCE(11);
644+ if (lookahead == 'e') ADVANCE(52);
645 END_STATE();
646 case 20:
647- if (lookahead == 'e') ADVANCE(31);
648+ if (lookahead == 'e') ADVANCE(71);
649 END_STATE();
650 case 21:
651- if (lookahead == 'f') ADVANCE(46);
652+ if (lookahead == 'e') ADVANCE(72);
653 END_STATE();
654 case 22:
655- if (lookahead == 'f') ADVANCE(21);
656+ if (lookahead == 'e') ADVANCE(53);
657 END_STATE();
658 case 23:
659- if (lookahead == 'g') ADVANCE(25);
660+ if (lookahead == 'e') ADVANCE(73);
661 END_STATE();
662 case 24:
663- if (lookahead == 'i') ADVANCE(27);
664- if (('0' <= lookahead && lookahead <= '9') ||
665- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(40);
666+ if (lookahead == 'e') ADVANCE(43);
667 END_STATE();
668 case 25:
669- if (lookahead == 'i') ADVANCE(30);
670+ if (lookahead == 'e') ADVANCE(14);
671 END_STATE();
672 case 26:
673- if (lookahead == 'l') ADVANCE(20);
674- if (('0' <= lookahead && lookahead <= '9') ||
675- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(39);
676+ if (lookahead == 'e') ADVANCE(51);
677 END_STATE();
678 case 27:
679- if (lookahead == 'l') ADVANCE(16);
680+ if (lookahead == 'e') ADVANCE(54);
681 END_STATE();
682 case 28:
683- if (lookahead == 'n') ADVANCE(12);
684+ if (lookahead == 'f') ADVANCE(69);
685 END_STATE();
686 case 29:
687- if (lookahead == 'o') ADVANCE(13);
688+ if (lookahead == 'f') ADVANCE(28);
689 END_STATE();
690 case 30:
691- if (lookahead == 't') ADVANCE(47);
692+ if (lookahead == 'g') ADVANCE(33);
693 END_STATE();
694 case 31:
695- if (lookahead == 't') ADVANCE(19);
696+ if (lookahead == 'i') ADVANCE(38);
697+ if (lookahead == 'r') ADVANCE(46);
698+ if (('0' <= lookahead && lookahead <= '9') ||
699+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(63);
700 END_STATE();
701 case 32:
702- if (lookahead == 'w') ADVANCE(48);
703+ if (lookahead == 'i') ADVANCE(40);
704 END_STATE();
705 case 33:
706- if (lookahead == 'x') ADVANCE(51);
707+ if (lookahead == 'i') ADVANCE(49);
708 END_STATE();
709 case 34:
710- if (('0' <= lookahead && lookahead <= '9')) ADVANCE(5);
711+ if (lookahead == 'i') ADVANCE(36);
712 END_STATE();
713 case 35:
714- if (('0' <= lookahead && lookahead <= '9')) ADVANCE(81);
715+ if (lookahead == 'i') ADVANCE(50);
716 END_STATE();
717 case 36:
718- if (('0' <= lookahead && lookahead <= '9') ||
719- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(115);
720+ if (lookahead == 'l') ADVANCE(12);
721 END_STATE();
722 case 37:
723+ if (lookahead == 'l') ADVANCE(26);
724 if (('0' <= lookahead && lookahead <= '9') ||
725- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(36);
726+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(62);
727 END_STATE();
728 case 38:
729- if (('0' <= lookahead && lookahead <= '9') ||
730- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(37);
731+ if (lookahead == 'l') ADVANCE(21);
732 END_STATE();
733 case 39:
734- if (('0' <= lookahead && lookahead <= '9') ||
735- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(38);
736+ if (lookahead == 'm') ADVANCE(74);
737 END_STATE();
738 case 40:
739- if (('0' <= lookahead && lookahead <= '9') ||
740- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(39);
741+ if (lookahead == 'm') ADVANCE(34);
742 END_STATE();
743 case 41:
744- if (('0' <= lookahead && lookahead <= '9') ||
745- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(40);
746+ if (lookahead == 'm') ADVANCE(20);
747 END_STATE();
748 case 42:
749- if (eof) ADVANCE(44);
750- if (lookahead == '\n') ADVANCE(45);
751+ if (lookahead == 'n') ADVANCE(15);
752+ END_STATE();
753+ case 43:
754+ if (lookahead == 'n') ADVANCE(13);
755+ END_STATE();
756+ case 44:
757+ if (lookahead == 'n') ADVANCE(17);
758+ END_STATE();
759+ case 45:
760+ if (lookahead == 'o') ADVANCE(75);
761+ END_STATE();
762+ case 46:
763+ if (lookahead == 'o') ADVANCE(39);
764+ END_STATE();
765+ case 47:
766+ if (lookahead == 'o') ADVANCE(16);
767+ END_STATE();
768+ case 48:
769+ if (lookahead == 'r') ADVANCE(35);
770+ END_STATE();
771+ case 49:
772+ if (lookahead == 't') ADVANCE(70);
773+ END_STATE();
774+ case 50:
775+ if (lookahead == 't') ADVANCE(55);
776+ END_STATE();
777+ case 51:
778+ if (lookahead == 't') ADVANCE(25);
779+ END_STATE();
780+ case 52:
781+ if (lookahead == 'w') ADVANCE(71);
782+ END_STATE();
783+ case 53:
784+ if (lookahead == 'x') ADVANCE(76);
785+ END_STATE();
786+ case 54:
787+ if (lookahead == 'x') ADVANCE(79);
788+ END_STATE();
789+ case 55:
790+ if (lookahead == 'y') ADVANCE(78);
791+ END_STATE();
792+ case 56:
793+ if (lookahead == '\t' ||
794+ lookahead == 11 ||
795+ lookahead == '\f' ||
796+ lookahead == ' ') SKIP(56)
797+ if (('0' <= lookahead && lookahead <= '9')) ADVANCE(4);
798+ END_STATE();
799+ case 57:
800+ if (('0' <= lookahead && lookahead <= '9')) ADVANCE(6);
801+ END_STATE();
802+ case 58:
803+ if (('0' <= lookahead && lookahead <= '9')) ADVANCE(123);
804+ END_STATE();
805+ case 59:
806+ if (('0' <= lookahead && lookahead <= '9') ||
807+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(157);
808+ END_STATE();
809+ case 60:
810+ if (('0' <= lookahead && lookahead <= '9') ||
811+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(59);
812+ END_STATE();
813+ case 61:
814+ if (('0' <= lookahead && lookahead <= '9') ||
815+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(60);
816+ END_STATE();
817+ case 62:
818+ if (('0' <= lookahead && lookahead <= '9') ||
819+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(61);
820+ END_STATE();
821+ case 63:
822+ if (('0' <= lookahead && lookahead <= '9') ||
823+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(62);
824+ END_STATE();
825+ case 64:
826+ if (('0' <= lookahead && lookahead <= '9') ||
827+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(63);
828+ END_STATE();
829+ case 65:
830+ if (eof) ADVANCE(67);
831+ if (lookahead == '\n') ADVANCE(68);
832 if (lookahead == '\r') ADVANCE(1);
833- if (lookahead == '+') ADVANCE(34);
834- if (lookahead == '-') ADVANCE(7);
835- if (lookahead == '.') ADVANCE(8);
836- if (lookahead == '@') ADVANCE(10);
837- if (lookahead == 'f') ADVANCE(24);
838- if (lookahead == 'm') ADVANCE(29);
839+ if (lookahead == '+') ADVANCE(57);
840+ if (lookahead == '-') ADVANCE(8);
841+ if (lookahead == '.') ADVANCE(9);
842+ if (lookahead == '@') ADVANCE(11);
843+ if (lookahead == 'f') ADVANCE(31);
844+ if (lookahead == 'i') ADVANCE(44);
845+ if (lookahead == 'm') ADVANCE(47);
846+ if (lookahead == 't') ADVANCE(45);
847 if (('\t' <= lookahead && lookahead <= '\f') ||
848- lookahead == ' ') SKIP(42)
849+ lookahead == ' ') SKIP(65)
850 if (('0' <= lookahead && lookahead <= '9') ||
851- ('a' <= lookahead && lookahead <= 'e')) ADVANCE(41);
852+ ('a' <= lookahead && lookahead <= 'e')) ADVANCE(64);
853 END_STATE();
854- case 43:
855- if (eof) ADVANCE(44);
856- if (lookahead == '+') ADVANCE(59);
857- if (lookahead == '-') ADVANCE(61);
858- if (lookahead == '@') ADVANCE(64);
859- if (lookahead == 'd') ADVANCE(67);
860- if (lookahead == 'i') ADVANCE(75);
861- if (lookahead == 'n') ADVANCE(68);
862+ case 66:
863+ if (eof) ADVANCE(67);
864+ if (lookahead == '+') ADVANCE(87);
865+ if (lookahead == '-') ADVANCE(89);
866+ if (lookahead == '@') ADVANCE(92);
867+ if (lookahead == 'd') ADVANCE(98);
868+ if (lookahead == 'i') ADVANCE(113);
869+ if (lookahead == 'n') ADVANCE(99);
870+ if (lookahead == 'r') ADVANCE(102);
871+ if (lookahead == 's') ADVANCE(106);
872 if (lookahead == '\t' ||
873 lookahead == 11 ||
874 lookahead == '\f' ||
875- lookahead == ' ') ADVANCE(79);
876+ lookahead == ' ') ADVANCE(121);
877 if (lookahead != 0 &&
878- (lookahead < '\n' || '\r' < lookahead)) ADVANCE(80);
879+ (lookahead < '\n' || '\r' < lookahead)) ADVANCE(122);
880 END_STATE();
881- case 44:
882+ case 67:
883 ACCEPT_TOKEN(ts_builtin_sym_end);
884 END_STATE();
885- case 45:
886+ case 68:
887 ACCEPT_TOKEN(aux_sym_source_token1);
888 END_STATE();
889- case 46:
890+ case 69:
891 ACCEPT_TOKEN(anon_sym_diff);
892 END_STATE();
893- case 47:
894+ case 70:
895 ACCEPT_TOKEN(anon_sym_DASH_DASHgit);
896 END_STATE();
897- case 48:
898+ case 71:
899 ACCEPT_TOKEN(aux_sym_file_change_token1);
900 END_STATE();
901- case 49:
902+ case 72:
903 ACCEPT_TOKEN(anon_sym_file);
904 END_STATE();
905- case 50:
906+ case 73:
907 ACCEPT_TOKEN(anon_sym_mode);
908 END_STATE();
909- case 51:
910+ case 74:
911+ ACCEPT_TOKEN(anon_sym_from);
912+ END_STATE();
913+ case 75:
914+ ACCEPT_TOKEN(anon_sym_to);
915+ END_STATE();
916+ case 76:
917 ACCEPT_TOKEN(anon_sym_index);
918 END_STATE();
919- case 52:
920+ case 77:
921 ACCEPT_TOKEN(anon_sym_DOT_DOT);
922 END_STATE();
923- case 53:
924+ case 78:
925+ ACCEPT_TOKEN(anon_sym_similarity);
926+ END_STATE();
927+ case 79:
928+ ACCEPT_TOKEN(anon_sym_index2);
929+ END_STATE();
930+ case 80:
931+ ACCEPT_TOKEN(aux_sym_similarity_token1);
932+ END_STATE();
933+ case 81:
934 ACCEPT_TOKEN(aux_sym_file_token1);
935 END_STATE();
936- case 54:
937+ case 82:
938 ACCEPT_TOKEN(anon_sym_AT_AT);
939 END_STATE();
940- case 55:
941+ case 83:
942 ACCEPT_TOKEN(anon_sym_AT_AT2);
943 END_STATE();
944- case 56:
945+ case 84:
946 ACCEPT_TOKEN(aux_sym_location_token1);
947 if (lookahead == '\t' ||
948 lookahead == 11 ||
949 lookahead == '\f' ||
950- lookahead == ' ') ADVANCE(56);
951+ lookahead == ' ') ADVANCE(84);
952 if (lookahead != 0 &&
953- (lookahead < '\n' || '\r' < lookahead)) ADVANCE(57);
954+ (lookahead < '\n' || '\r' < lookahead)) ADVANCE(85);
955 END_STATE();
956- case 57:
957+ case 85:
958 ACCEPT_TOKEN(aux_sym_location_token1);
959 if (lookahead != 0 &&
960 lookahead != '\n' &&
961- lookahead != '\r') ADVANCE(57);
962+ lookahead != '\r') ADVANCE(85);
963 END_STATE();
964- case 58:
965+ case 86:
966 ACCEPT_TOKEN(anon_sym_PLUS);
967- if (lookahead == '+') ADVANCE(4);
968+ if (lookahead == '+') ADVANCE(5);
969 END_STATE();
970- case 59:
971+ case 87:
972 ACCEPT_TOKEN(anon_sym_PLUS);
973- if (lookahead == '+') ADVANCE(62);
974+ if (lookahead == '+') ADVANCE(90);
975 END_STATE();
976- case 60:
977+ case 88:
978 ACCEPT_TOKEN(anon_sym_DASH);
979- if (lookahead == '-') ADVANCE(6);
980+ if (lookahead == '-') ADVANCE(7);
981 END_STATE();
982- case 61:
983+ case 89:
984 ACCEPT_TOKEN(anon_sym_DASH);
985- if (lookahead == '-') ADVANCE(63);
986+ if (lookahead == '-') ADVANCE(91);
987 END_STATE();
988- case 62:
989+ case 90:
990 ACCEPT_TOKEN(sym_context);
991- if (lookahead == '+') ADVANCE(53);
992+ if (lookahead == '+') ADVANCE(81);
993 if (lookahead != 0 &&
994 lookahead != '\n' &&
995- lookahead != '\r') ADVANCE(80);
996+ lookahead != '\r') ADVANCE(122);
997 END_STATE();
998- case 63:
999+ case 91:
1000 ACCEPT_TOKEN(sym_context);
1001- if (lookahead == '-') ADVANCE(53);
1002+ if (lookahead == '-') ADVANCE(81);
1003 if (lookahead != 0 &&
1004 lookahead != '\n' &&
1005- lookahead != '\r') ADVANCE(80);
1006+ lookahead != '\r') ADVANCE(122);
1007 END_STATE();
1008- case 64:
1009+ case 92:
1010 ACCEPT_TOKEN(sym_context);
1011- if (lookahead == '@') ADVANCE(54);
1012+ if (lookahead == '@') ADVANCE(82);
1013 if (lookahead != 0 &&
1014 lookahead != '\n' &&
1015- lookahead != '\r') ADVANCE(80);
1016+ lookahead != '\r') ADVANCE(122);
1017 END_STATE();
1018- case 65:
1019+ case 93:
1020 ACCEPT_TOKEN(sym_context);
1021- if (lookahead == 'd') ADVANCE(48);
1022+ if (lookahead == 'a') ADVANCE(115);
1023 if (lookahead != 0 &&
1024 lookahead != '\n' &&
1025- lookahead != '\r') ADVANCE(80);
1026+ lookahead != '\r') ADVANCE(122);
1027 END_STATE();
1028- case 66:
1029+ case 94:
1030 ACCEPT_TOKEN(sym_context);
1031- if (lookahead == 'd') ADVANCE(70);
1032+ if (lookahead == 'a') ADVANCE(112);
1033 if (lookahead != 0 &&
1034 lookahead != '\n' &&
1035- lookahead != '\r') ADVANCE(80);
1036+ lookahead != '\r') ADVANCE(122);
1037 END_STATE();
1038- case 67:
1039+ case 95:
1040 ACCEPT_TOKEN(sym_context);
1041- if (lookahead == 'e') ADVANCE(74);
1042- if (lookahead == 'i') ADVANCE(73);
1043+ if (lookahead == 'd') ADVANCE(71);
1044 if (lookahead != 0 &&
1045 lookahead != '\n' &&
1046- lookahead != '\r') ADVANCE(80);
1047+ lookahead != '\r') ADVANCE(122);
1048 END_STATE();
1049- case 68:
1050+ case 96:
1051 ACCEPT_TOKEN(sym_context);
1052- if (lookahead == 'e') ADVANCE(77);
1053+ if (lookahead == 'd') ADVANCE(101);
1054 if (lookahead != 0 &&
1055 lookahead != '\n' &&
1056- lookahead != '\r') ADVANCE(80);
1057+ lookahead != '\r') ADVANCE(122);
1058 END_STATE();
1059- case 69:
1060+ case 97:
1061 ACCEPT_TOKEN(sym_context);
1062- if (lookahead == 'e') ADVANCE(76);
1063+ if (lookahead == 'e') ADVANCE(71);
1064 if (lookahead != 0 &&
1065 lookahead != '\n' &&
1066- lookahead != '\r') ADVANCE(80);
1067+ lookahead != '\r') ADVANCE(122);
1068 END_STATE();
1069- case 70:
1070+ case 98:
1071 ACCEPT_TOKEN(sym_context);
1072- if (lookahead == 'e') ADVANCE(78);
1073+ if (lookahead == 'e') ADVANCE(110);
1074+ if (lookahead == 'i') ADVANCE(105);
1075 if (lookahead != 0 &&
1076 lookahead != '\n' &&
1077- lookahead != '\r') ADVANCE(80);
1078+ lookahead != '\r') ADVANCE(122);
1079 END_STATE();
1080- case 71:
1081+ case 99:
1082 ACCEPT_TOKEN(sym_context);
1083- if (lookahead == 'e') ADVANCE(65);
1084+ if (lookahead == 'e') ADVANCE(118);
1085 if (lookahead != 0 &&
1086 lookahead != '\n' &&
1087- lookahead != '\r') ADVANCE(80);
1088+ lookahead != '\r') ADVANCE(122);
1089 END_STATE();
1090- case 72:
1091+ case 100:
1092 ACCEPT_TOKEN(sym_context);
1093- if (lookahead == 'f') ADVANCE(46);
1094+ if (lookahead == 'e') ADVANCE(117);
1095 if (lookahead != 0 &&
1096 lookahead != '\n' &&
1097- lookahead != '\r') ADVANCE(80);
1098+ lookahead != '\r') ADVANCE(122);
1099 END_STATE();
1100- case 73:
1101+ case 101:
1102 ACCEPT_TOKEN(sym_context);
1103- if (lookahead == 'f') ADVANCE(72);
1104+ if (lookahead == 'e') ADVANCE(119);
1105 if (lookahead != 0 &&
1106 lookahead != '\n' &&
1107- lookahead != '\r') ADVANCE(80);
1108+ lookahead != '\r') ADVANCE(122);
1109 END_STATE();
1110- case 74:
1111+ case 102:
1112 ACCEPT_TOKEN(sym_context);
1113- if (lookahead == 'l') ADVANCE(69);
1114+ if (lookahead == 'e') ADVANCE(114);
1115 if (lookahead != 0 &&
1116 lookahead != '\n' &&
1117- lookahead != '\r') ADVANCE(80);
1118+ lookahead != '\r') ADVANCE(122);
1119 END_STATE();
1120- case 75:
1121+ case 103:
1122 ACCEPT_TOKEN(sym_context);
1123- if (lookahead == 'n') ADVANCE(66);
1124+ if (lookahead == 'e') ADVANCE(95);
1125 if (lookahead != 0 &&
1126 lookahead != '\n' &&
1127- lookahead != '\r') ADVANCE(80);
1128+ lookahead != '\r') ADVANCE(122);
1129 END_STATE();
1130- case 76:
1131+ case 104:
1132 ACCEPT_TOKEN(sym_context);
1133- if (lookahead == 't') ADVANCE(71);
1134+ if (lookahead == 'f') ADVANCE(69);
1135 if (lookahead != 0 &&
1136 lookahead != '\n' &&
1137- lookahead != '\r') ADVANCE(80);
1138+ lookahead != '\r') ADVANCE(122);
1139 END_STATE();
1140- case 77:
1141+ case 105:
1142 ACCEPT_TOKEN(sym_context);
1143- if (lookahead == 'w') ADVANCE(48);
1144+ if (lookahead == 'f') ADVANCE(104);
1145 if (lookahead != 0 &&
1146 lookahead != '\n' &&
1147- lookahead != '\r') ADVANCE(80);
1148+ lookahead != '\r') ADVANCE(122);
1149 END_STATE();
1150- case 78:
1151+ case 106:
1152 ACCEPT_TOKEN(sym_context);
1153- if (lookahead == 'x') ADVANCE(51);
1154+ if (lookahead == 'i') ADVANCE(111);
1155 if (lookahead != 0 &&
1156 lookahead != '\n' &&
1157- lookahead != '\r') ADVANCE(80);
1158+ lookahead != '\r') ADVANCE(122);
1159 END_STATE();
1160- case 79:
1161+ case 107:
1162+ ACCEPT_TOKEN(sym_context);
1163+ if (lookahead == 'i') ADVANCE(109);
1164+ if (lookahead != 0 &&
1165+ lookahead != '\n' &&
1166+ lookahead != '\r') ADVANCE(122);
1167+ END_STATE();
1168+ case 108:
1169+ ACCEPT_TOKEN(sym_context);
1170+ if (lookahead == 'i') ADVANCE(116);
1171+ if (lookahead != 0 &&
1172+ lookahead != '\n' &&
1173+ lookahead != '\r') ADVANCE(122);
1174+ END_STATE();
1175+ case 109:
1176+ ACCEPT_TOKEN(sym_context);
1177+ if (lookahead == 'l') ADVANCE(93);
1178+ if (lookahead != 0 &&
1179+ lookahead != '\n' &&
1180+ lookahead != '\r') ADVANCE(122);
1181+ END_STATE();
1182+ case 110:
1183+ ACCEPT_TOKEN(sym_context);
1184+ if (lookahead == 'l') ADVANCE(100);
1185+ if (lookahead != 0 &&
1186+ lookahead != '\n' &&
1187+ lookahead != '\r') ADVANCE(122);
1188+ END_STATE();
1189+ case 111:
1190+ ACCEPT_TOKEN(sym_context);
1191+ if (lookahead == 'm') ADVANCE(107);
1192+ if (lookahead != 0 &&
1193+ lookahead != '\n' &&
1194+ lookahead != '\r') ADVANCE(122);
1195+ END_STATE();
1196+ case 112:
1197+ ACCEPT_TOKEN(sym_context);
1198+ if (lookahead == 'm') ADVANCE(97);
1199+ if (lookahead != 0 &&
1200+ lookahead != '\n' &&
1201+ lookahead != '\r') ADVANCE(122);
1202+ END_STATE();
1203+ case 113:
1204+ ACCEPT_TOKEN(sym_context);
1205+ if (lookahead == 'n') ADVANCE(96);
1206+ if (lookahead != 0 &&
1207+ lookahead != '\n' &&
1208+ lookahead != '\r') ADVANCE(122);
1209+ END_STATE();
1210+ case 114:
1211+ ACCEPT_TOKEN(sym_context);
1212+ if (lookahead == 'n') ADVANCE(94);
1213+ if (lookahead != 0 &&
1214+ lookahead != '\n' &&
1215+ lookahead != '\r') ADVANCE(122);
1216+ END_STATE();
1217+ case 115:
1218+ ACCEPT_TOKEN(sym_context);
1219+ if (lookahead == 'r') ADVANCE(108);
1220+ if (lookahead != 0 &&
1221+ lookahead != '\n' &&
1222+ lookahead != '\r') ADVANCE(122);
1223+ END_STATE();
1224+ case 116:
1225+ ACCEPT_TOKEN(sym_context);
1226+ if (lookahead == 't') ADVANCE(120);
1227+ if (lookahead != 0 &&
1228+ lookahead != '\n' &&
1229+ lookahead != '\r') ADVANCE(122);
1230+ END_STATE();
1231+ case 117:
1232+ ACCEPT_TOKEN(sym_context);
1233+ if (lookahead == 't') ADVANCE(103);
1234+ if (lookahead != 0 &&
1235+ lookahead != '\n' &&
1236+ lookahead != '\r') ADVANCE(122);
1237+ END_STATE();
1238+ case 118:
1239+ ACCEPT_TOKEN(sym_context);
1240+ if (lookahead == 'w') ADVANCE(71);
1241+ if (lookahead != 0 &&
1242+ lookahead != '\n' &&
1243+ lookahead != '\r') ADVANCE(122);
1244+ END_STATE();
1245+ case 119:
1246+ ACCEPT_TOKEN(sym_context);
1247+ if (lookahead == 'x') ADVANCE(76);
1248+ if (lookahead != 0 &&
1249+ lookahead != '\n' &&
1250+ lookahead != '\r') ADVANCE(122);
1251+ END_STATE();
1252+ case 120:
1253+ ACCEPT_TOKEN(sym_context);
1254+ if (lookahead == 'y') ADVANCE(78);
1255+ if (lookahead != 0 &&
1256+ lookahead != '\n' &&
1257+ lookahead != '\r') ADVANCE(122);
1258+ END_STATE();
1259+ case 121:
1260 ACCEPT_TOKEN(sym_context);
1261 if (lookahead == '\t' ||
1262 lookahead == 11 ||
1263 lookahead == '\f' ||
1264- lookahead == ' ') ADVANCE(79);
1265+ lookahead == ' ') ADVANCE(121);
1266 if (lookahead != 0 &&
1267- (lookahead < '\n' || '\r' < lookahead)) ADVANCE(80);
1268+ (lookahead < '\n' || '\r' < lookahead)) ADVANCE(122);
1269 END_STATE();
1270- case 80:
1271+ case 122:
1272 ACCEPT_TOKEN(sym_context);
1273 if (lookahead != 0 &&
1274 lookahead != '\n' &&
1275- lookahead != '\r') ADVANCE(80);
1276+ lookahead != '\r') ADVANCE(122);
1277 END_STATE();
1278- case 81:
1279+ case 123:
1280 ACCEPT_TOKEN(sym_linerange);
1281- if (('0' <= lookahead && lookahead <= '9')) ADVANCE(81);
1282+ if (('0' <= lookahead && lookahead <= '9')) ADVANCE(123);
1283 END_STATE();
1284- case 82:
1285+ case 124:
1286 ACCEPT_TOKEN(sym_commit);
1287 END_STATE();
1288- case 83:
1289+ case 125:
1290 ACCEPT_TOKEN(sym_commit);
1291 if (('0' <= lookahead && lookahead <= '9') ||
1292- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(82);
1293+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(124);
1294 END_STATE();
1295- case 84:
1296+ case 126:
1297 ACCEPT_TOKEN(sym_commit);
1298 if (('0' <= lookahead && lookahead <= '9') ||
1299- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(83);
1300+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(125);
1301 END_STATE();
1302- case 85:
1303+ case 127:
1304 ACCEPT_TOKEN(sym_commit);
1305 if (('0' <= lookahead && lookahead <= '9') ||
1306- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(84);
1307+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(126);
1308 END_STATE();
1309- case 86:
1310+ case 128:
1311 ACCEPT_TOKEN(sym_commit);
1312 if (('0' <= lookahead && lookahead <= '9') ||
1313- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(85);
1314+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(127);
1315 END_STATE();
1316- case 87:
1317+ case 129:
1318 ACCEPT_TOKEN(sym_commit);
1319 if (('0' <= lookahead && lookahead <= '9') ||
1320- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(86);
1321+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(128);
1322 END_STATE();
1323- case 88:
1324+ case 130:
1325 ACCEPT_TOKEN(sym_commit);
1326 if (('0' <= lookahead && lookahead <= '9') ||
1327- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(87);
1328+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(129);
1329 END_STATE();
1330- case 89:
1331+ case 131:
1332 ACCEPT_TOKEN(sym_commit);
1333 if (('0' <= lookahead && lookahead <= '9') ||
1334- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(88);
1335+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(130);
1336 END_STATE();
1337- case 90:
1338+ case 132:
1339 ACCEPT_TOKEN(sym_commit);
1340 if (('0' <= lookahead && lookahead <= '9') ||
1341- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(89);
1342+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(131);
1343 END_STATE();
1344- case 91:
1345+ case 133:
1346 ACCEPT_TOKEN(sym_commit);
1347 if (('0' <= lookahead && lookahead <= '9') ||
1348- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(90);
1349+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(132);
1350 END_STATE();
1351- case 92:
1352+ case 134:
1353 ACCEPT_TOKEN(sym_commit);
1354 if (('0' <= lookahead && lookahead <= '9') ||
1355- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(91);
1356+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(133);
1357 END_STATE();
1358- case 93:
1359+ case 135:
1360 ACCEPT_TOKEN(sym_commit);
1361 if (('0' <= lookahead && lookahead <= '9') ||
1362- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(92);
1363+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(134);
1364 END_STATE();
1365- case 94:
1366+ case 136:
1367 ACCEPT_TOKEN(sym_commit);
1368 if (('0' <= lookahead && lookahead <= '9') ||
1369- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(93);
1370+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(135);
1371 END_STATE();
1372- case 95:
1373+ case 137:
1374 ACCEPT_TOKEN(sym_commit);
1375 if (('0' <= lookahead && lookahead <= '9') ||
1376- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(94);
1377+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(136);
1378 END_STATE();
1379- case 96:
1380+ case 138:
1381 ACCEPT_TOKEN(sym_commit);
1382 if (('0' <= lookahead && lookahead <= '9') ||
1383- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(95);
1384+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(137);
1385 END_STATE();
1386- case 97:
1387+ case 139:
1388 ACCEPT_TOKEN(sym_commit);
1389 if (('0' <= lookahead && lookahead <= '9') ||
1390- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(96);
1391+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(138);
1392 END_STATE();
1393- case 98:
1394+ case 140:
1395 ACCEPT_TOKEN(sym_commit);
1396 if (('0' <= lookahead && lookahead <= '9') ||
1397- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(97);
1398+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(139);
1399 END_STATE();
1400- case 99:
1401+ case 141:
1402 ACCEPT_TOKEN(sym_commit);
1403 if (('0' <= lookahead && lookahead <= '9') ||
1404- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(98);
1405+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(140);
1406 END_STATE();
1407- case 100:
1408+ case 142:
1409 ACCEPT_TOKEN(sym_commit);
1410 if (('0' <= lookahead && lookahead <= '9') ||
1411- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(99);
1412+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(141);
1413 END_STATE();
1414- case 101:
1415+ case 143:
1416 ACCEPT_TOKEN(sym_commit);
1417 if (('0' <= lookahead && lookahead <= '9') ||
1418- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(100);
1419+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(142);
1420 END_STATE();
1421- case 102:
1422+ case 144:
1423 ACCEPT_TOKEN(sym_commit);
1424 if (('0' <= lookahead && lookahead <= '9') ||
1425- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(101);
1426+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(143);
1427 END_STATE();
1428- case 103:
1429+ case 145:
1430 ACCEPT_TOKEN(sym_commit);
1431 if (('0' <= lookahead && lookahead <= '9') ||
1432- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(102);
1433+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(144);
1434 END_STATE();
1435- case 104:
1436+ case 146:
1437 ACCEPT_TOKEN(sym_commit);
1438 if (('0' <= lookahead && lookahead <= '9') ||
1439- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(103);
1440+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(145);
1441 END_STATE();
1442- case 105:
1443+ case 147:
1444 ACCEPT_TOKEN(sym_commit);
1445 if (('0' <= lookahead && lookahead <= '9') ||
1446- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(104);
1447+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(146);
1448 END_STATE();
1449- case 106:
1450+ case 148:
1451 ACCEPT_TOKEN(sym_commit);
1452 if (('0' <= lookahead && lookahead <= '9') ||
1453- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(105);
1454+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(147);
1455 END_STATE();
1456- case 107:
1457+ case 149:
1458 ACCEPT_TOKEN(sym_commit);
1459 if (('0' <= lookahead && lookahead <= '9') ||
1460- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(106);
1461+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(148);
1462 END_STATE();
1463- case 108:
1464+ case 150:
1465 ACCEPT_TOKEN(sym_commit);
1466 if (('0' <= lookahead && lookahead <= '9') ||
1467- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(107);
1468+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(149);
1469 END_STATE();
1470- case 109:
1471+ case 151:
1472 ACCEPT_TOKEN(sym_commit);
1473 if (('0' <= lookahead && lookahead <= '9') ||
1474- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(108);
1475+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(150);
1476 END_STATE();
1477- case 110:
1478+ case 152:
1479 ACCEPT_TOKEN(sym_commit);
1480 if (('0' <= lookahead && lookahead <= '9') ||
1481- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(109);
1482+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(151);
1483 END_STATE();
1484- case 111:
1485+ case 153:
1486 ACCEPT_TOKEN(sym_commit);
1487 if (('0' <= lookahead && lookahead <= '9') ||
1488- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(110);
1489+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(152);
1490 END_STATE();
1491- case 112:
1492+ case 154:
1493 ACCEPT_TOKEN(sym_commit);
1494 if (('0' <= lookahead && lookahead <= '9') ||
1495- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(111);
1496+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(153);
1497 END_STATE();
1498- case 113:
1499+ case 155:
1500 ACCEPT_TOKEN(sym_commit);
1501 if (('0' <= lookahead && lookahead <= '9') ||
1502- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(112);
1503+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(154);
1504 END_STATE();
1505- case 114:
1506+ case 156:
1507 ACCEPT_TOKEN(sym_commit);
1508 if (('0' <= lookahead && lookahead <= '9') ||
1509- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(113);
1510+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(155);
1511 END_STATE();
1512- case 115:
1513+ case 157:
1514 ACCEPT_TOKEN(sym_commit);
1515 if (('0' <= lookahead && lookahead <= '9') ||
1516- ('a' <= lookahead && lookahead <= 'f')) ADVANCE(114);
1517+ ('a' <= lookahead && lookahead <= 'f')) ADVANCE(156);
1518 END_STATE();
1519- case 116:
1520+ case 158:
1521 ACCEPT_TOKEN(sym_mode);
1522- if (('0' <= lookahead && lookahead <= '9')) ADVANCE(116);
1523+ if (('0' <= lookahead && lookahead <= '9')) ADVANCE(158);
1524 END_STATE();
1525 default:
1526 return false;
1527 @@ -832,36 +1088,41 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
1528
1529 static const TSLexMode ts_lex_modes[STATE_COUNT] = {
1530 [0] = {.lex_state = 0},
1531- [1] = {.lex_state = 43},
1532- [2] = {.lex_state = 43},
1533- [3] = {.lex_state = 43},
1534- [4] = {.lex_state = 43},
1535- [5] = {.lex_state = 3},
1536- [6] = {.lex_state = 3},
1537+ [1] = {.lex_state = 66},
1538+ [2] = {.lex_state = 66},
1539+ [3] = {.lex_state = 66},
1540+ [4] = {.lex_state = 66},
1541+ [5] = {.lex_state = 0},
1542+ [6] = {.lex_state = 2},
1543 [7] = {.lex_state = 3},
1544- [8] = {.lex_state = 2},
1545+ [8] = {.lex_state = 3},
1546 [9] = {.lex_state = 3},
1547- [10] = {.lex_state = 0},
1548- [11] = {.lex_state = 0},
1549+ [10] = {.lex_state = 3},
1550+ [11] = {.lex_state = 3},
1551 [12] = {.lex_state = 0},
1552- [13] = {.lex_state = 0},
1553+ [13] = {.lex_state = 2},
1554 [14] = {.lex_state = 0},
1555 [15] = {.lex_state = 0},
1556 [16] = {.lex_state = 0},
1557- [17] = {.lex_state = 2},
1558- [18] = {.lex_state = 0},
1559+ [17] = {.lex_state = 56},
1560+ [18] = {.lex_state = 2},
1561 [19] = {.lex_state = 0},
1562 [20] = {.lex_state = 2},
1563 [21] = {.lex_state = 0},
1564 [22] = {.lex_state = 0},
1565- [23] = {.lex_state = 2},
1566- [24] = {.lex_state = 0},
1567- [25] = {.lex_state = 2},
1568- [26] = {.lex_state = 0},
1569- [27] = {.lex_state = 2},
1570- [28] = {.lex_state = 3},
1571+ [23] = {.lex_state = 0},
1572+ [24] = {.lex_state = 2},
1573+ [25] = {.lex_state = 0},
1574+ [26] = {.lex_state = 2},
1575+ [27] = {.lex_state = 0},
1576+ [28] = {.lex_state = 0},
1577 [29] = {.lex_state = 0},
1578- [30] = {.lex_state = 0},
1579+ [30] = {.lex_state = 2},
1580+ [31] = {.lex_state = 0},
1581+ [32] = {.lex_state = 0},
1582+ [33] = {.lex_state = 3},
1583+ [34] = {.lex_state = 0},
1584+ [35] = {.lex_state = 0},
1585 };
1586
1587 static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
1588 @@ -873,8 +1134,12 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
1589 [aux_sym_file_change_token1] = ACTIONS(1),
1590 [anon_sym_file] = ACTIONS(1),
1591 [anon_sym_mode] = ACTIONS(1),
1592+ [anon_sym_from] = ACTIONS(1),
1593+ [anon_sym_to] = ACTIONS(1),
1594 [anon_sym_index] = ACTIONS(1),
1595 [anon_sym_DOT_DOT] = ACTIONS(1),
1596+ [anon_sym_similarity] = ACTIONS(1),
1597+ [anon_sym_index2] = ACTIONS(1),
1598 [aux_sym_file_token1] = ACTIONS(1),
1599 [anon_sym_AT_AT] = ACTIONS(1),
1600 [anon_sym_AT_AT2] = ACTIONS(1),
1601 @@ -884,252 +1149,291 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
1602 [sym_commit] = ACTIONS(1),
1603 },
1604 [1] = {
1605- [sym_source] = STATE(11),
1606- [sym__line] = STATE(12),
1607- [sym_command] = STATE(12),
1608- [sym_file_change] = STATE(12),
1609- [sym_index] = STATE(12),
1610- [sym_file] = STATE(12),
1611- [sym_location] = STATE(12),
1612- [sym_addition] = STATE(12),
1613- [sym_deletion] = STATE(12),
1614- [aux_sym_source_repeat1] = STATE(3),
1615+ [sym_source] = STATE(23),
1616+ [sym__line] = STATE(14),
1617+ [sym_command] = STATE(14),
1618+ [sym_file_change] = STATE(14),
1619+ [sym_index] = STATE(14),
1620+ [sym_similarity] = STATE(14),
1621+ [sym_file] = STATE(14),
1622+ [sym_location] = STATE(14),
1623+ [sym_addition] = STATE(14),
1624+ [sym_deletion] = STATE(14),
1625+ [aux_sym_source_repeat1] = STATE(2),
1626 [ts_builtin_sym_end] = ACTIONS(3),
1627 [anon_sym_diff] = ACTIONS(5),
1628 [aux_sym_file_change_token1] = ACTIONS(7),
1629 [anon_sym_index] = ACTIONS(9),
1630- [aux_sym_file_token1] = ACTIONS(11),
1631- [anon_sym_AT_AT] = ACTIONS(13),
1632- [anon_sym_PLUS] = ACTIONS(15),
1633- [anon_sym_DASH] = ACTIONS(17),
1634- [sym_context] = ACTIONS(19),
1635+ [anon_sym_similarity] = ACTIONS(11),
1636+ [aux_sym_file_token1] = ACTIONS(13),
1637+ [anon_sym_AT_AT] = ACTIONS(15),
1638+ [anon_sym_PLUS] = ACTIONS(17),
1639+ [anon_sym_DASH] = ACTIONS(19),
1640+ [sym_context] = ACTIONS(21),
1641 },
1642 [2] = {
1643- [sym__line] = STATE(12),
1644- [sym_command] = STATE(12),
1645- [sym_file_change] = STATE(12),
1646- [sym_index] = STATE(12),
1647- [sym_file] = STATE(12),
1648- [sym_location] = STATE(12),
1649- [sym_addition] = STATE(12),
1650- [sym_deletion] = STATE(12),
1651- [aux_sym_source_repeat1] = STATE(2),
1652- [ts_builtin_sym_end] = ACTIONS(21),
1653- [anon_sym_diff] = ACTIONS(23),
1654- [aux_sym_file_change_token1] = ACTIONS(26),
1655- [anon_sym_index] = ACTIONS(29),
1656- [aux_sym_file_token1] = ACTIONS(32),
1657- [anon_sym_AT_AT] = ACTIONS(35),
1658- [anon_sym_PLUS] = ACTIONS(38),
1659- [anon_sym_DASH] = ACTIONS(41),
1660- [sym_context] = ACTIONS(44),
1661- },
1662- [3] = {
1663- [sym__line] = STATE(12),
1664- [sym_command] = STATE(12),
1665- [sym_file_change] = STATE(12),
1666- [sym_index] = STATE(12),
1667- [sym_file] = STATE(12),
1668- [sym_location] = STATE(12),
1669- [sym_addition] = STATE(12),
1670- [sym_deletion] = STATE(12),
1671- [aux_sym_source_repeat1] = STATE(2),
1672- [ts_builtin_sym_end] = ACTIONS(47),
1673+ [sym__line] = STATE(14),
1674+ [sym_command] = STATE(14),
1675+ [sym_file_change] = STATE(14),
1676+ [sym_index] = STATE(14),
1677+ [sym_similarity] = STATE(14),
1678+ [sym_file] = STATE(14),
1679+ [sym_location] = STATE(14),
1680+ [sym_addition] = STATE(14),
1681+ [sym_deletion] = STATE(14),
1682+ [aux_sym_source_repeat1] = STATE(3),
1683+ [ts_builtin_sym_end] = ACTIONS(23),
1684 [anon_sym_diff] = ACTIONS(5),
1685 [aux_sym_file_change_token1] = ACTIONS(7),
1686 [anon_sym_index] = ACTIONS(9),
1687- [aux_sym_file_token1] = ACTIONS(11),
1688- [anon_sym_AT_AT] = ACTIONS(13),
1689- [anon_sym_PLUS] = ACTIONS(15),
1690- [anon_sym_DASH] = ACTIONS(17),
1691- [sym_context] = ACTIONS(19),
1692+ [anon_sym_similarity] = ACTIONS(11),
1693+ [aux_sym_file_token1] = ACTIONS(13),
1694+ [anon_sym_AT_AT] = ACTIONS(15),
1695+ [anon_sym_PLUS] = ACTIONS(17),
1696+ [anon_sym_DASH] = ACTIONS(19),
1697+ [sym_context] = ACTIONS(21),
1698+ },
1699+ [3] = {
1700+ [sym__line] = STATE(14),
1701+ [sym_command] = STATE(14),
1702+ [sym_file_change] = STATE(14),
1703+ [sym_index] = STATE(14),
1704+ [sym_similarity] = STATE(14),
1705+ [sym_file] = STATE(14),
1706+ [sym_location] = STATE(14),
1707+ [sym_addition] = STATE(14),
1708+ [sym_deletion] = STATE(14),
1709+ [aux_sym_source_repeat1] = STATE(3),
1710+ [ts_builtin_sym_end] = ACTIONS(25),
1711+ [anon_sym_diff] = ACTIONS(27),
1712+ [aux_sym_file_change_token1] = ACTIONS(30),
1713+ [anon_sym_index] = ACTIONS(33),
1714+ [anon_sym_similarity] = ACTIONS(36),
1715+ [aux_sym_file_token1] = ACTIONS(39),
1716+ [anon_sym_AT_AT] = ACTIONS(42),
1717+ [anon_sym_PLUS] = ACTIONS(45),
1718+ [anon_sym_DASH] = ACTIONS(48),
1719+ [sym_context] = ACTIONS(51),
1720 },
1721 };
1722
1723 static const uint16_t ts_small_parse_table[] = {
1724 [0] = 2,
1725- ACTIONS(49), 3,
1726+ ACTIONS(54), 3,
1727 anon_sym_PLUS,
1728 anon_sym_DASH,
1729 sym_context,
1730- ACTIONS(21), 6,
1731+ ACTIONS(25), 7,
1732 ts_builtin_sym_end,
1733 anon_sym_diff,
1734 aux_sym_file_change_token1,
1735 anon_sym_index,
1736+ anon_sym_similarity,
1737 aux_sym_file_token1,
1738 anon_sym_AT_AT,
1739- [14] = 2,
1740- ACTIONS(51), 1,
1741+ [15] = 2,
1742+ ACTIONS(56), 1,
1743+ anon_sym_file,
1744+ ACTIONS(58), 2,
1745+ anon_sym_from,
1746+ anon_sym_to,
1747+ [23] = 2,
1748+ ACTIONS(60), 1,
1749 aux_sym_source_token1,
1750- ACTIONS(53), 1,
1751- aux_sym_location_token1,
1752- [21] = 2,
1753- ACTIONS(55), 1,
1754- aux_sym_location_token1,
1755- STATE(22), 1,
1756- sym_filename,
1757- [28] = 2,
1758- ACTIONS(55), 1,
1759+ ACTIONS(62), 1,
1760+ sym_mode,
1761+ [30] = 2,
1762+ ACTIONS(64), 1,
1763 aux_sym_location_token1,
1764- STATE(16), 1,
1765+ STATE(19), 1,
1766 sym_filename,
1767- [35] = 2,
1768- ACTIONS(57), 1,
1769- aux_sym_source_token1,
1770- ACTIONS(59), 1,
1771- sym_mode,
1772- [42] = 2,
1773- ACTIONS(61), 1,
1774+ [37] = 2,
1775+ ACTIONS(66), 1,
1776 aux_sym_source_token1,
1777- ACTIONS(63), 1,
1778+ ACTIONS(68), 1,
1779 aux_sym_location_token1,
1780- [49] = 1,
1781- ACTIONS(65), 1,
1782- aux_sym_source_token1,
1783- [53] = 1,
1784- ACTIONS(67), 1,
1785- ts_builtin_sym_end,
1786- [57] = 1,
1787- ACTIONS(69), 1,
1788+ [44] = 2,
1789+ ACTIONS(70), 1,
1790 aux_sym_source_token1,
1791- [61] = 1,
1792- ACTIONS(71), 1,
1793- anon_sym_mode,
1794+ ACTIONS(72), 1,
1795+ aux_sym_location_token1,
1796+ [51] = 2,
1797+ ACTIONS(64), 1,
1798+ aux_sym_location_token1,
1799+ STATE(25), 1,
1800+ sym_filename,
1801+ [58] = 2,
1802+ ACTIONS(64), 1,
1803+ aux_sym_location_token1,
1804+ STATE(27), 1,
1805+ sym_filename,
1806 [65] = 1,
1807- ACTIONS(73), 1,
1808- anon_sym_DOT_DOT,
1809- [69] = 1,
1810- ACTIONS(75), 1,
1811+ ACTIONS(74), 1,
1812 aux_sym_source_token1,
1813+ [69] = 1,
1814+ ACTIONS(76), 1,
1815+ sym_linerange,
1816 [73] = 1,
1817- ACTIONS(77), 1,
1818+ ACTIONS(78), 1,
1819 aux_sym_source_token1,
1820 [77] = 1,
1821- ACTIONS(79), 1,
1822- sym_linerange,
1823+ ACTIONS(80), 1,
1824+ anon_sym_mode,
1825 [81] = 1,
1826- ACTIONS(81), 1,
1827- sym_commit,
1828+ ACTIONS(82), 1,
1829+ anon_sym_DOT_DOT,
1830 [85] = 1,
1831- ACTIONS(83), 1,
1832- aux_sym_source_token1,
1833+ ACTIONS(84), 1,
1834+ aux_sym_similarity_token1,
1835 [89] = 1,
1836- ACTIONS(85), 1,
1837+ ACTIONS(86), 1,
1838 anon_sym_DASH_DASHgit,
1839 [93] = 1,
1840- ACTIONS(87), 1,
1841- anon_sym_file,
1842- [97] = 1,
1843- ACTIONS(89), 1,
1844+ ACTIONS(88), 1,
1845 aux_sym_source_token1,
1846+ [97] = 1,
1847+ ACTIONS(90), 1,
1848+ sym_linerange,
1849 [101] = 1,
1850- ACTIONS(91), 1,
1851- sym_mode,
1852+ ACTIONS(92), 1,
1853+ aux_sym_source_token1,
1854 [105] = 1,
1855- ACTIONS(93), 1,
1856- sym_commit,
1857+ ACTIONS(94), 1,
1858+ aux_sym_source_token1,
1859 [109] = 1,
1860- ACTIONS(95), 1,
1861- anon_sym_AT_AT2,
1862+ ACTIONS(96), 1,
1863+ ts_builtin_sym_end,
1864 [113] = 1,
1865- ACTIONS(97), 1,
1866- aux_sym_source_token1,
1867+ ACTIONS(98), 1,
1868+ anon_sym_index2,
1869 [117] = 1,
1870- ACTIONS(99), 1,
1871- sym_linerange,
1872+ ACTIONS(100), 1,
1873+ aux_sym_source_token1,
1874 [121] = 1,
1875- ACTIONS(101), 1,
1876- aux_sym_location_token1,
1877+ ACTIONS(102), 1,
1878+ sym_mode,
1879 [125] = 1,
1880- ACTIONS(103), 1,
1881+ ACTIONS(104), 1,
1882 aux_sym_source_token1,
1883 [129] = 1,
1884- ACTIONS(105), 1,
1885+ ACTIONS(106), 1,
1886+ sym_commit,
1887+ [133] = 1,
1888+ ACTIONS(108), 1,
1889+ aux_sym_source_token1,
1890+ [137] = 1,
1891+ ACTIONS(110), 1,
1892+ anon_sym_AT_AT2,
1893+ [141] = 1,
1894+ ACTIONS(112), 1,
1895+ aux_sym_source_token1,
1896+ [145] = 1,
1897+ ACTIONS(114), 1,
1898+ sym_commit,
1899+ [149] = 1,
1900+ ACTIONS(116), 1,
1901+ aux_sym_location_token1,
1902+ [153] = 1,
1903+ ACTIONS(118), 1,
1904+ aux_sym_source_token1,
1905+ [157] = 1,
1906+ ACTIONS(120), 1,
1907 aux_sym_source_token1,
1908 };
1909
1910 static const uint32_t ts_small_parse_table_map[] = {
1911 [SMALL_STATE(4)] = 0,
1912- [SMALL_STATE(5)] = 14,
1913- [SMALL_STATE(6)] = 21,
1914- [SMALL_STATE(7)] = 28,
1915- [SMALL_STATE(8)] = 35,
1916- [SMALL_STATE(9)] = 42,
1917- [SMALL_STATE(10)] = 49,
1918- [SMALL_STATE(11)] = 53,
1919- [SMALL_STATE(12)] = 57,
1920- [SMALL_STATE(13)] = 61,
1921- [SMALL_STATE(14)] = 65,
1922- [SMALL_STATE(15)] = 69,
1923- [SMALL_STATE(16)] = 73,
1924- [SMALL_STATE(17)] = 77,
1925- [SMALL_STATE(18)] = 81,
1926- [SMALL_STATE(19)] = 85,
1927- [SMALL_STATE(20)] = 89,
1928- [SMALL_STATE(21)] = 93,
1929- [SMALL_STATE(22)] = 97,
1930- [SMALL_STATE(23)] = 101,
1931- [SMALL_STATE(24)] = 105,
1932- [SMALL_STATE(25)] = 109,
1933- [SMALL_STATE(26)] = 113,
1934- [SMALL_STATE(27)] = 117,
1935- [SMALL_STATE(28)] = 121,
1936- [SMALL_STATE(29)] = 125,
1937- [SMALL_STATE(30)] = 129,
1938+ [SMALL_STATE(5)] = 15,
1939+ [SMALL_STATE(6)] = 23,
1940+ [SMALL_STATE(7)] = 30,
1941+ [SMALL_STATE(8)] = 37,
1942+ [SMALL_STATE(9)] = 44,
1943+ [SMALL_STATE(10)] = 51,
1944+ [SMALL_STATE(11)] = 58,
1945+ [SMALL_STATE(12)] = 65,
1946+ [SMALL_STATE(13)] = 69,
1947+ [SMALL_STATE(14)] = 73,
1948+ [SMALL_STATE(15)] = 77,
1949+ [SMALL_STATE(16)] = 81,
1950+ [SMALL_STATE(17)] = 85,
1951+ [SMALL_STATE(18)] = 89,
1952+ [SMALL_STATE(19)] = 93,
1953+ [SMALL_STATE(20)] = 97,
1954+ [SMALL_STATE(21)] = 101,
1955+ [SMALL_STATE(22)] = 105,
1956+ [SMALL_STATE(23)] = 109,
1957+ [SMALL_STATE(24)] = 113,
1958+ [SMALL_STATE(25)] = 117,
1959+ [SMALL_STATE(26)] = 121,
1960+ [SMALL_STATE(27)] = 125,
1961+ [SMALL_STATE(28)] = 129,
1962+ [SMALL_STATE(29)] = 133,
1963+ [SMALL_STATE(30)] = 137,
1964+ [SMALL_STATE(31)] = 141,
1965+ [SMALL_STATE(32)] = 145,
1966+ [SMALL_STATE(33)] = 149,
1967+ [SMALL_STATE(34)] = 153,
1968+ [SMALL_STATE(35)] = 157,
1969 };
1970
1971 static const TSParseActionEntry ts_parse_actions[] = {
1972 [0] = {.entry = {.count = 0, .reusable = false}},
1973 [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(),
1974 [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 0),
1975- [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20),
1976- [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21),
1977- [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18),
1978- [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7),
1979- [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27),
1980- [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5),
1981- [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9),
1982- [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12),
1983- [21] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2),
1984- [23] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(20),
1985- [26] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(21),
1986- [29] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(18),
1987- [32] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(7),
1988- [35] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(27),
1989- [38] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(5),
1990- [41] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(9),
1991- [44] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(12),
1992- [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1),
1993- [49] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2),
1994- [51] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_addition, 1),
1995- [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10),
1996- [55] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15),
1997- [57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_index, 4),
1998- [59] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29),
1999- [61] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_deletion, 1),
2000- [63] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19),
2001- [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_addition, 2),
2002- [67] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(),
2003- [69] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4),
2004- [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23),
2005- [73] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24),
2006- [75] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_filename, 1),
2007- [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_file, 2),
2008- [79] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25),
2009- [81] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14),
2010- [83] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_deletion, 2),
2011- [85] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6),
2012- [87] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13),
2013- [89] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_command, 3),
2014- [91] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26),
2015- [93] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8),
2016- [95] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28),
2017- [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_file_change, 4),
2018- [99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17),
2019- [101] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30),
2020- [103] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_index, 5),
2021- [105] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_location, 5),
2022+ [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18),
2023+ [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5),
2024+ [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32),
2025+ [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24),
2026+ [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7),
2027+ [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13),
2028+ [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8),
2029+ [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9),
2030+ [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14),
2031+ [23] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1),
2032+ [25] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2),
2033+ [27] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(18),
2034+ [30] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(5),
2035+ [33] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(32),
2036+ [36] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(24),
2037+ [39] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(7),
2038+ [42] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(13),
2039+ [45] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(8),
2040+ [48] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(9),
2041+ [51] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(14),
2042+ [54] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2),
2043+ [56] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15),
2044+ [58] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11),
2045+ [60] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_index, 4),
2046+ [62] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34),
2047+ [64] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12),
2048+ [66] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_addition, 1),
2049+ [68] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21),
2050+ [70] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_deletion, 1),
2051+ [72] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22),
2052+ [74] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_filename, 1),
2053+ [76] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20),
2054+ [78] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4),
2055+ [80] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26),
2056+ [82] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28),
2057+ [84] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29),
2058+ [86] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10),
2059+ [88] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_file, 2),
2060+ [90] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30),
2061+ [92] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_addition, 2),
2062+ [94] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_deletion, 2),
2063+ [96] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(),
2064+ [98] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17),
2065+ [100] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_command, 3),
2066+ [102] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31),
2067+ [104] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_file_change, 3),
2068+ [106] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6),
2069+ [108] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_similarity, 3, .production_id = 1),
2070+ [110] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33),
2071+ [112] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_file_change, 4),
2072+ [114] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16),
2073+ [116] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35),
2074+ [118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_index, 5),
2075+ [120] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_location, 5),
2076 };
2077
2078 #ifdef __cplusplus
2079 @@ -1156,6 +1460,9 @@ extern const TSLanguage *tree_sitter_gitdiff(void) {
2080 .small_parse_table_map = ts_small_parse_table_map,
2081 .parse_actions = ts_parse_actions,
2082 .symbol_names = ts_symbol_names,
2083+ .field_names = ts_field_names,
2084+ .field_map_slices = ts_field_map_slices,
2085+ .field_map_entries = ts_field_map_entries,
2086 .symbol_metadata = ts_symbol_metadata,
2087 .public_symbol_map = ts_symbol_map,
2088 .alias_map = ts_non_terminal_alias_map,
2089 diff --git a/test/corpus/text.txt b/test/corpus/text.txt
2090index d2ca863..17658ec 100644
2091--- a/test/corpus/text.txt
2092+++ b/test/corpus/text.txt
2093 @@ -52,9 +52,13 @@ index 0000000..e69de29
2094 --------------------------------------------------------------------------------
2095
2096 (source
2097- (command (filename))
2098- (file_change (mode))
2099- (index (commit) (commit)))
2100+ (command
2101+ (filename))
2102+ (file_change
2103+ (mode))
2104+ (index
2105+ (commit)
2106+ (commit)))
2107
2108 ================================================================================
2109 Deleted empty file
2110 @@ -66,6 +70,29 @@ index e69de29..0000000
2111 --------------------------------------------------------------------------------
2112
2113 (source
2114- (command (filename))
2115- (file_change (mode))
2116- (index (commit) (commit)))
2117+ (command
2118+ (filename))
2119+ (file_change
2120+ (mode))
2121+ (index
2122+ (commit)
2123+ (commit)))
2124+
2125+ ================================================================================
2126+ File rename
2127+ ================================================================================
2128+ diff --git a/tmp.txt b/tmp.md
2129+ similarity index 100%
2130+ rename from tmp.txt
2131+ rename to tmp.md
2132+
2133+ --------------------------------------------------------------------------------
2134+
2135+ (source
2136+ (command
2137+ (filename))
2138+ (similarity)
2139+ (file_change
2140+ (filename))
2141+ (file_change
2142+ (filename)))