@gram-data/tree-sitter-gram 0.1.11 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -1
- package/editors/README.md +68 -0
- package/editors/zed/README.md +149 -0
- package/editors/zed/example.gram +89 -0
- package/editors/zed/extension.toml +11 -0
- package/editors/zed/languages/gram/config.toml +16 -0
- package/editors/zed/languages/gram/highlights.scm +79 -0
- package/editors/zed/test.gram +8 -0
- package/grammar.js +373 -189
- package/package.json +10 -4
- package/prebuilds/darwin-arm64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/darwin-x64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/linux-arm64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/linux-x64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/win32-arm64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/win32-x64/@gram-data+tree-sitter-gram.node +0 -0
- package/queries/highlights.scm +79 -0
- package/src/grammar.json +1248 -539
- package/src/node-types.json +394 -485
- package/src/parser.c +4077 -2370
package/grammar.js
CHANGED
|
@@ -1,208 +1,394 @@
|
|
|
1
1
|
module.exports = grammar({
|
|
2
|
-
name:
|
|
2
|
+
name: "gram",
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
extras: ($) => [
|
|
5
|
+
/\s/,
|
|
6
|
+
$.comment,
|
|
7
|
+
],
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
field(
|
|
32
|
-
|
|
33
|
-
),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
9
|
+
rules: {
|
|
10
|
+
gram: ($) => seq(field("root", optional($.record)), repeat($.pattern)),
|
|
11
|
+
|
|
12
|
+
pattern: ($) =>
|
|
13
|
+
seq(
|
|
14
|
+
field("annotations", optional($.annotations)),
|
|
15
|
+
field("elements", commaSep1($._pattern_element)),
|
|
16
|
+
),
|
|
17
|
+
_pattern_element: ($) => choice($.subject, $._path),
|
|
18
|
+
|
|
19
|
+
subject: ($) =>
|
|
20
|
+
seq(
|
|
21
|
+
"[",
|
|
22
|
+
field("attributes", optional($._attributes)),
|
|
23
|
+
field("pattern", optional(seq("|", $.sub_pattern))),
|
|
24
|
+
"]",
|
|
25
|
+
),
|
|
26
|
+
|
|
27
|
+
sub_pattern: ($) => commaSep1($._sub_pattern_element),
|
|
28
|
+
|
|
29
|
+
_sub_pattern_element: ($) => choice($.subject, $._path, $.reference),
|
|
30
|
+
|
|
31
|
+
annotations: ($) => repeat1($.annotation),
|
|
32
|
+
|
|
33
|
+
annotation: ($) =>
|
|
34
|
+
seq("@", field("key", $.symbol), "(", field("value", $._value), ")"),
|
|
35
|
+
|
|
36
|
+
_path: ($) => choice($.relationship, $.node),
|
|
37
|
+
|
|
38
|
+
node: ($) =>
|
|
39
|
+
seq(
|
|
40
|
+
"(",
|
|
41
|
+
field("annotations", optional($.annotations)),
|
|
42
|
+
field("attributes", optional($._attributes)),
|
|
43
|
+
")",
|
|
44
|
+
),
|
|
45
|
+
|
|
46
|
+
relationship: ($) =>
|
|
47
|
+
seq(
|
|
48
|
+
field("left", $.node),
|
|
49
|
+
field("kind", $._relationship_kind),
|
|
50
|
+
field("right", $._path),
|
|
51
|
+
),
|
|
52
|
+
|
|
53
|
+
reference: ($) => field("identifier", $._identifier),
|
|
54
|
+
|
|
55
|
+
_identifier: ($) => choice($.symbol, $.string_literal, $.integer),
|
|
56
|
+
|
|
57
|
+
_attributes: ($) =>
|
|
58
|
+
choice(
|
|
59
|
+
choice(
|
|
60
|
+
field("identifier", $._identifier),
|
|
61
|
+
field("labels", $.labels),
|
|
62
|
+
field("record", $.record),
|
|
63
|
+
),
|
|
64
|
+
seq(field("identifier", $._identifier), field("labels", $.labels)),
|
|
65
|
+
seq(field("identifier", $._identifier), field("record", $.record)),
|
|
66
|
+
seq(field("labels", $.labels), field("record", $.record)),
|
|
67
|
+
seq(
|
|
68
|
+
field("identifier", $._identifier),
|
|
69
|
+
field("labels", $.labels),
|
|
70
|
+
field("record", $.record),
|
|
71
|
+
),
|
|
72
|
+
),
|
|
73
|
+
|
|
74
|
+
_value: ($) =>
|
|
75
|
+
choice(
|
|
76
|
+
prec.right(2, $.range),
|
|
77
|
+
prec.right(1, $._numeric_literal),
|
|
78
|
+
prec(3, $.boolean_literal),
|
|
79
|
+
prec(2, $.tagged_string),
|
|
80
|
+
prec(1, $.symbol),
|
|
81
|
+
$.string_literal,
|
|
82
|
+
$.array,
|
|
83
|
+
$.map,
|
|
84
|
+
),
|
|
85
|
+
|
|
86
|
+
_scalar_value: ($) =>
|
|
87
|
+
choice(
|
|
88
|
+
prec.right(2, $.range),
|
|
89
|
+
prec.right(1, $._numeric_literal),
|
|
90
|
+
prec(3, $.boolean_literal),
|
|
91
|
+
prec(2, $.tagged_string),
|
|
92
|
+
prec(1, $.symbol),
|
|
93
|
+
$.string_literal,
|
|
94
|
+
),
|
|
95
|
+
|
|
96
|
+
array: ($) => seq("[", commaSep1($._scalar_value), "]"),
|
|
97
|
+
|
|
98
|
+
labels: ($) => repeat1($._label),
|
|
99
|
+
|
|
100
|
+
_label: ($) => seq(choice(":", "::"), $.symbol),
|
|
101
|
+
|
|
102
|
+
record: ($) => seq("{", commaSep($.property), "}"),
|
|
103
|
+
|
|
104
|
+
property: ($) =>
|
|
105
|
+
seq(
|
|
106
|
+
field("key", $._identifier),
|
|
107
|
+
choice(":", "::"),
|
|
108
|
+
field("value", $._value),
|
|
109
|
+
),
|
|
110
|
+
|
|
111
|
+
map: ($) => seq("{", commaSep($.mapping), "}"),
|
|
112
|
+
|
|
113
|
+
mapping: ($) =>
|
|
114
|
+
seq(field("key", $._identifier), ":", field("value", $._scalar_value)),
|
|
115
|
+
|
|
116
|
+
symbol: ($) => token(/[a-zA-Z_][0-9a-zA-Z_.\-@]*/),
|
|
117
|
+
|
|
118
|
+
range: ($) =>
|
|
119
|
+
choice(
|
|
120
|
+
seq(
|
|
121
|
+
field("lower", $._numeric_literal),
|
|
122
|
+
"..",
|
|
123
|
+
field("upper", $._numeric_literal),
|
|
124
|
+
),
|
|
125
|
+
seq(field("lower", $._numeric_literal), "..."),
|
|
126
|
+
seq("...", field("upper", $._numeric_literal)),
|
|
127
|
+
),
|
|
128
|
+
|
|
129
|
+
boolean_literal: ($) => choice("true", "false"),
|
|
130
|
+
|
|
131
|
+
_numeric_literal: ($) =>
|
|
132
|
+
choice($.integer, $.decimal, $.hexadecimal, $.octal, $.measurement),
|
|
133
|
+
|
|
134
|
+
integer: ($) => {
|
|
135
|
+
const integer = /-?(0|[1-9]\d*)/;
|
|
111
136
|
return token(integer);
|
|
112
137
|
},
|
|
113
138
|
|
|
114
|
-
decimal: $ => {
|
|
115
|
-
const decimal = /-?(0|[1-9]\d*)\.\d+/;
|
|
139
|
+
decimal: ($) => {
|
|
140
|
+
const decimal = /-?(0|[1-9]\d*)\.\d+/;
|
|
116
141
|
return token(decimal);
|
|
117
142
|
},
|
|
118
143
|
|
|
119
|
-
hexadecimal: $ => {
|
|
120
|
-
const hexadecimal = /0x[0-9a-fA-F]+/;
|
|
144
|
+
hexadecimal: ($) => {
|
|
145
|
+
const hexadecimal = /0x[0-9a-fA-F]+/;
|
|
121
146
|
return token(hexadecimal);
|
|
122
147
|
},
|
|
123
148
|
|
|
124
|
-
octal: $ => {
|
|
125
|
-
const octal = /0[0-7]+/;
|
|
149
|
+
octal: ($) => {
|
|
150
|
+
const octal = /0[0-7]+/;
|
|
126
151
|
return token(octal);
|
|
127
152
|
},
|
|
128
153
|
|
|
129
|
-
measurement: $ => {
|
|
154
|
+
measurement: ($) => {
|
|
130
155
|
// /-?(?:[0-9]|[1-9][0-9]+)(?:\.[0-9]+)?[a-zA-Z]+\b(?!@)/
|
|
131
|
-
const measurement = /-?(0|[1-9]\d*)([a-zA-Z]+)/;
|
|
156
|
+
const measurement = /-?(0|[1-9]\d*)([a-zA-Z]+)/;
|
|
132
157
|
return token(measurement);
|
|
133
158
|
},
|
|
134
159
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
160
|
+
string_literal: ($) =>
|
|
161
|
+
choice(
|
|
162
|
+
$._single_quoted_string,
|
|
163
|
+
$._double_quoted_string,
|
|
164
|
+
$._backticked_string,
|
|
165
|
+
$._fenced_string,
|
|
166
|
+
),
|
|
167
|
+
|
|
168
|
+
_single_quoted_string: ($) =>
|
|
169
|
+
delimit_string(alias($._single_quoted_text, $.string_content), "'"),
|
|
170
|
+
|
|
171
|
+
_single_quoted_text: ($) => token.immediate(/(\\['bfnrt/\\]|[^'\\\n])*/),
|
|
172
|
+
|
|
173
|
+
_double_quoted_string: ($) =>
|
|
174
|
+
delimit_string(alias($._double_quoted_text, $.string_content), '"'),
|
|
175
|
+
|
|
176
|
+
_double_quoted_text: ($) => token.immediate(/(\\["bfnrt/\\]|[^"\\\n])*/),
|
|
177
|
+
|
|
178
|
+
_backticked_string: ($) =>
|
|
179
|
+
delimit_string(alias($._backticked_text, $.string_content), "`"),
|
|
180
|
+
|
|
181
|
+
_backticked_text: ($) => token.immediate(/(\\[`bfnrt/\\]|[^`\\\n])*/),
|
|
182
|
+
|
|
183
|
+
_fenced_string: ($) => seq("```", $._fenced_string_body),
|
|
184
|
+
|
|
185
|
+
_fenced_string_body: ($) =>
|
|
186
|
+
seq(
|
|
187
|
+
"\n",
|
|
188
|
+
field(
|
|
189
|
+
"content",
|
|
190
|
+
optional(alias($._fenced_string_content, $.string_content)),
|
|
191
|
+
),
|
|
192
|
+
"```",
|
|
193
|
+
),
|
|
194
|
+
|
|
195
|
+
_fenced_string_content: ($) => token.immediate(/([^`]|`[^`]|``[^`])+/),
|
|
196
|
+
|
|
197
|
+
tagged_string: ($) =>
|
|
198
|
+
choice(
|
|
199
|
+
seq(
|
|
200
|
+
field("tag", $.symbol),
|
|
201
|
+
"`",
|
|
202
|
+
field("content", alias($._backticked_text, $.string_content)),
|
|
203
|
+
"`",
|
|
204
|
+
),
|
|
205
|
+
seq(
|
|
206
|
+
"```",
|
|
207
|
+
field("tag", $.symbol),
|
|
208
|
+
"\n",
|
|
209
|
+
field(
|
|
210
|
+
"content",
|
|
211
|
+
optional(alias($._fenced_string_content, $.string_content)),
|
|
212
|
+
),
|
|
213
|
+
"```",
|
|
214
|
+
),
|
|
215
|
+
),
|
|
216
|
+
|
|
217
|
+
_relationship_kind: ($) =>
|
|
218
|
+
choice(
|
|
219
|
+
$.undirected_arrow,
|
|
220
|
+
$.left_arrow,
|
|
221
|
+
$.right_arrow,
|
|
222
|
+
$.bidirectional_arrow,
|
|
223
|
+
),
|
|
224
|
+
|
|
225
|
+
undirected_arrow: ($) =>
|
|
226
|
+
choice(
|
|
227
|
+
seq(
|
|
228
|
+
"-",
|
|
229
|
+
optional(
|
|
230
|
+
seq(
|
|
231
|
+
"[",
|
|
232
|
+
field("annotations", optional($.annotations)),
|
|
233
|
+
field("attributes", optional($._attributes)),
|
|
234
|
+
"]",
|
|
235
|
+
),
|
|
236
|
+
),
|
|
237
|
+
"-",
|
|
238
|
+
),
|
|
239
|
+
seq(
|
|
240
|
+
"=",
|
|
241
|
+
optional(
|
|
242
|
+
seq(
|
|
243
|
+
"[",
|
|
244
|
+
field("annotations", optional($.annotations)),
|
|
245
|
+
field("attributes", optional($._attributes)),
|
|
246
|
+
"]",
|
|
247
|
+
),
|
|
248
|
+
),
|
|
249
|
+
"=",
|
|
250
|
+
),
|
|
251
|
+
seq(
|
|
252
|
+
"~",
|
|
253
|
+
optional(
|
|
254
|
+
seq(
|
|
255
|
+
"[",
|
|
256
|
+
field("annotations", optional($.annotations)),
|
|
257
|
+
field("attributes", optional($._attributes)),
|
|
258
|
+
"]",
|
|
259
|
+
),
|
|
260
|
+
),
|
|
261
|
+
"~",
|
|
262
|
+
),
|
|
263
|
+
),
|
|
264
|
+
|
|
265
|
+
right_arrow: ($) =>
|
|
266
|
+
choice(
|
|
267
|
+
seq(
|
|
268
|
+
"-",
|
|
269
|
+
optional(
|
|
270
|
+
seq(
|
|
271
|
+
"[",
|
|
272
|
+
field("annotations", optional($.annotations)),
|
|
273
|
+
field("attributes", optional($._attributes)),
|
|
274
|
+
"]",
|
|
275
|
+
),
|
|
276
|
+
),
|
|
277
|
+
"->",
|
|
278
|
+
),
|
|
279
|
+
seq(
|
|
280
|
+
"=",
|
|
281
|
+
optional(
|
|
282
|
+
seq(
|
|
283
|
+
"[",
|
|
284
|
+
field("annotations", optional($.annotations)),
|
|
285
|
+
field("attributes", optional($._attributes)),
|
|
286
|
+
"]",
|
|
287
|
+
),
|
|
288
|
+
),
|
|
289
|
+
"=>",
|
|
290
|
+
),
|
|
291
|
+
seq(
|
|
292
|
+
"~",
|
|
293
|
+
optional(
|
|
294
|
+
seq(
|
|
295
|
+
"[",
|
|
296
|
+
field("annotations", optional($.annotations)),
|
|
297
|
+
field("attributes", optional($._attributes)),
|
|
298
|
+
"]",
|
|
299
|
+
),
|
|
300
|
+
),
|
|
301
|
+
"~>",
|
|
302
|
+
),
|
|
303
|
+
),
|
|
304
|
+
|
|
305
|
+
left_arrow: ($) =>
|
|
306
|
+
choice(
|
|
307
|
+
seq(
|
|
308
|
+
"<-",
|
|
309
|
+
optional(
|
|
310
|
+
seq(
|
|
311
|
+
"[",
|
|
312
|
+
field("annotations", optional($.annotations)),
|
|
313
|
+
field("attributes", optional($._attributes)),
|
|
314
|
+
"]",
|
|
315
|
+
),
|
|
316
|
+
),
|
|
317
|
+
"-",
|
|
318
|
+
),
|
|
319
|
+
seq(
|
|
320
|
+
"<=",
|
|
321
|
+
optional(
|
|
322
|
+
seq(
|
|
323
|
+
"[",
|
|
324
|
+
field("annotations", optional($.annotations)),
|
|
325
|
+
field("attributes", optional($._attributes)),
|
|
326
|
+
"]",
|
|
327
|
+
),
|
|
328
|
+
),
|
|
329
|
+
"=",
|
|
330
|
+
),
|
|
331
|
+
seq(
|
|
332
|
+
"<~",
|
|
333
|
+
optional(
|
|
334
|
+
seq(
|
|
335
|
+
"[",
|
|
336
|
+
field("annotations", optional($.annotations)),
|
|
337
|
+
field("attributes", optional($._attributes)),
|
|
338
|
+
"]",
|
|
339
|
+
),
|
|
340
|
+
),
|
|
341
|
+
"~",
|
|
342
|
+
),
|
|
343
|
+
),
|
|
344
|
+
|
|
345
|
+
bidirectional_arrow: ($) =>
|
|
346
|
+
choice(
|
|
347
|
+
seq(
|
|
348
|
+
"<-",
|
|
349
|
+
optional(
|
|
350
|
+
seq(
|
|
351
|
+
"[",
|
|
352
|
+
field("annotations", optional($.annotations)),
|
|
353
|
+
field("attributes", optional($._attributes)),
|
|
354
|
+
"]",
|
|
355
|
+
),
|
|
356
|
+
),
|
|
357
|
+
"->",
|
|
358
|
+
),
|
|
359
|
+
seq(
|
|
360
|
+
"<=",
|
|
361
|
+
optional(
|
|
362
|
+
seq(
|
|
363
|
+
"[",
|
|
364
|
+
field("annotations", optional($.annotations)),
|
|
365
|
+
field("attributes", optional($._attributes)),
|
|
366
|
+
"]",
|
|
367
|
+
),
|
|
368
|
+
),
|
|
369
|
+
"=>",
|
|
370
|
+
),
|
|
371
|
+
seq(
|
|
372
|
+
"<~",
|
|
373
|
+
optional(
|
|
374
|
+
seq(
|
|
375
|
+
"[",
|
|
376
|
+
field("annotations", optional($.annotations)),
|
|
377
|
+
field("attributes", optional($._attributes)),
|
|
378
|
+
"]",
|
|
379
|
+
),
|
|
380
|
+
),
|
|
381
|
+
"~>",
|
|
382
|
+
),
|
|
383
|
+
),
|
|
384
|
+
|
|
385
|
+
comment: ($) => token(seq("//", /.*/)),
|
|
386
|
+
},
|
|
204
387
|
});
|
|
205
388
|
|
|
389
|
+
function delimit_string(rule, delimiter) {
|
|
390
|
+
return seq(delimiter, field("content", rule), delimiter);
|
|
391
|
+
}
|
|
206
392
|
/**
|
|
207
393
|
* Creates a rule to match one or more of the rules separated by a comma
|
|
208
394
|
*
|
|
@@ -212,7 +398,7 @@ module.exports = grammar({
|
|
|
212
398
|
*
|
|
213
399
|
*/
|
|
214
400
|
function commaSep1(rule) {
|
|
215
|
-
return seq(rule, repeat(seq(
|
|
401
|
+
return seq(rule, repeat(seq(",", rule)));
|
|
216
402
|
}
|
|
217
403
|
|
|
218
404
|
/**
|
|
@@ -227,7 +413,6 @@ function commaSep(rule) {
|
|
|
227
413
|
return optional(commaSep1(rule));
|
|
228
414
|
}
|
|
229
415
|
|
|
230
|
-
|
|
231
416
|
/**
|
|
232
417
|
* Creates a rule to match one or more of the rules separated by a colon
|
|
233
418
|
*
|
|
@@ -237,10 +422,9 @@ function commaSep(rule) {
|
|
|
237
422
|
*
|
|
238
423
|
*/
|
|
239
424
|
function colonSep1(rule) {
|
|
240
|
-
return seq(rule, repeat(seq(
|
|
425
|
+
return seq(rule, repeat(seq(":", rule)));
|
|
241
426
|
}
|
|
242
427
|
|
|
243
|
-
|
|
244
428
|
/**
|
|
245
429
|
* Creates a rule to match one or more of the rules separated by another rule
|
|
246
430
|
*
|
|
@@ -251,4 +435,4 @@ function colonSep1(rule) {
|
|
|
251
435
|
*/
|
|
252
436
|
function ruleSep1(rule, separator) {
|
|
253
437
|
return seq(rule, repeat(seq(separator, rule)));
|
|
254
|
-
}
|
|
438
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gram-data/tree-sitter-gram",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "subject-oriented notation for structured data",
|
|
5
5
|
"homepage": "https://gram-data.github.io",
|
|
6
6
|
"repository": {
|
|
@@ -13,13 +13,18 @@
|
|
|
13
13
|
"install": "node-gyp-build",
|
|
14
14
|
"prestart": "tree-sitter build --wasm",
|
|
15
15
|
"start": "tree-sitter playground",
|
|
16
|
-
"test": "node --test bindings/node/*_test.js"
|
|
16
|
+
"test": "node --test bindings/node/*_test.js",
|
|
17
|
+
"zed:dev": "ZED_REPO_MODE=dev bash scripts/prepare-zed-extension.sh",
|
|
18
|
+
"zed:publish": "ZED_REPO_MODE=pub bash scripts/prepare-zed-extension.sh"
|
|
17
19
|
},
|
|
18
20
|
"keywords": [
|
|
19
21
|
"tree-sitter",
|
|
20
22
|
"parser",
|
|
21
23
|
"gram",
|
|
22
|
-
"json"
|
|
24
|
+
"json",
|
|
25
|
+
"zed",
|
|
26
|
+
"editor",
|
|
27
|
+
"syntax-highlighting"
|
|
23
28
|
],
|
|
24
29
|
"files": [
|
|
25
30
|
"grammar.js",
|
|
@@ -27,7 +32,8 @@
|
|
|
27
32
|
"prebuilds/**",
|
|
28
33
|
"bindings/node/*",
|
|
29
34
|
"queries/*",
|
|
30
|
-
"src/**"
|
|
35
|
+
"src/**",
|
|
36
|
+
"editors/**"
|
|
31
37
|
],
|
|
32
38
|
"author": "",
|
|
33
39
|
"license": "ISC",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|