tree-sitter-aspx 0.1.3 → 1.0.0

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
@@ -43,6 +43,10 @@
43
43
  "content": {
44
44
  "type": "CHOICE",
45
45
  "members": [
46
+ {
47
+ "type": "SYMBOL",
48
+ "name": "directive"
49
+ },
46
50
  {
47
51
  "type": "SYMBOL",
48
52
  "name": "server_comment"
@@ -52,19 +56,37 @@
52
56
  "name": "script_element"
53
57
  },
54
58
  {
55
- "type": "ALIAS",
56
- "content": {
57
- "type": "SYMBOL",
58
- "name": "handler_text"
59
- },
60
- "named": true,
61
- "value": "handler_code"
59
+ "type": "SYMBOL",
60
+ "name": "handler_code"
62
61
  }
63
62
  ]
64
63
  }
65
64
  }
66
65
  ]
67
66
  },
67
+ "handler_code": {
68
+ "type": "CHOICE",
69
+ "members": [
70
+ {
71
+ "type": "ALIAS",
72
+ "content": {
73
+ "type": "SYMBOL",
74
+ "name": "_handler_csharp"
75
+ },
76
+ "named": true,
77
+ "value": "c_sharp_code"
78
+ },
79
+ {
80
+ "type": "ALIAS",
81
+ "content": {
82
+ "type": "SYMBOL",
83
+ "name": "_handler_vb"
84
+ },
85
+ "named": true,
86
+ "value": "vb_code"
87
+ }
88
+ ]
89
+ },
68
90
  "_top": {
69
91
  "type": "CHOICE",
70
92
  "members": [
@@ -121,6 +143,23 @@
121
143
  "type": "SYMBOL",
122
144
  "name": "doctype"
123
145
  },
146
+ {
147
+ "type": "SYMBOL",
148
+ "name": "cdata_section"
149
+ },
150
+ {
151
+ "type": "SYMBOL",
152
+ "name": "processing_instruction"
153
+ },
154
+ {
155
+ "type": "ALIAS",
156
+ "content": {
157
+ "type": "SYMBOL",
158
+ "name": "stray_end_tag"
159
+ },
160
+ "named": true,
161
+ "value": "end_tag"
162
+ },
124
163
  {
125
164
  "type": "SYMBOL",
126
165
  "name": "text"
@@ -146,7 +185,7 @@
146
185
  "type": "REPEAT",
147
186
  "content": {
148
187
  "type": "SYMBOL",
149
- "name": "_attribute"
188
+ "name": "_directive_attribute"
150
189
  }
151
190
  },
152
191
  {
@@ -188,7 +227,7 @@
188
227
  "type": "REPEAT",
189
228
  "content": {
190
229
  "type": "SYMBOL",
191
- "name": "_attribute"
230
+ "name": "_directive_attribute"
192
231
  }
193
232
  },
194
233
  {
@@ -206,38 +245,26 @@
206
245
  "name": "_name"
207
246
  },
208
247
  "web_handler_name": {
209
- "type": "CHOICE",
210
- "members": [
211
- {
212
- "type": "STRING",
213
- "value": "WebHandler"
214
- },
215
- {
216
- "type": "STRING",
217
- "value": "webhandler"
218
- },
219
- {
220
- "type": "STRING",
221
- "value": "WEBHANDLER"
248
+ "type": "TOKEN",
249
+ "content": {
250
+ "type": "PREC",
251
+ "value": 1,
252
+ "content": {
253
+ "type": "PATTERN",
254
+ "value": "[Ww][Ee][Bb][Hh][Aa][Nn][Dd][Ll][Ee][Rr]"
222
255
  }
223
- ]
256
+ }
224
257
  },
225
258
  "web_service_name": {
226
- "type": "CHOICE",
227
- "members": [
228
- {
229
- "type": "STRING",
230
- "value": "WebService"
231
- },
232
- {
233
- "type": "STRING",
234
- "value": "webservice"
235
- },
236
- {
237
- "type": "STRING",
238
- "value": "WEBSERVICE"
259
+ "type": "TOKEN",
260
+ "content": {
261
+ "type": "PREC",
262
+ "value": 1,
263
+ "content": {
264
+ "type": "PATTERN",
265
+ "value": "[Ww][Ee][Bb][Ss][Ee][Rr][Vv][Ii][Cc][Ee]"
239
266
  }
240
- ]
267
+ }
241
268
  },
242
269
  "language_attribute": {
243
270
  "type": "SEQ",
@@ -270,12 +297,20 @@
270
297
  "value": "\""
271
298
  },
272
299
  {
273
- "type": "FIELD",
274
- "name": "value",
275
- "content": {
276
- "type": "SYMBOL",
277
- "name": "_language_value"
278
- }
300
+ "type": "CHOICE",
301
+ "members": [
302
+ {
303
+ "type": "FIELD",
304
+ "name": "value",
305
+ "content": {
306
+ "type": "SYMBOL",
307
+ "name": "_language_value"
308
+ }
309
+ },
310
+ {
311
+ "type": "BLANK"
312
+ }
313
+ ]
279
314
  },
280
315
  {
281
316
  "type": "STRING",
@@ -291,18 +326,34 @@
291
326
  "value": "'"
292
327
  },
293
328
  {
294
- "type": "FIELD",
295
- "name": "value",
296
- "content": {
297
- "type": "SYMBOL",
298
- "name": "_language_value"
299
- }
329
+ "type": "CHOICE",
330
+ "members": [
331
+ {
332
+ "type": "FIELD",
333
+ "name": "value",
334
+ "content": {
335
+ "type": "SYMBOL",
336
+ "name": "_language_value"
337
+ }
338
+ },
339
+ {
340
+ "type": "BLANK"
341
+ }
342
+ ]
300
343
  },
301
344
  {
302
345
  "type": "STRING",
303
346
  "value": "'"
304
347
  }
305
348
  ]
349
+ },
350
+ {
351
+ "type": "FIELD",
352
+ "name": "value",
353
+ "content": {
354
+ "type": "SYMBOL",
355
+ "name": "_language_value"
356
+ }
306
357
  }
307
358
  ]
308
359
  }
@@ -341,7 +392,7 @@
341
392
  "named": true,
342
393
  "value": "language_value"
343
394
  },
344
- "_attribute": {
395
+ "_directive_attribute": {
345
396
  "type": "CHOICE",
346
397
  "members": [
347
398
  {
@@ -559,7 +610,15 @@
559
610
  ]
560
611
  },
561
612
  {
562
- "type": "STRING",
613
+ "type": "ALIAS",
614
+ "content": {
615
+ "type": "TOKEN",
616
+ "content": {
617
+ "type": "PATTERN",
618
+ "value": "-*--%>"
619
+ }
620
+ },
621
+ "named": false,
563
622
  "value": "--%>"
564
623
  }
565
624
  ]
@@ -824,35 +883,42 @@
824
883
  "value": "start_tag"
825
884
  },
826
885
  {
827
- "type": "CHOICE",
828
- "members": [
829
- {
830
- "type": "CHOICE",
831
- "members": [
832
- {
833
- "type": "ALIAS",
834
- "content": {
835
- "type": "SYMBOL",
836
- "name": "_script_csharp"
837
- },
838
- "named": true,
839
- "value": "c_sharp_code"
886
+ "type": "REPEAT",
887
+ "content": {
888
+ "type": "CHOICE",
889
+ "members": [
890
+ {
891
+ "type": "ALIAS",
892
+ "content": {
893
+ "type": "SYMBOL",
894
+ "name": "_script_csharp"
840
895
  },
841
- {
842
- "type": "ALIAS",
843
- "content": {
844
- "type": "SYMBOL",
845
- "name": "_script_vb"
846
- },
847
- "named": true,
848
- "value": "vb_code"
849
- }
850
- ]
851
- },
852
- {
853
- "type": "BLANK"
854
- }
855
- ]
896
+ "named": true,
897
+ "value": "c_sharp_code"
898
+ },
899
+ {
900
+ "type": "ALIAS",
901
+ "content": {
902
+ "type": "SYMBOL",
903
+ "name": "_script_vb"
904
+ },
905
+ "named": true,
906
+ "value": "vb_code"
907
+ },
908
+ {
909
+ "type": "SYMBOL",
910
+ "name": "_nugget"
911
+ },
912
+ {
913
+ "type": "SYMBOL",
914
+ "name": "server_comment"
915
+ },
916
+ {
917
+ "type": "SYMBOL",
918
+ "name": "directive"
919
+ }
920
+ ]
921
+ }
856
922
  },
857
923
  {
858
924
  "type": "ALIAS",
@@ -885,11 +951,15 @@
885
951
  "value": "tag_name"
886
952
  }
887
953
  },
954
+ {
955
+ "type": "SYMBOL",
956
+ "name": "_script_tag_probe"
957
+ },
888
958
  {
889
959
  "type": "REPEAT",
890
960
  "content": {
891
961
  "type": "SYMBOL",
892
- "name": "_attribute"
962
+ "name": "_tag_item"
893
963
  }
894
964
  },
895
965
  {
@@ -948,16 +1018,28 @@
948
1018
  "value": "start_tag"
949
1019
  },
950
1020
  {
951
- "type": "CHOICE",
952
- "members": [
953
- {
954
- "type": "SYMBOL",
955
- "name": "style_text"
956
- },
957
- {
958
- "type": "BLANK"
959
- }
960
- ]
1021
+ "type": "REPEAT",
1022
+ "content": {
1023
+ "type": "CHOICE",
1024
+ "members": [
1025
+ {
1026
+ "type": "SYMBOL",
1027
+ "name": "style_text"
1028
+ },
1029
+ {
1030
+ "type": "SYMBOL",
1031
+ "name": "_nugget"
1032
+ },
1033
+ {
1034
+ "type": "SYMBOL",
1035
+ "name": "server_comment"
1036
+ },
1037
+ {
1038
+ "type": "SYMBOL",
1039
+ "name": "directive"
1040
+ }
1041
+ ]
1042
+ }
961
1043
  },
962
1044
  {
963
1045
  "type": "ALIAS",
@@ -994,7 +1076,7 @@
994
1076
  "type": "REPEAT",
995
1077
  "content": {
996
1078
  "type": "SYMBOL",
997
- "name": "_attribute"
1079
+ "name": "_tag_item"
998
1080
  }
999
1081
  },
1000
1082
  {
@@ -1064,7 +1146,7 @@
1064
1146
  "type": "REPEAT",
1065
1147
  "content": {
1066
1148
  "type": "SYMBOL",
1067
- "name": "_attribute"
1149
+ "name": "_tag_item"
1068
1150
  }
1069
1151
  },
1070
1152
  {
@@ -1242,30 +1324,110 @@
1242
1324
  ]
1243
1325
  },
1244
1326
  "self_closing_element": {
1245
- "type": "SEQ",
1327
+ "type": "CHOICE",
1246
1328
  "members": [
1247
1329
  {
1248
- "type": "STRING",
1249
- "value": "<"
1250
- },
1251
- {
1252
- "type": "FIELD",
1253
- "name": "name",
1254
- "content": {
1255
- "type": "SYMBOL",
1256
- "name": "tag_name"
1257
- }
1330
+ "type": "SEQ",
1331
+ "members": [
1332
+ {
1333
+ "type": "STRING",
1334
+ "value": "<"
1335
+ },
1336
+ {
1337
+ "type": "FIELD",
1338
+ "name": "name",
1339
+ "content": {
1340
+ "type": "SYMBOL",
1341
+ "name": "_tag_name"
1342
+ }
1343
+ },
1344
+ {
1345
+ "type": "REPEAT",
1346
+ "content": {
1347
+ "type": "SYMBOL",
1348
+ "name": "_tag_item"
1349
+ }
1350
+ },
1351
+ {
1352
+ "type": "ALIAS",
1353
+ "content": {
1354
+ "type": "SYMBOL",
1355
+ "name": "_self_closing_delimiter"
1356
+ },
1357
+ "named": false,
1358
+ "value": "/>"
1359
+ }
1360
+ ]
1258
1361
  },
1259
1362
  {
1260
- "type": "REPEAT",
1261
- "content": {
1262
- "type": "SYMBOL",
1263
- "name": "_attribute"
1264
- }
1363
+ "type": "SEQ",
1364
+ "members": [
1365
+ {
1366
+ "type": "STRING",
1367
+ "value": "<"
1368
+ },
1369
+ {
1370
+ "type": "FIELD",
1371
+ "name": "name",
1372
+ "content": {
1373
+ "type": "ALIAS",
1374
+ "content": {
1375
+ "type": "SYMBOL",
1376
+ "name": "script_tag_name"
1377
+ },
1378
+ "named": true,
1379
+ "value": "tag_name"
1380
+ }
1381
+ },
1382
+ {
1383
+ "type": "SYMBOL",
1384
+ "name": "_script_tag_probe"
1385
+ },
1386
+ {
1387
+ "type": "REPEAT",
1388
+ "content": {
1389
+ "type": "SYMBOL",
1390
+ "name": "_tag_item"
1391
+ }
1392
+ },
1393
+ {
1394
+ "type": "STRING",
1395
+ "value": "/>"
1396
+ }
1397
+ ]
1265
1398
  },
1266
1399
  {
1267
- "type": "STRING",
1268
- "value": "/>"
1400
+ "type": "SEQ",
1401
+ "members": [
1402
+ {
1403
+ "type": "STRING",
1404
+ "value": "<"
1405
+ },
1406
+ {
1407
+ "type": "FIELD",
1408
+ "name": "name",
1409
+ "content": {
1410
+ "type": "ALIAS",
1411
+ "content": {
1412
+ "type": "SYMBOL",
1413
+ "name": "style_tag_name"
1414
+ },
1415
+ "named": true,
1416
+ "value": "tag_name"
1417
+ }
1418
+ },
1419
+ {
1420
+ "type": "REPEAT",
1421
+ "content": {
1422
+ "type": "SYMBOL",
1423
+ "name": "_tag_item"
1424
+ }
1425
+ },
1426
+ {
1427
+ "type": "STRING",
1428
+ "value": "/>"
1429
+ }
1430
+ ]
1269
1431
  }
1270
1432
  ]
1271
1433
  },
@@ -1284,8 +1446,17 @@
1284
1446
  }
1285
1447
  },
1286
1448
  {
1287
- "type": "SYMBOL",
1288
- "name": "end_tag"
1449
+ "type": "CHOICE",
1450
+ "members": [
1451
+ {
1452
+ "type": "SYMBOL",
1453
+ "name": "end_tag"
1454
+ },
1455
+ {
1456
+ "type": "SYMBOL",
1457
+ "name": "_implicit_end_tag"
1458
+ }
1459
+ ]
1289
1460
  }
1290
1461
  ]
1291
1462
  },
@@ -1301,14 +1472,14 @@
1301
1472
  "name": "name",
1302
1473
  "content": {
1303
1474
  "type": "SYMBOL",
1304
- "name": "tag_name"
1475
+ "name": "_tag_name"
1305
1476
  }
1306
1477
  },
1307
1478
  {
1308
1479
  "type": "REPEAT",
1309
1480
  "content": {
1310
1481
  "type": "SYMBOL",
1311
- "name": "_attribute"
1482
+ "name": "_tag_item"
1312
1483
  }
1313
1484
  },
1314
1485
  {
@@ -1317,6 +1488,32 @@
1317
1488
  }
1318
1489
  ]
1319
1490
  },
1491
+ "_tag_item": {
1492
+ "type": "CHOICE",
1493
+ "members": [
1494
+ {
1495
+ "type": "SYMBOL",
1496
+ "name": "attribute"
1497
+ },
1498
+ {
1499
+ "type": "SYMBOL",
1500
+ "name": "_nugget"
1501
+ },
1502
+ {
1503
+ "type": "SYMBOL",
1504
+ "name": "server_comment"
1505
+ }
1506
+ ]
1507
+ },
1508
+ "_tag_name": {
1509
+ "type": "ALIAS",
1510
+ "content": {
1511
+ "type": "SYMBOL",
1512
+ "name": "_start_tag_name"
1513
+ },
1514
+ "named": true,
1515
+ "value": "tag_name"
1516
+ },
1320
1517
  "end_tag": {
1321
1518
  "type": "SEQ",
1322
1519
  "members": [
@@ -1358,8 +1555,13 @@
1358
1555
  "value": "tag_name"
1359
1556
  },
1360
1557
  {
1361
- "type": "SYMBOL",
1362
- "name": "tag_name"
1558
+ "type": "ALIAS",
1559
+ "content": {
1560
+ "type": "SYMBOL",
1561
+ "name": "_end_tag_name"
1562
+ },
1563
+ "named": true,
1564
+ "value": "tag_name"
1363
1565
  }
1364
1566
  ]
1365
1567
  }
@@ -1370,9 +1572,31 @@
1370
1572
  }
1371
1573
  ]
1372
1574
  },
1373
- "tag_name": {
1374
- "type": "SYMBOL",
1375
- "name": "_name"
1575
+ "stray_end_tag": {
1576
+ "type": "SEQ",
1577
+ "members": [
1578
+ {
1579
+ "type": "STRING",
1580
+ "value": "</"
1581
+ },
1582
+ {
1583
+ "type": "FIELD",
1584
+ "name": "name",
1585
+ "content": {
1586
+ "type": "ALIAS",
1587
+ "content": {
1588
+ "type": "SYMBOL",
1589
+ "name": "_stray_end_tag_name"
1590
+ },
1591
+ "named": true,
1592
+ "value": "tag_name"
1593
+ }
1594
+ },
1595
+ {
1596
+ "type": "STRING",
1597
+ "value": ">"
1598
+ }
1599
+ ]
1376
1600
  },
1377
1601
  "doctype": {
1378
1602
  "type": "SEQ",
@@ -1415,9 +1639,133 @@
1415
1639
  }
1416
1640
  }
1417
1641
  },
1642
+ "cdata_section": {
1643
+ "type": "SEQ",
1644
+ "members": [
1645
+ {
1646
+ "type": "STRING",
1647
+ "value": "<![CDATA["
1648
+ },
1649
+ {
1650
+ "type": "REPEAT",
1651
+ "content": {
1652
+ "type": "CHOICE",
1653
+ "members": [
1654
+ {
1655
+ "type": "SYMBOL",
1656
+ "name": "_nugget"
1657
+ },
1658
+ {
1659
+ "type": "SYMBOL",
1660
+ "name": "server_comment"
1661
+ },
1662
+ {
1663
+ "type": "ALIAS",
1664
+ "content": {
1665
+ "type": "PATTERN",
1666
+ "value": "[^\\]<]+"
1667
+ },
1668
+ "named": true,
1669
+ "value": "text"
1670
+ },
1671
+ {
1672
+ "type": "ALIAS",
1673
+ "content": {
1674
+ "type": "STRING",
1675
+ "value": "]"
1676
+ },
1677
+ "named": true,
1678
+ "value": "text"
1679
+ },
1680
+ {
1681
+ "type": "ALIAS",
1682
+ "content": {
1683
+ "type": "STRING",
1684
+ "value": "<"
1685
+ },
1686
+ "named": true,
1687
+ "value": "text"
1688
+ }
1689
+ ]
1690
+ }
1691
+ },
1692
+ {
1693
+ "type": "STRING",
1694
+ "value": "]]>"
1695
+ }
1696
+ ]
1697
+ },
1698
+ "processing_instruction": {
1699
+ "type": "SEQ",
1700
+ "members": [
1701
+ {
1702
+ "type": "STRING",
1703
+ "value": "<?"
1704
+ },
1705
+ {
1706
+ "type": "REPEAT",
1707
+ "content": {
1708
+ "type": "CHOICE",
1709
+ "members": [
1710
+ {
1711
+ "type": "SYMBOL",
1712
+ "name": "_nugget"
1713
+ },
1714
+ {
1715
+ "type": "SYMBOL",
1716
+ "name": "server_comment"
1717
+ },
1718
+ {
1719
+ "type": "ALIAS",
1720
+ "content": {
1721
+ "type": "PATTERN",
1722
+ "value": "[^?<]+"
1723
+ },
1724
+ "named": true,
1725
+ "value": "text"
1726
+ },
1727
+ {
1728
+ "type": "ALIAS",
1729
+ "content": {
1730
+ "type": "STRING",
1731
+ "value": "?"
1732
+ },
1733
+ "named": true,
1734
+ "value": "text"
1735
+ },
1736
+ {
1737
+ "type": "ALIAS",
1738
+ "content": {
1739
+ "type": "STRING",
1740
+ "value": "<"
1741
+ },
1742
+ "named": true,
1743
+ "value": "text"
1744
+ }
1745
+ ]
1746
+ }
1747
+ },
1748
+ {
1749
+ "type": "STRING",
1750
+ "value": "?>"
1751
+ }
1752
+ ]
1753
+ },
1418
1754
  "text": {
1419
- "type": "PATTERN",
1420
- "value": "[^<\\s][^<]*"
1755
+ "type": "TOKEN",
1756
+ "content": {
1757
+ "type": "CHOICE",
1758
+ "members": [
1759
+ {
1760
+ "type": "PATTERN",
1761
+ "value": "[^<\\s][^<]*"
1762
+ },
1763
+ {
1764
+ "type": "PATTERN",
1765
+ "value": "<\\s[^<]*"
1766
+ }
1767
+ ]
1768
+ }
1421
1769
  }
1422
1770
  },
1423
1771
  "extras": [
@@ -1475,7 +1823,35 @@
1475
1823
  },
1476
1824
  {
1477
1825
  "type": "SYMBOL",
1478
- "name": "handler_text"
1826
+ "name": "_handler_csharp"
1827
+ },
1828
+ {
1829
+ "type": "SYMBOL",
1830
+ "name": "_handler_vb"
1831
+ },
1832
+ {
1833
+ "type": "SYMBOL",
1834
+ "name": "_start_tag_name"
1835
+ },
1836
+ {
1837
+ "type": "SYMBOL",
1838
+ "name": "_end_tag_name"
1839
+ },
1840
+ {
1841
+ "type": "SYMBOL",
1842
+ "name": "_implicit_end_tag"
1843
+ },
1844
+ {
1845
+ "type": "SYMBOL",
1846
+ "name": "_self_closing_delimiter"
1847
+ },
1848
+ {
1849
+ "type": "SYMBOL",
1850
+ "name": "_stray_end_tag_name"
1851
+ },
1852
+ {
1853
+ "type": "SYMBOL",
1854
+ "name": "_script_tag_probe"
1479
1855
  }
1480
1856
  ],
1481
1857
  "inline": [],