@gram-data/tree-sitter-gram 0.2.5 → 0.2.7
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 +74 -15
- package/editors/README.md +1 -1
- package/editors/zed/README.md +3 -3
- package/editors/zed/extension.toml +2 -2
- package/editors/zed/languages/gram/highlights.scm +2 -10
- package/grammar.js +7 -18
- package/package.json +1 -1
- 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 +2 -10
- package/src/grammar.json +29 -233
- package/src/node-types.json +15 -47
- package/src/parser.c +1491 -2280
package/src/grammar.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
|
|
3
3
|
"name": "gram",
|
|
4
4
|
"rules": {
|
|
5
|
-
"
|
|
5
|
+
"gram_pattern": {
|
|
6
6
|
"type": "SEQ",
|
|
7
7
|
"members": [
|
|
8
8
|
{
|
|
@@ -25,11 +25,32 @@
|
|
|
25
25
|
"type": "REPEAT",
|
|
26
26
|
"content": {
|
|
27
27
|
"type": "SYMBOL",
|
|
28
|
-
"name": "
|
|
28
|
+
"name": "_top_level_pattern"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
]
|
|
32
32
|
},
|
|
33
|
+
"_top_level_pattern": {
|
|
34
|
+
"type": "CHOICE",
|
|
35
|
+
"members": [
|
|
36
|
+
{
|
|
37
|
+
"type": "SYMBOL",
|
|
38
|
+
"name": "annotated_pattern"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "SYMBOL",
|
|
42
|
+
"name": "subject_pattern"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "SYMBOL",
|
|
46
|
+
"name": "node_pattern"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "SYMBOL",
|
|
50
|
+
"name": "relationship_pattern"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
33
54
|
"annotated_pattern": {
|
|
34
55
|
"type": "SEQ",
|
|
35
56
|
"members": [
|
|
@@ -37,62 +58,29 @@
|
|
|
37
58
|
"type": "FIELD",
|
|
38
59
|
"name": "annotations",
|
|
39
60
|
"content": {
|
|
40
|
-
"type": "
|
|
41
|
-
"
|
|
42
|
-
{
|
|
43
|
-
"type": "SYMBOL",
|
|
44
|
-
"name": "annotations"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"type": "BLANK"
|
|
48
|
-
}
|
|
49
|
-
]
|
|
61
|
+
"type": "SYMBOL",
|
|
62
|
+
"name": "annotations"
|
|
50
63
|
}
|
|
51
64
|
},
|
|
52
65
|
{
|
|
53
66
|
"type": "FIELD",
|
|
54
67
|
"name": "elements",
|
|
55
68
|
"content": {
|
|
56
|
-
"type": "
|
|
69
|
+
"type": "CHOICE",
|
|
57
70
|
"members": [
|
|
58
71
|
{
|
|
59
72
|
"type": "SYMBOL",
|
|
60
|
-
"name": "
|
|
73
|
+
"name": "subject_pattern"
|
|
61
74
|
},
|
|
62
75
|
{
|
|
63
|
-
"type": "
|
|
64
|
-
"
|
|
65
|
-
"type": "SEQ",
|
|
66
|
-
"members": [
|
|
67
|
-
{
|
|
68
|
-
"type": "STRING",
|
|
69
|
-
"value": ","
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"type": "SYMBOL",
|
|
73
|
-
"name": "_annotated_pattern_element"
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
}
|
|
76
|
+
"type": "SYMBOL",
|
|
77
|
+
"name": "_path_pattern"
|
|
77
78
|
}
|
|
78
79
|
]
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
]
|
|
82
83
|
},
|
|
83
|
-
"_annotated_pattern_element": {
|
|
84
|
-
"type": "CHOICE",
|
|
85
|
-
"members": [
|
|
86
|
-
{
|
|
87
|
-
"type": "SYMBOL",
|
|
88
|
-
"name": "subject_pattern"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"type": "SYMBOL",
|
|
92
|
-
"name": "_path_pattern"
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
84
|
"subject_pattern": {
|
|
97
85
|
"type": "SEQ",
|
|
98
86
|
"members": [
|
|
@@ -1219,22 +1207,6 @@
|
|
|
1219
1207
|
"type": "STRING",
|
|
1220
1208
|
"value": "["
|
|
1221
1209
|
},
|
|
1222
|
-
{
|
|
1223
|
-
"type": "FIELD",
|
|
1224
|
-
"name": "annotations",
|
|
1225
|
-
"content": {
|
|
1226
|
-
"type": "CHOICE",
|
|
1227
|
-
"members": [
|
|
1228
|
-
{
|
|
1229
|
-
"type": "SYMBOL",
|
|
1230
|
-
"name": "annotations"
|
|
1231
|
-
},
|
|
1232
|
-
{
|
|
1233
|
-
"type": "BLANK"
|
|
1234
|
-
}
|
|
1235
|
-
]
|
|
1236
|
-
}
|
|
1237
|
-
},
|
|
1238
1210
|
{
|
|
1239
1211
|
"type": "FIELD",
|
|
1240
1212
|
"name": "subject",
|
|
@@ -1285,22 +1257,6 @@
|
|
|
1285
1257
|
"type": "STRING",
|
|
1286
1258
|
"value": "["
|
|
1287
1259
|
},
|
|
1288
|
-
{
|
|
1289
|
-
"type": "FIELD",
|
|
1290
|
-
"name": "annotations",
|
|
1291
|
-
"content": {
|
|
1292
|
-
"type": "CHOICE",
|
|
1293
|
-
"members": [
|
|
1294
|
-
{
|
|
1295
|
-
"type": "SYMBOL",
|
|
1296
|
-
"name": "annotations"
|
|
1297
|
-
},
|
|
1298
|
-
{
|
|
1299
|
-
"type": "BLANK"
|
|
1300
|
-
}
|
|
1301
|
-
]
|
|
1302
|
-
}
|
|
1303
|
-
},
|
|
1304
1260
|
{
|
|
1305
1261
|
"type": "FIELD",
|
|
1306
1262
|
"name": "subject",
|
|
@@ -1351,22 +1307,6 @@
|
|
|
1351
1307
|
"type": "STRING",
|
|
1352
1308
|
"value": "["
|
|
1353
1309
|
},
|
|
1354
|
-
{
|
|
1355
|
-
"type": "FIELD",
|
|
1356
|
-
"name": "annotations",
|
|
1357
|
-
"content": {
|
|
1358
|
-
"type": "CHOICE",
|
|
1359
|
-
"members": [
|
|
1360
|
-
{
|
|
1361
|
-
"type": "SYMBOL",
|
|
1362
|
-
"name": "annotations"
|
|
1363
|
-
},
|
|
1364
|
-
{
|
|
1365
|
-
"type": "BLANK"
|
|
1366
|
-
}
|
|
1367
|
-
]
|
|
1368
|
-
}
|
|
1369
|
-
},
|
|
1370
1310
|
{
|
|
1371
1311
|
"type": "FIELD",
|
|
1372
1312
|
"name": "subject",
|
|
@@ -1422,22 +1362,6 @@
|
|
|
1422
1362
|
"type": "STRING",
|
|
1423
1363
|
"value": "["
|
|
1424
1364
|
},
|
|
1425
|
-
{
|
|
1426
|
-
"type": "FIELD",
|
|
1427
|
-
"name": "annotations",
|
|
1428
|
-
"content": {
|
|
1429
|
-
"type": "CHOICE",
|
|
1430
|
-
"members": [
|
|
1431
|
-
{
|
|
1432
|
-
"type": "SYMBOL",
|
|
1433
|
-
"name": "annotations"
|
|
1434
|
-
},
|
|
1435
|
-
{
|
|
1436
|
-
"type": "BLANK"
|
|
1437
|
-
}
|
|
1438
|
-
]
|
|
1439
|
-
}
|
|
1440
|
-
},
|
|
1441
1365
|
{
|
|
1442
1366
|
"type": "FIELD",
|
|
1443
1367
|
"name": "subject",
|
|
@@ -1488,22 +1412,6 @@
|
|
|
1488
1412
|
"type": "STRING",
|
|
1489
1413
|
"value": "["
|
|
1490
1414
|
},
|
|
1491
|
-
{
|
|
1492
|
-
"type": "FIELD",
|
|
1493
|
-
"name": "annotations",
|
|
1494
|
-
"content": {
|
|
1495
|
-
"type": "CHOICE",
|
|
1496
|
-
"members": [
|
|
1497
|
-
{
|
|
1498
|
-
"type": "SYMBOL",
|
|
1499
|
-
"name": "annotations"
|
|
1500
|
-
},
|
|
1501
|
-
{
|
|
1502
|
-
"type": "BLANK"
|
|
1503
|
-
}
|
|
1504
|
-
]
|
|
1505
|
-
}
|
|
1506
|
-
},
|
|
1507
1415
|
{
|
|
1508
1416
|
"type": "FIELD",
|
|
1509
1417
|
"name": "subject",
|
|
@@ -1554,22 +1462,6 @@
|
|
|
1554
1462
|
"type": "STRING",
|
|
1555
1463
|
"value": "["
|
|
1556
1464
|
},
|
|
1557
|
-
{
|
|
1558
|
-
"type": "FIELD",
|
|
1559
|
-
"name": "annotations",
|
|
1560
|
-
"content": {
|
|
1561
|
-
"type": "CHOICE",
|
|
1562
|
-
"members": [
|
|
1563
|
-
{
|
|
1564
|
-
"type": "SYMBOL",
|
|
1565
|
-
"name": "annotations"
|
|
1566
|
-
},
|
|
1567
|
-
{
|
|
1568
|
-
"type": "BLANK"
|
|
1569
|
-
}
|
|
1570
|
-
]
|
|
1571
|
-
}
|
|
1572
|
-
},
|
|
1573
1465
|
{
|
|
1574
1466
|
"type": "FIELD",
|
|
1575
1467
|
"name": "subject",
|
|
@@ -1625,22 +1517,6 @@
|
|
|
1625
1517
|
"type": "STRING",
|
|
1626
1518
|
"value": "["
|
|
1627
1519
|
},
|
|
1628
|
-
{
|
|
1629
|
-
"type": "FIELD",
|
|
1630
|
-
"name": "annotations",
|
|
1631
|
-
"content": {
|
|
1632
|
-
"type": "CHOICE",
|
|
1633
|
-
"members": [
|
|
1634
|
-
{
|
|
1635
|
-
"type": "SYMBOL",
|
|
1636
|
-
"name": "annotations"
|
|
1637
|
-
},
|
|
1638
|
-
{
|
|
1639
|
-
"type": "BLANK"
|
|
1640
|
-
}
|
|
1641
|
-
]
|
|
1642
|
-
}
|
|
1643
|
-
},
|
|
1644
1520
|
{
|
|
1645
1521
|
"type": "FIELD",
|
|
1646
1522
|
"name": "subject",
|
|
@@ -1691,22 +1567,6 @@
|
|
|
1691
1567
|
"type": "STRING",
|
|
1692
1568
|
"value": "["
|
|
1693
1569
|
},
|
|
1694
|
-
{
|
|
1695
|
-
"type": "FIELD",
|
|
1696
|
-
"name": "annotations",
|
|
1697
|
-
"content": {
|
|
1698
|
-
"type": "CHOICE",
|
|
1699
|
-
"members": [
|
|
1700
|
-
{
|
|
1701
|
-
"type": "SYMBOL",
|
|
1702
|
-
"name": "annotations"
|
|
1703
|
-
},
|
|
1704
|
-
{
|
|
1705
|
-
"type": "BLANK"
|
|
1706
|
-
}
|
|
1707
|
-
]
|
|
1708
|
-
}
|
|
1709
|
-
},
|
|
1710
1570
|
{
|
|
1711
1571
|
"type": "FIELD",
|
|
1712
1572
|
"name": "subject",
|
|
@@ -1757,22 +1617,6 @@
|
|
|
1757
1617
|
"type": "STRING",
|
|
1758
1618
|
"value": "["
|
|
1759
1619
|
},
|
|
1760
|
-
{
|
|
1761
|
-
"type": "FIELD",
|
|
1762
|
-
"name": "annotations",
|
|
1763
|
-
"content": {
|
|
1764
|
-
"type": "CHOICE",
|
|
1765
|
-
"members": [
|
|
1766
|
-
{
|
|
1767
|
-
"type": "SYMBOL",
|
|
1768
|
-
"name": "annotations"
|
|
1769
|
-
},
|
|
1770
|
-
{
|
|
1771
|
-
"type": "BLANK"
|
|
1772
|
-
}
|
|
1773
|
-
]
|
|
1774
|
-
}
|
|
1775
|
-
},
|
|
1776
1620
|
{
|
|
1777
1621
|
"type": "FIELD",
|
|
1778
1622
|
"name": "subject",
|
|
@@ -1828,22 +1672,6 @@
|
|
|
1828
1672
|
"type": "STRING",
|
|
1829
1673
|
"value": "["
|
|
1830
1674
|
},
|
|
1831
|
-
{
|
|
1832
|
-
"type": "FIELD",
|
|
1833
|
-
"name": "annotations",
|
|
1834
|
-
"content": {
|
|
1835
|
-
"type": "CHOICE",
|
|
1836
|
-
"members": [
|
|
1837
|
-
{
|
|
1838
|
-
"type": "SYMBOL",
|
|
1839
|
-
"name": "annotations"
|
|
1840
|
-
},
|
|
1841
|
-
{
|
|
1842
|
-
"type": "BLANK"
|
|
1843
|
-
}
|
|
1844
|
-
]
|
|
1845
|
-
}
|
|
1846
|
-
},
|
|
1847
1675
|
{
|
|
1848
1676
|
"type": "FIELD",
|
|
1849
1677
|
"name": "subject",
|
|
@@ -1894,22 +1722,6 @@
|
|
|
1894
1722
|
"type": "STRING",
|
|
1895
1723
|
"value": "["
|
|
1896
1724
|
},
|
|
1897
|
-
{
|
|
1898
|
-
"type": "FIELD",
|
|
1899
|
-
"name": "annotations",
|
|
1900
|
-
"content": {
|
|
1901
|
-
"type": "CHOICE",
|
|
1902
|
-
"members": [
|
|
1903
|
-
{
|
|
1904
|
-
"type": "SYMBOL",
|
|
1905
|
-
"name": "annotations"
|
|
1906
|
-
},
|
|
1907
|
-
{
|
|
1908
|
-
"type": "BLANK"
|
|
1909
|
-
}
|
|
1910
|
-
]
|
|
1911
|
-
}
|
|
1912
|
-
},
|
|
1913
1725
|
{
|
|
1914
1726
|
"type": "FIELD",
|
|
1915
1727
|
"name": "subject",
|
|
@@ -1960,22 +1772,6 @@
|
|
|
1960
1772
|
"type": "STRING",
|
|
1961
1773
|
"value": "["
|
|
1962
1774
|
},
|
|
1963
|
-
{
|
|
1964
|
-
"type": "FIELD",
|
|
1965
|
-
"name": "annotations",
|
|
1966
|
-
"content": {
|
|
1967
|
-
"type": "CHOICE",
|
|
1968
|
-
"members": [
|
|
1969
|
-
{
|
|
1970
|
-
"type": "SYMBOL",
|
|
1971
|
-
"name": "annotations"
|
|
1972
|
-
},
|
|
1973
|
-
{
|
|
1974
|
-
"type": "BLANK"
|
|
1975
|
-
}
|
|
1976
|
-
]
|
|
1977
|
-
}
|
|
1978
|
-
},
|
|
1979
1775
|
{
|
|
1980
1776
|
"type": "FIELD",
|
|
1981
1777
|
"name": "subject",
|
package/src/node-types.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"fields": {
|
|
6
6
|
"annotations": {
|
|
7
7
|
"multiple": false,
|
|
8
|
-
"required":
|
|
8
|
+
"required": true,
|
|
9
9
|
"types": [
|
|
10
10
|
{
|
|
11
11
|
"type": "annotations",
|
|
@@ -14,13 +14,9 @@
|
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
16
|
"elements": {
|
|
17
|
-
"multiple":
|
|
17
|
+
"multiple": false,
|
|
18
18
|
"required": true,
|
|
19
19
|
"types": [
|
|
20
|
-
{
|
|
21
|
-
"type": ",",
|
|
22
|
-
"named": false
|
|
23
|
-
},
|
|
24
20
|
{
|
|
25
21
|
"type": "node_pattern",
|
|
26
22
|
"named": true
|
|
@@ -177,16 +173,6 @@
|
|
|
177
173
|
"type": "bidirectional_arrow",
|
|
178
174
|
"named": true,
|
|
179
175
|
"fields": {
|
|
180
|
-
"annotations": {
|
|
181
|
-
"multiple": false,
|
|
182
|
-
"required": false,
|
|
183
|
-
"types": [
|
|
184
|
-
{
|
|
185
|
-
"type": "annotations",
|
|
186
|
-
"named": true
|
|
187
|
-
}
|
|
188
|
-
]
|
|
189
|
-
},
|
|
190
176
|
"identifier": {
|
|
191
177
|
"multiple": false,
|
|
192
178
|
"required": false,
|
|
@@ -259,7 +245,7 @@
|
|
|
259
245
|
"fields": {}
|
|
260
246
|
},
|
|
261
247
|
{
|
|
262
|
-
"type": "
|
|
248
|
+
"type": "gram_pattern",
|
|
263
249
|
"named": true,
|
|
264
250
|
"root": true,
|
|
265
251
|
"fields": {
|
|
@@ -281,6 +267,18 @@
|
|
|
281
267
|
{
|
|
282
268
|
"type": "annotated_pattern",
|
|
283
269
|
"named": true
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"type": "node_pattern",
|
|
273
|
+
"named": true
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"type": "relationship_pattern",
|
|
277
|
+
"named": true
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"type": "subject_pattern",
|
|
281
|
+
"named": true
|
|
284
282
|
}
|
|
285
283
|
]
|
|
286
284
|
}
|
|
@@ -304,16 +302,6 @@
|
|
|
304
302
|
"type": "left_arrow",
|
|
305
303
|
"named": true,
|
|
306
304
|
"fields": {
|
|
307
|
-
"annotations": {
|
|
308
|
-
"multiple": false,
|
|
309
|
-
"required": false,
|
|
310
|
-
"types": [
|
|
311
|
-
{
|
|
312
|
-
"type": "annotations",
|
|
313
|
-
"named": true
|
|
314
|
-
}
|
|
315
|
-
]
|
|
316
|
-
},
|
|
317
305
|
"identifier": {
|
|
318
306
|
"multiple": false,
|
|
319
307
|
"required": false,
|
|
@@ -766,16 +754,6 @@
|
|
|
766
754
|
"type": "right_arrow",
|
|
767
755
|
"named": true,
|
|
768
756
|
"fields": {
|
|
769
|
-
"annotations": {
|
|
770
|
-
"multiple": false,
|
|
771
|
-
"required": false,
|
|
772
|
-
"types": [
|
|
773
|
-
{
|
|
774
|
-
"type": "annotations",
|
|
775
|
-
"named": true
|
|
776
|
-
}
|
|
777
|
-
]
|
|
778
|
-
},
|
|
779
757
|
"identifier": {
|
|
780
758
|
"multiple": false,
|
|
781
759
|
"required": false,
|
|
@@ -999,16 +977,6 @@
|
|
|
999
977
|
"type": "undirected_arrow",
|
|
1000
978
|
"named": true,
|
|
1001
979
|
"fields": {
|
|
1002
|
-
"annotations": {
|
|
1003
|
-
"multiple": false,
|
|
1004
|
-
"required": false,
|
|
1005
|
-
"types": [
|
|
1006
|
-
{
|
|
1007
|
-
"type": "annotations",
|
|
1008
|
-
"named": true
|
|
1009
|
-
}
|
|
1010
|
-
]
|
|
1011
|
-
},
|
|
1012
980
|
"identifier": {
|
|
1013
981
|
"multiple": false,
|
|
1014
982
|
"required": false,
|