@gram-data/tree-sitter-gram 0.1.7 → 0.1.9

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/src/grammar.json CHANGED
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
2
3
  "name": "gram",
3
4
  "rules": {
4
5
  "gram": {
@@ -30,6 +31,31 @@
30
31
  ]
31
32
  },
32
33
  "pattern": {
34
+ "type": "SEQ",
35
+ "members": [
36
+ {
37
+ "type": "SYMBOL",
38
+ "name": "pattern_element"
39
+ },
40
+ {
41
+ "type": "REPEAT",
42
+ "content": {
43
+ "type": "SEQ",
44
+ "members": [
45
+ {
46
+ "type": "STRING",
47
+ "value": ","
48
+ },
49
+ {
50
+ "type": "SYMBOL",
51
+ "name": "pattern_element"
52
+ }
53
+ ]
54
+ }
55
+ }
56
+ ]
57
+ },
58
+ "pattern_element": {
33
59
  "type": "SEQ",
34
60
  "members": [
35
61
  {
@@ -48,45 +74,24 @@
48
74
  ]
49
75
  },
50
76
  {
51
- "type": "SEQ",
77
+ "type": "CHOICE",
52
78
  "members": [
53
79
  {
54
80
  "type": "SYMBOL",
55
- "name": "_patternComponent"
81
+ "name": "subject"
56
82
  },
57
83
  {
58
- "type": "REPEAT",
59
- "content": {
60
- "type": "SEQ",
61
- "members": [
62
- {
63
- "type": "STRING",
64
- "value": ","
65
- },
66
- {
67
- "type": "SYMBOL",
68
- "name": "_patternComponent"
69
- }
70
- ]
71
- }
84
+ "type": "SYMBOL",
85
+ "name": "_path"
86
+ },
87
+ {
88
+ "type": "SYMBOL",
89
+ "name": "_reference"
72
90
  }
73
91
  ]
74
92
  }
75
93
  ]
76
94
  },
77
- "_patternComponent": {
78
- "type": "CHOICE",
79
- "members": [
80
- {
81
- "type": "SYMBOL",
82
- "name": "subject"
83
- },
84
- {
85
- "type": "SYMBOL",
86
- "name": "_path"
87
- }
88
- ]
89
- },
90
95
  "subject": {
91
96
  "type": "SEQ",
92
97
  "members": [
@@ -98,8 +103,12 @@
98
103
  "type": "CHOICE",
99
104
  "members": [
100
105
  {
101
- "type": "SYMBOL",
102
- "name": "_attributes"
106
+ "type": "FIELD",
107
+ "name": "attributes",
108
+ "content": {
109
+ "type": "SYMBOL",
110
+ "name": "_attributes"
111
+ }
103
112
  },
104
113
  {
105
114
  "type": "BLANK"
@@ -129,41 +138,37 @@
129
138
  ]
130
139
  },
131
140
  "annotation": {
132
- "type": "PREC",
133
- "value": 9999,
134
- "content": {
135
- "type": "SEQ",
136
- "members": [
137
- {
138
- "type": "STRING",
139
- "value": "@"
140
- },
141
- {
142
- "type": "FIELD",
143
- "name": "key",
144
- "content": {
145
- "type": "SYMBOL",
146
- "name": "symbol"
147
- }
148
- },
149
- {
150
- "type": "STRING",
151
- "value": "("
152
- },
153
- {
154
- "type": "FIELD",
155
- "name": "value",
156
- "content": {
157
- "type": "SYMBOL",
158
- "name": "_value"
159
- }
160
- },
161
- {
162
- "type": "STRING",
163
- "value": ")"
141
+ "type": "SEQ",
142
+ "members": [
143
+ {
144
+ "type": "STRING",
145
+ "value": "@"
146
+ },
147
+ {
148
+ "type": "FIELD",
149
+ "name": "key",
150
+ "content": {
151
+ "type": "SYMBOL",
152
+ "name": "symbol"
164
153
  }
165
- ]
166
- }
154
+ },
155
+ {
156
+ "type": "STRING",
157
+ "value": "("
158
+ },
159
+ {
160
+ "type": "FIELD",
161
+ "name": "value",
162
+ "content": {
163
+ "type": "SYMBOL",
164
+ "name": "_value"
165
+ }
166
+ },
167
+ {
168
+ "type": "STRING",
169
+ "value": ")"
170
+ }
171
+ ]
167
172
  },
168
173
  "_path": {
169
174
  "type": "CHOICE",
@@ -182,8 +187,11 @@
182
187
  "type": "SEQ",
183
188
  "members": [
184
189
  {
185
- "type": "STRING",
186
- "value": "("
190
+ "type": "TOKEN",
191
+ "content": {
192
+ "type": "STRING",
193
+ "value": "("
194
+ }
187
195
  },
188
196
  {
189
197
  "type": "CHOICE",
@@ -198,8 +206,11 @@
198
206
  ]
199
207
  },
200
208
  {
201
- "type": "STRING",
202
- "value": ")"
209
+ "type": "TOKEN",
210
+ "content": {
211
+ "type": "STRING",
212
+ "value": ")"
213
+ }
203
214
  }
204
215
  ]
205
216
  },
@@ -233,189 +244,18 @@
233
244
  ]
234
245
  },
235
246
  "_association": {
236
- "type": "CHOICE",
237
- "members": [
238
- {
239
- "type": "SYMBOL",
240
- "name": "membership"
241
- },
242
- {
243
- "type": "SYMBOL",
244
- "name": "ordering"
245
- }
246
- ]
247
- },
248
- "membership": {
249
247
  "type": "SEQ",
250
248
  "members": [
251
249
  {
252
- "type": "STRING",
253
- "value": "|"
254
- },
255
- {
256
- "type": "CHOICE",
257
- "members": [
258
- {
259
- "type": "SEQ",
260
- "members": [
261
- {
262
- "type": "CHOICE",
263
- "members": [
264
- {
265
- "type": "FIELD",
266
- "name": "labels",
267
- "content": {
268
- "type": "SYMBOL",
269
- "name": "labels"
270
- }
271
- },
272
- {
273
- "type": "BLANK"
274
- }
275
- ]
276
- },
277
- {
278
- "type": "CHOICE",
279
- "members": [
280
- {
281
- "type": "FIELD",
282
- "name": "record",
283
- "content": {
284
- "type": "SYMBOL",
285
- "name": "record"
286
- }
287
- },
288
- {
289
- "type": "BLANK"
290
- }
291
- ]
292
- },
293
- {
294
- "type": "STRING",
295
- "value": "|"
296
- }
297
- ]
298
- },
299
- {
300
- "type": "BLANK"
301
- }
302
- ]
303
- },
304
- {
305
- "type": "SEQ",
306
- "members": [
307
- {
308
- "type": "SYMBOL",
309
- "name": "member"
310
- },
311
- {
312
- "type": "REPEAT",
313
- "content": {
314
- "type": "SEQ",
315
- "members": [
316
- {
317
- "type": "STRING",
318
- "value": ","
319
- },
320
- {
321
- "type": "SYMBOL",
322
- "name": "member"
323
- }
324
- ]
325
- }
326
- }
327
- ]
328
- }
329
- ]
330
- },
331
- "ordering": {
332
- "type": "SEQ",
333
- "members": [
334
- {
335
- "type": "STRING",
336
- "value": "-"
337
- },
338
- {
339
- "type": "CHOICE",
340
- "members": [
341
- {
342
- "type": "SEQ",
343
- "members": [
344
- {
345
- "type": "STRING",
346
- "value": "["
347
- },
348
- {
349
- "type": "CHOICE",
350
- "members": [
351
- {
352
- "type": "FIELD",
353
- "name": "labels",
354
- "content": {
355
- "type": "SYMBOL",
356
- "name": "labels"
357
- }
358
- },
359
- {
360
- "type": "BLANK"
361
- }
362
- ]
363
- },
364
- {
365
- "type": "CHOICE",
366
- "members": [
367
- {
368
- "type": "FIELD",
369
- "name": "record",
370
- "content": {
371
- "type": "SYMBOL",
372
- "name": "record"
373
- }
374
- },
375
- {
376
- "type": "BLANK"
377
- }
378
- ]
379
- },
380
- {
381
- "type": "STRING",
382
- "value": "]-"
383
- }
384
- ]
385
- },
386
- {
387
- "type": "BLANK"
388
- }
389
- ]
390
- },
391
- {
392
- "type": "STRING",
393
- "value": ">"
250
+ "type": "TOKEN",
251
+ "content": {
252
+ "type": "STRING",
253
+ "value": "|"
254
+ }
394
255
  },
395
256
  {
396
- "type": "SEQ",
397
- "members": [
398
- {
399
- "type": "SYMBOL",
400
- "name": "member"
401
- },
402
- {
403
- "type": "REPEAT",
404
- "content": {
405
- "type": "SEQ",
406
- "members": [
407
- {
408
- "type": "STRING",
409
- "value": ","
410
- },
411
- {
412
- "type": "SYMBOL",
413
- "name": "member"
414
- }
415
- ]
416
- }
417
- }
418
- ]
257
+ "type": "SYMBOL",
258
+ "name": "pattern"
419
259
  }
420
260
  ]
421
261
  },
@@ -423,39 +263,6 @@
423
263
  "type": "SYMBOL",
424
264
  "name": "_value"
425
265
  },
426
- "member": {
427
- "type": "SEQ",
428
- "members": [
429
- {
430
- "type": "CHOICE",
431
- "members": [
432
- {
433
- "type": "REPEAT",
434
- "content": {
435
- "type": "SYMBOL",
436
- "name": "annotation"
437
- }
438
- },
439
- {
440
- "type": "BLANK"
441
- }
442
- ]
443
- },
444
- {
445
- "type": "CHOICE",
446
- "members": [
447
- {
448
- "type": "SYMBOL",
449
- "name": "_reference"
450
- },
451
- {
452
- "type": "SYMBOL",
453
- "name": "_patternComponent"
454
- }
455
- ]
456
- }
457
- ]
458
- },
459
266
  "_attributes": {
460
267
  "type": "CHOICE",
461
268
  "members": [
@@ -586,20 +393,28 @@
586
393
  "type": "CHOICE",
587
394
  "members": [
588
395
  {
589
- "type": "SYMBOL",
590
- "name": "symbol"
396
+ "type": "PREC_RIGHT",
397
+ "value": 2,
398
+ "content": {
399
+ "type": "SYMBOL",
400
+ "name": "range"
401
+ }
591
402
  },
592
403
  {
593
- "type": "SYMBOL",
594
- "name": "_numeric_literal"
404
+ "type": "PREC_RIGHT",
405
+ "value": 1,
406
+ "content": {
407
+ "type": "SYMBOL",
408
+ "name": "_numeric_literal"
409
+ }
595
410
  },
596
411
  {
597
412
  "type": "SYMBOL",
598
- "name": "_string_literal"
413
+ "name": "symbol"
599
414
  },
600
415
  {
601
416
  "type": "SYMBOL",
602
- "name": "range"
417
+ "name": "_string_literal"
603
418
  },
604
419
  {
605
420
  "type": "SYMBOL",
@@ -655,13 +470,6 @@
655
470
  "type": "STRING",
656
471
  "value": "::"
657
472
  }
658
- },
659
- {
660
- "type": "TOKEN",
661
- "content": {
662
- "type": "STRING",
663
- "value": "@"
664
- }
665
473
  }
666
474
  ]
667
475
  },
@@ -719,7 +527,7 @@
719
527
  "name": "key",
720
528
  "content": {
721
529
  "type": "SYMBOL",
722
- "name": "symbol"
530
+ "name": "_key"
723
531
  }
724
532
  },
725
533
  {
@@ -773,11 +581,24 @@
773
581
  }
774
582
  ]
775
583
  },
584
+ "_key": {
585
+ "type": "CHOICE",
586
+ "members": [
587
+ {
588
+ "type": "SYMBOL",
589
+ "name": "symbol"
590
+ },
591
+ {
592
+ "type": "SYMBOL",
593
+ "name": "_string_literal"
594
+ }
595
+ ]
596
+ },
776
597
  "symbol": {
777
598
  "type": "TOKEN",
778
599
  "content": {
779
600
  "type": "PATTERN",
780
- "value": "[a-zA-Z_][0-9a-zA-Z_.\\-]*"
601
+ "value": "[a-zA-Z_][0-9a-zA-Z_.\\-@]*"
781
602
  }
782
603
  },
783
604
  "greek": {
@@ -975,7 +796,7 @@
975
796
  "type": "TOKEN",
976
797
  "content": {
977
798
  "type": "PATTERN",
978
- "value": "[a-zA-Z][0-9a-zA-Z_.@]*`[^`\\n]*`"
799
+ "value": "[a-zA-Z@][0-9a-zA-Z_.@]*`[^`\\n]*`"
979
800
  }
980
801
  },
981
802
  "fenced_string": {