Author: Michael Davis [mcarsondavis@gmail.com]
Hash: 6f14340daa1bfc9dd0644817c83cad786be25af6
Timestamp: Thu, 23 Dec 2021 23:12:11 +0000 (2 years ago)

+5 -10 +/-3 browse
setup newline and placeholder for extras
1diff --git a/grammar.js b/grammar.js
2index fa6963f..dc36969 100644
3--- a/grammar.js
4+++ b/grammar.js
5 @@ -1,6 +1,10 @@
6+ const NEWLINE = /\r?\n/;
7+
8 module.exports = grammar({
9 name: "gitdiff",
10
11+ extras: ($) => [],
12+
13 rules: {
14 source: ($) => "hello",
15 },
16 diff --git a/src/grammar.json b/src/grammar.json
17index 4662e9d..4559391 100644
18--- a/src/grammar.json
19+++ b/src/grammar.json
20 @@ -6,12 +6,7 @@
21 "value": "hello"
22 }
23 },
24- "extras": [
25- {
26- "type": "PATTERN",
27- "value": "\\s"
28- }
29- ],
30+ "extras": [],
31 "conflicts": [],
32 "precedences": [],
33 "externals": [],
34 diff --git a/src/parser.c b/src/parser.c
35index 642ddce..4dee83b 100644
36--- a/src/parser.c
37+++ b/src/parser.c
38 @@ -63,10 +63,6 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
39 case 0:
40 if (eof) ADVANCE(5);
41 if (lookahead == 'h') ADVANCE(1);
42- if (lookahead == '\t' ||
43- lookahead == '\n' ||
44- lookahead == '\r' ||
45- lookahead == ' ') SKIP(0)
46 END_STATE();
47 case 1:
48 if (lookahead == 'e') ADVANCE(3);