tree-sitter-ucode 0.3.0 → 0.4.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.
Files changed (43) hide show
  1. package/README.md +32 -81
  2. package/grammar.js +214 -28
  3. package/markup/grammar.js +1057 -0
  4. package/markup/queries/folds.scm +20 -0
  5. package/markup/queries/highlights.scm +38 -0
  6. package/markup/queries/indents.scm +51 -0
  7. package/markup/queries/injections.scm +40 -0
  8. package/markup/queries/locals.scm +107 -0
  9. package/markup/queries/tags.scm +65 -0
  10. package/markup/queries/textobjects.scm +56 -0
  11. package/markup/src/grammar.json +5786 -0
  12. package/markup/src/node-types.json +3211 -0
  13. package/markup/src/parser.c +134461 -0
  14. package/markup/src/scanner.c +22 -0
  15. package/package.json +6 -5
  16. package/prebuilds/darwin-arm64/tree-sitter-ucode.node +0 -0
  17. package/prebuilds/linux-arm64/tree-sitter-ucode.node +0 -0
  18. package/prebuilds/linux-x64/tree-sitter-ucode.node +0 -0
  19. package/prebuilds/win32-x64/tree-sitter-ucode.node +0 -0
  20. package/queries/locals.scm +1 -0
  21. package/scripts/generate-markup-grammar.js +93 -0
  22. package/src/grammar.json +1069 -226
  23. package/src/node-types.json +662 -8
  24. package/src/parser.c +106401 -25117
  25. package/src/scanner.c +16 -193
  26. package/src/scanner_impl.h +494 -0
  27. package/tree-sitter-ucode.wasm +0 -0
  28. package/tree-sitter-ucode_markup.wasm +0 -0
  29. package/tree-sitter.json +33 -22
  30. package/tmpl/grammar.js +0 -68
  31. package/tmpl/queries/folds.scm +0 -4
  32. package/tmpl/queries/highlights.scm +0 -23
  33. package/tmpl/queries/indents.scm +0 -5
  34. package/tmpl/queries/injections.scm +0 -8
  35. package/tmpl/queries/locals.scm +0 -3
  36. package/tmpl/src/grammar.json +0 -251
  37. package/tmpl/src/node-types.json +0 -238
  38. package/tmpl/src/parser.c +0 -724
  39. package/tmpl/src/scanner.c +0 -174
  40. package/tree-sitter-ucode_tmpl.wasm +0 -0
  41. /package/{tmpl → markup}/src/tree_sitter/alloc.h +0 -0
  42. /package/{tmpl → markup}/src/tree_sitter/array.h +0 -0
  43. /package/{tmpl → markup}/src/tree_sitter/parser.h +0 -0
package/src/grammar.json CHANGED
@@ -27,6 +27,187 @@
27
27
  }
28
28
  ]
29
29
  },
30
+ "markup": {
31
+ "type": "SEQ",
32
+ "members": [
33
+ {
34
+ "type": "CHOICE",
35
+ "members": [
36
+ {
37
+ "type": "SYMBOL",
38
+ "name": "hash_bang_line"
39
+ },
40
+ {
41
+ "type": "BLANK"
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "type": "REPEAT",
47
+ "content": {
48
+ "type": "SYMBOL",
49
+ "name": "_markup_node"
50
+ }
51
+ }
52
+ ]
53
+ },
54
+ "_markup_node": {
55
+ "type": "CHOICE",
56
+ "members": [
57
+ {
58
+ "type": "SYMBOL",
59
+ "name": "raw_text"
60
+ },
61
+ {
62
+ "type": "SYMBOL",
63
+ "name": "expression_tag"
64
+ },
65
+ {
66
+ "type": "SYMBOL",
67
+ "name": "comment_tag"
68
+ },
69
+ {
70
+ "type": "SYMBOL",
71
+ "name": "statement_tag"
72
+ },
73
+ {
74
+ "type": "SYMBOL",
75
+ "name": "if_alt_statement"
76
+ },
77
+ {
78
+ "type": "SYMBOL",
79
+ "name": "for_alt_statement"
80
+ },
81
+ {
82
+ "type": "SYMBOL",
83
+ "name": "for_in_alt_statement"
84
+ },
85
+ {
86
+ "type": "SYMBOL",
87
+ "name": "while_alt_statement"
88
+ }
89
+ ]
90
+ },
91
+ "statement_tag": {
92
+ "type": "SEQ",
93
+ "members": [
94
+ {
95
+ "type": "FIELD",
96
+ "name": "open",
97
+ "content": {
98
+ "type": "SYMBOL",
99
+ "name": "_stmt_open"
100
+ }
101
+ },
102
+ {
103
+ "type": "REPEAT",
104
+ "content": {
105
+ "type": "SYMBOL",
106
+ "name": "statement"
107
+ }
108
+ },
109
+ {
110
+ "type": "FIELD",
111
+ "name": "close",
112
+ "content": {
113
+ "type": "SYMBOL",
114
+ "name": "_stmt_close"
115
+ }
116
+ }
117
+ ]
118
+ },
119
+ "expression_tag": {
120
+ "type": "SEQ",
121
+ "members": [
122
+ {
123
+ "type": "FIELD",
124
+ "name": "open",
125
+ "content": {
126
+ "type": "SYMBOL",
127
+ "name": "_expr_open"
128
+ }
129
+ },
130
+ {
131
+ "type": "CHOICE",
132
+ "members": [
133
+ {
134
+ "type": "SYMBOL",
135
+ "name": "_expressions"
136
+ },
137
+ {
138
+ "type": "BLANK"
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ "type": "FIELD",
144
+ "name": "close",
145
+ "content": {
146
+ "type": "SYMBOL",
147
+ "name": "_expr_close"
148
+ }
149
+ }
150
+ ]
151
+ },
152
+ "comment_tag": {
153
+ "type": "SEQ",
154
+ "members": [
155
+ {
156
+ "type": "FIELD",
157
+ "name": "open",
158
+ "content": {
159
+ "type": "CHOICE",
160
+ "members": [
161
+ {
162
+ "type": "STRING",
163
+ "value": "{#-"
164
+ },
165
+ {
166
+ "type": "STRING",
167
+ "value": "{#"
168
+ }
169
+ ]
170
+ }
171
+ },
172
+ {
173
+ "type": "CHOICE",
174
+ "members": [
175
+ {
176
+ "type": "FIELD",
177
+ "name": "content",
178
+ "content": {
179
+ "type": "SYMBOL",
180
+ "name": "comment_content"
181
+ }
182
+ },
183
+ {
184
+ "type": "BLANK"
185
+ }
186
+ ]
187
+ },
188
+ {
189
+ "type": "FIELD",
190
+ "name": "close",
191
+ "content": {
192
+ "type": "CHOICE",
193
+ "members": [
194
+ {
195
+ "type": "STRING",
196
+ "value": "-#}"
197
+ },
198
+ {
199
+ "type": "STRING",
200
+ "value": "#}"
201
+ }
202
+ ]
203
+ }
204
+ }
205
+ ]
206
+ },
207
+ "comment_content": {
208
+ "type": "PATTERN",
209
+ "value": "([^#-]|#[^}]|-(?:[^#]|#[^}]))+"
210
+ },
30
211
  "hash_bang_line": {
31
212
  "type": "PATTERN",
32
213
  "value": "#!.*"
@@ -708,88 +889,237 @@
708
889
  }
709
890
  },
710
891
  "if_alt_statement": {
711
- "type": "SEQ",
892
+ "type": "CHOICE",
712
893
  "members": [
713
894
  {
714
- "type": "STRING",
715
- "value": "if"
716
- },
717
- {
718
- "type": "FIELD",
719
- "name": "condition",
720
- "content": {
721
- "type": "SYMBOL",
722
- "name": "parenthesized_expression"
723
- }
724
- },
725
- {
726
- "type": "STRING",
727
- "value": ":"
728
- },
729
- {
730
- "type": "FIELD",
731
- "name": "body",
732
- "content": {
733
- "type": "REPEAT",
734
- "content": {
735
- "type": "SYMBOL",
736
- "name": "statement"
737
- }
738
- }
739
- },
740
- {
741
- "type": "REPEAT",
742
- "content": {
743
- "type": "FIELD",
744
- "name": "elif_clause",
745
- "content": {
746
- "type": "SYMBOL",
747
- "name": "elif_clause"
748
- }
749
- }
750
- },
751
- {
752
- "type": "CHOICE",
895
+ "type": "SEQ",
753
896
  "members": [
897
+ {
898
+ "type": "STRING",
899
+ "value": "if"
900
+ },
754
901
  {
755
902
  "type": "FIELD",
756
- "name": "else_body",
903
+ "name": "condition",
757
904
  "content": {
758
905
  "type": "SYMBOL",
759
- "name": "else_alt_clause"
906
+ "name": "parenthesized_expression"
760
907
  }
761
908
  },
762
909
  {
763
- "type": "BLANK"
910
+ "type": "STRING",
911
+ "value": ":"
912
+ },
913
+ {
914
+ "type": "FIELD",
915
+ "name": "body",
916
+ "content": {
917
+ "type": "REPEAT",
918
+ "content": {
919
+ "type": "SYMBOL",
920
+ "name": "statement"
921
+ }
922
+ }
923
+ },
924
+ {
925
+ "type": "REPEAT",
926
+ "content": {
927
+ "type": "FIELD",
928
+ "name": "elif_clause",
929
+ "content": {
930
+ "type": "SYMBOL",
931
+ "name": "elif_clause"
932
+ }
933
+ }
934
+ },
935
+ {
936
+ "type": "CHOICE",
937
+ "members": [
938
+ {
939
+ "type": "FIELD",
940
+ "name": "else_body",
941
+ "content": {
942
+ "type": "SYMBOL",
943
+ "name": "else_alt_clause"
944
+ }
945
+ },
946
+ {
947
+ "type": "BLANK"
948
+ }
949
+ ]
950
+ },
951
+ {
952
+ "type": "STRING",
953
+ "value": "endif"
764
954
  }
765
955
  ]
766
956
  },
767
957
  {
768
- "type": "STRING",
769
- "value": "endif"
770
- }
771
- ]
772
- },
773
- "elif_clause": {
774
- "type": "SEQ",
775
- "members": [
776
- {
777
- "type": "STRING",
778
- "value": "elif"
779
- },
780
- {
781
- "type": "FIELD",
782
- "name": "condition",
783
- "content": {
784
- "type": "SYMBOL",
785
- "name": "parenthesized_expression"
786
- }
787
- },
788
- {
789
- "type": "STRING",
790
- "value": ":"
791
- },
792
- {
958
+ "type": "SEQ",
959
+ "members": [
960
+ {
961
+ "type": "FIELD",
962
+ "name": "open",
963
+ "content": {
964
+ "type": "SYMBOL",
965
+ "name": "_stmt_open"
966
+ }
967
+ },
968
+ {
969
+ "type": "STRING",
970
+ "value": "if"
971
+ },
972
+ {
973
+ "type": "FIELD",
974
+ "name": "condition",
975
+ "content": {
976
+ "type": "SYMBOL",
977
+ "name": "parenthesized_expression"
978
+ }
979
+ },
980
+ {
981
+ "type": "STRING",
982
+ "value": ":"
983
+ },
984
+ {
985
+ "type": "REPEAT",
986
+ "content": {
987
+ "type": "SYMBOL",
988
+ "name": "statement"
989
+ }
990
+ },
991
+ {
992
+ "type": "FIELD",
993
+ "name": "close",
994
+ "content": {
995
+ "type": "SYMBOL",
996
+ "name": "_stmt_close"
997
+ }
998
+ },
999
+ {
1000
+ "type": "REPEAT",
1001
+ "content": {
1002
+ "type": "SYMBOL",
1003
+ "name": "_if_markup_node"
1004
+ }
1005
+ },
1006
+ {
1007
+ "type": "FIELD",
1008
+ "name": "end_open",
1009
+ "content": {
1010
+ "type": "SYMBOL",
1011
+ "name": "_stmt_open"
1012
+ }
1013
+ },
1014
+ {
1015
+ "type": "STRING",
1016
+ "value": "endif"
1017
+ },
1018
+ {
1019
+ "type": "FIELD",
1020
+ "name": "end_close",
1021
+ "content": {
1022
+ "type": "SYMBOL",
1023
+ "name": "_stmt_close"
1024
+ }
1025
+ }
1026
+ ]
1027
+ }
1028
+ ]
1029
+ },
1030
+ "_if_markup_node": {
1031
+ "type": "CHOICE",
1032
+ "members": [
1033
+ {
1034
+ "type": "SYMBOL",
1035
+ "name": "_markup_node"
1036
+ },
1037
+ {
1038
+ "type": "SYMBOL",
1039
+ "name": "elif_clause_tag"
1040
+ },
1041
+ {
1042
+ "type": "SYMBOL",
1043
+ "name": "else_alt_clause_tag"
1044
+ }
1045
+ ]
1046
+ },
1047
+ "_stmt_open": {
1048
+ "type": "CHOICE",
1049
+ "members": [
1050
+ {
1051
+ "type": "SYMBOL",
1052
+ "name": "statement_tag_open"
1053
+ },
1054
+ {
1055
+ "type": "SYMBOL",
1056
+ "name": "statement_tag_trim_open"
1057
+ },
1058
+ {
1059
+ "type": "SYMBOL",
1060
+ "name": "statement_tag_lstrip_open"
1061
+ }
1062
+ ]
1063
+ },
1064
+ "_stmt_close": {
1065
+ "type": "CHOICE",
1066
+ "members": [
1067
+ {
1068
+ "type": "SYMBOL",
1069
+ "name": "statement_tag_close"
1070
+ },
1071
+ {
1072
+ "type": "SYMBOL",
1073
+ "name": "statement_tag_trim_close"
1074
+ }
1075
+ ]
1076
+ },
1077
+ "_expr_open": {
1078
+ "type": "CHOICE",
1079
+ "members": [
1080
+ {
1081
+ "type": "SYMBOL",
1082
+ "name": "expression_tag_open"
1083
+ },
1084
+ {
1085
+ "type": "SYMBOL",
1086
+ "name": "expression_tag_trim_open"
1087
+ }
1088
+ ]
1089
+ },
1090
+ "_expr_close": {
1091
+ "type": "CHOICE",
1092
+ "members": [
1093
+ {
1094
+ "type": "SYMBOL",
1095
+ "name": "expression_tag_close"
1096
+ },
1097
+ {
1098
+ "type": "SYMBOL",
1099
+ "name": "expression_tag_trim_close"
1100
+ }
1101
+ ]
1102
+ },
1103
+ "elif_clause": {
1104
+ "type": "SEQ",
1105
+ "members": [
1106
+ {
1107
+ "type": "STRING",
1108
+ "value": "elif"
1109
+ },
1110
+ {
1111
+ "type": "FIELD",
1112
+ "name": "condition",
1113
+ "content": {
1114
+ "type": "SYMBOL",
1115
+ "name": "parenthesized_expression"
1116
+ }
1117
+ },
1118
+ {
1119
+ "type": "STRING",
1120
+ "value": ":"
1121
+ },
1122
+ {
793
1123
  "type": "FIELD",
794
1124
  "name": "body",
795
1125
  "content": {
@@ -802,6 +1132,43 @@
802
1132
  }
803
1133
  ]
804
1134
  },
1135
+ "elif_clause_tag": {
1136
+ "type": "SEQ",
1137
+ "members": [
1138
+ {
1139
+ "type": "FIELD",
1140
+ "name": "open",
1141
+ "content": {
1142
+ "type": "SYMBOL",
1143
+ "name": "_stmt_open"
1144
+ }
1145
+ },
1146
+ {
1147
+ "type": "STRING",
1148
+ "value": "elif"
1149
+ },
1150
+ {
1151
+ "type": "FIELD",
1152
+ "name": "condition",
1153
+ "content": {
1154
+ "type": "SYMBOL",
1155
+ "name": "parenthesized_expression"
1156
+ }
1157
+ },
1158
+ {
1159
+ "type": "STRING",
1160
+ "value": ":"
1161
+ },
1162
+ {
1163
+ "type": "FIELD",
1164
+ "name": "close",
1165
+ "content": {
1166
+ "type": "SYMBOL",
1167
+ "name": "_stmt_close"
1168
+ }
1169
+ }
1170
+ ]
1171
+ },
805
1172
  "else_alt_clause": {
806
1173
  "type": "SEQ",
807
1174
  "members": [
@@ -822,6 +1189,31 @@
822
1189
  }
823
1190
  ]
824
1191
  },
1192
+ "else_alt_clause_tag": {
1193
+ "type": "SEQ",
1194
+ "members": [
1195
+ {
1196
+ "type": "FIELD",
1197
+ "name": "open",
1198
+ "content": {
1199
+ "type": "SYMBOL",
1200
+ "name": "_stmt_open"
1201
+ }
1202
+ },
1203
+ {
1204
+ "type": "STRING",
1205
+ "value": "else"
1206
+ },
1207
+ {
1208
+ "type": "FIELD",
1209
+ "name": "close",
1210
+ "content": {
1211
+ "type": "SYMBOL",
1212
+ "name": "_stmt_close"
1213
+ }
1214
+ }
1215
+ ]
1216
+ },
825
1217
  "switch_statement": {
826
1218
  "type": "SEQ",
827
1219
  "members": [
@@ -958,176 +1350,501 @@
958
1350
  ]
959
1351
  },
960
1352
  "for_alt_statement": {
961
- "type": "SEQ",
1353
+ "type": "CHOICE",
962
1354
  "members": [
963
1355
  {
964
1356
  "type": "SEQ",
965
1357
  "members": [
966
1358
  {
967
- "type": "STRING",
968
- "value": "for"
969
- },
970
- {
971
- "type": "STRING",
972
- "value": "("
973
- },
974
- {
975
- "type": "CHOICE",
1359
+ "type": "SEQ",
976
1360
  "members": [
977
1361
  {
978
- "type": "FIELD",
979
- "name": "initializer",
980
- "content": {
981
- "type": "SYMBOL",
982
- "name": "lexical_declaration"
983
- }
1362
+ "type": "STRING",
1363
+ "value": "for"
984
1364
  },
985
1365
  {
986
- "type": "SEQ",
1366
+ "type": "STRING",
1367
+ "value": "("
1368
+ },
1369
+ {
1370
+ "type": "CHOICE",
987
1371
  "members": [
988
1372
  {
989
1373
  "type": "FIELD",
990
1374
  "name": "initializer",
991
1375
  "content": {
992
1376
  "type": "SYMBOL",
993
- "name": "_expressions"
1377
+ "name": "lexical_declaration"
994
1378
  }
995
1379
  },
996
1380
  {
997
- "type": "STRING",
998
- "value": ";"
1381
+ "type": "SEQ",
1382
+ "members": [
1383
+ {
1384
+ "type": "FIELD",
1385
+ "name": "initializer",
1386
+ "content": {
1387
+ "type": "SYMBOL",
1388
+ "name": "_expressions"
1389
+ }
1390
+ },
1391
+ {
1392
+ "type": "STRING",
1393
+ "value": ";"
1394
+ }
1395
+ ]
1396
+ },
1397
+ {
1398
+ "type": "FIELD",
1399
+ "name": "initializer",
1400
+ "content": {
1401
+ "type": "SYMBOL",
1402
+ "name": "empty_statement"
1403
+ }
999
1404
  }
1000
1405
  ]
1001
1406
  },
1002
1407
  {
1003
1408
  "type": "FIELD",
1004
- "name": "initializer",
1409
+ "name": "condition",
1005
1410
  "content": {
1006
- "type": "SYMBOL",
1007
- "name": "empty_statement"
1008
- }
1009
- }
1010
- ]
1011
- },
1012
- {
1013
- "type": "FIELD",
1014
- "name": "condition",
1015
- "content": {
1016
- "type": "CHOICE",
1017
- "members": [
1018
- {
1019
- "type": "SEQ",
1411
+ "type": "CHOICE",
1020
1412
  "members": [
1021
1413
  {
1022
- "type": "SYMBOL",
1023
- "name": "_expressions"
1024
- },
1025
- {
1026
- "type": "STRING",
1027
- "value": ";"
1414
+ "type": "SEQ",
1415
+ "members": [
1416
+ {
1417
+ "type": "SYMBOL",
1418
+ "name": "_expressions"
1419
+ },
1420
+ {
1421
+ "type": "STRING",
1422
+ "value": ";"
1423
+ }
1424
+ ]
1425
+ },
1426
+ {
1427
+ "type": "SYMBOL",
1428
+ "name": "empty_statement"
1028
1429
  }
1029
1430
  ]
1030
- },
1031
- {
1032
- "type": "SYMBOL",
1033
- "name": "empty_statement"
1034
1431
  }
1035
- ]
1432
+ },
1433
+ {
1434
+ "type": "FIELD",
1435
+ "name": "increment",
1436
+ "content": {
1437
+ "type": "CHOICE",
1438
+ "members": [
1439
+ {
1440
+ "type": "SYMBOL",
1441
+ "name": "_expressions"
1442
+ },
1443
+ {
1444
+ "type": "BLANK"
1445
+ }
1446
+ ]
1447
+ }
1448
+ },
1449
+ {
1450
+ "type": "STRING",
1451
+ "value": ")"
1452
+ }
1453
+ ]
1454
+ },
1455
+ {
1456
+ "type": "STRING",
1457
+ "value": ":"
1458
+ },
1459
+ {
1460
+ "type": "FIELD",
1461
+ "name": "body",
1462
+ "content": {
1463
+ "type": "REPEAT",
1464
+ "content": {
1465
+ "type": "SYMBOL",
1466
+ "name": "statement"
1467
+ }
1468
+ }
1469
+ },
1470
+ {
1471
+ "type": "STRING",
1472
+ "value": "endfor"
1473
+ }
1474
+ ]
1475
+ },
1476
+ {
1477
+ "type": "SEQ",
1478
+ "members": [
1479
+ {
1480
+ "type": "FIELD",
1481
+ "name": "open",
1482
+ "content": {
1483
+ "type": "SYMBOL",
1484
+ "name": "_stmt_open"
1485
+ }
1486
+ },
1487
+ {
1488
+ "type": "SEQ",
1489
+ "members": [
1490
+ {
1491
+ "type": "STRING",
1492
+ "value": "for"
1493
+ },
1494
+ {
1495
+ "type": "STRING",
1496
+ "value": "("
1497
+ },
1498
+ {
1499
+ "type": "CHOICE",
1500
+ "members": [
1501
+ {
1502
+ "type": "FIELD",
1503
+ "name": "initializer",
1504
+ "content": {
1505
+ "type": "SYMBOL",
1506
+ "name": "lexical_declaration"
1507
+ }
1508
+ },
1509
+ {
1510
+ "type": "SEQ",
1511
+ "members": [
1512
+ {
1513
+ "type": "FIELD",
1514
+ "name": "initializer",
1515
+ "content": {
1516
+ "type": "SYMBOL",
1517
+ "name": "_expressions"
1518
+ }
1519
+ },
1520
+ {
1521
+ "type": "STRING",
1522
+ "value": ";"
1523
+ }
1524
+ ]
1525
+ },
1526
+ {
1527
+ "type": "FIELD",
1528
+ "name": "initializer",
1529
+ "content": {
1530
+ "type": "SYMBOL",
1531
+ "name": "empty_statement"
1532
+ }
1533
+ }
1534
+ ]
1535
+ },
1536
+ {
1537
+ "type": "FIELD",
1538
+ "name": "condition",
1539
+ "content": {
1540
+ "type": "CHOICE",
1541
+ "members": [
1542
+ {
1543
+ "type": "SEQ",
1544
+ "members": [
1545
+ {
1546
+ "type": "SYMBOL",
1547
+ "name": "_expressions"
1548
+ },
1549
+ {
1550
+ "type": "STRING",
1551
+ "value": ";"
1552
+ }
1553
+ ]
1554
+ },
1555
+ {
1556
+ "type": "SYMBOL",
1557
+ "name": "empty_statement"
1558
+ }
1559
+ ]
1560
+ }
1561
+ },
1562
+ {
1563
+ "type": "FIELD",
1564
+ "name": "increment",
1565
+ "content": {
1566
+ "type": "CHOICE",
1567
+ "members": [
1568
+ {
1569
+ "type": "SYMBOL",
1570
+ "name": "_expressions"
1571
+ },
1572
+ {
1573
+ "type": "BLANK"
1574
+ }
1575
+ ]
1576
+ }
1577
+ },
1578
+ {
1579
+ "type": "STRING",
1580
+ "value": ")"
1581
+ }
1582
+ ]
1583
+ },
1584
+ {
1585
+ "type": "STRING",
1586
+ "value": ":"
1587
+ },
1588
+ {
1589
+ "type": "REPEAT",
1590
+ "content": {
1591
+ "type": "SYMBOL",
1592
+ "name": "statement"
1593
+ }
1594
+ },
1595
+ {
1596
+ "type": "FIELD",
1597
+ "name": "close",
1598
+ "content": {
1599
+ "type": "SYMBOL",
1600
+ "name": "_stmt_close"
1601
+ }
1602
+ },
1603
+ {
1604
+ "type": "FIELD",
1605
+ "name": "body",
1606
+ "content": {
1607
+ "type": "REPEAT",
1608
+ "content": {
1609
+ "type": "SYMBOL",
1610
+ "name": "_markup_node"
1611
+ }
1612
+ }
1613
+ },
1614
+ {
1615
+ "type": "FIELD",
1616
+ "name": "end_open",
1617
+ "content": {
1618
+ "type": "SYMBOL",
1619
+ "name": "_stmt_open"
1620
+ }
1621
+ },
1622
+ {
1623
+ "type": "STRING",
1624
+ "value": "endfor"
1625
+ },
1626
+ {
1627
+ "type": "FIELD",
1628
+ "name": "end_close",
1629
+ "content": {
1630
+ "type": "SYMBOL",
1631
+ "name": "_stmt_close"
1632
+ }
1633
+ }
1634
+ ]
1635
+ }
1636
+ ]
1637
+ },
1638
+ "for_in_statement": {
1639
+ "type": "SEQ",
1640
+ "members": [
1641
+ {
1642
+ "type": "STRING",
1643
+ "value": "for"
1644
+ },
1645
+ {
1646
+ "type": "SYMBOL",
1647
+ "name": "_for_header"
1648
+ },
1649
+ {
1650
+ "type": "FIELD",
1651
+ "name": "body",
1652
+ "content": {
1653
+ "type": "SYMBOL",
1654
+ "name": "statement"
1655
+ }
1656
+ }
1657
+ ]
1658
+ },
1659
+ "for_in_alt_statement": {
1660
+ "type": "CHOICE",
1661
+ "members": [
1662
+ {
1663
+ "type": "SEQ",
1664
+ "members": [
1665
+ {
1666
+ "type": "STRING",
1667
+ "value": "for"
1668
+ },
1669
+ {
1670
+ "type": "SYMBOL",
1671
+ "name": "_for_header"
1672
+ },
1673
+ {
1674
+ "type": "STRING",
1675
+ "value": ":"
1676
+ },
1677
+ {
1678
+ "type": "FIELD",
1679
+ "name": "body",
1680
+ "content": {
1681
+ "type": "REPEAT",
1682
+ "content": {
1683
+ "type": "SYMBOL",
1684
+ "name": "statement"
1685
+ }
1686
+ }
1687
+ },
1688
+ {
1689
+ "type": "STRING",
1690
+ "value": "endfor"
1691
+ }
1692
+ ]
1693
+ },
1694
+ {
1695
+ "type": "SEQ",
1696
+ "members": [
1697
+ {
1698
+ "type": "FIELD",
1699
+ "name": "open",
1700
+ "content": {
1701
+ "type": "SYMBOL",
1702
+ "name": "_stmt_open"
1703
+ }
1704
+ },
1705
+ {
1706
+ "type": "STRING",
1707
+ "value": "for"
1708
+ },
1709
+ {
1710
+ "type": "SYMBOL",
1711
+ "name": "_for_header"
1712
+ },
1713
+ {
1714
+ "type": "STRING",
1715
+ "value": ":"
1716
+ },
1717
+ {
1718
+ "type": "REPEAT",
1719
+ "content": {
1720
+ "type": "SYMBOL",
1721
+ "name": "statement"
1722
+ }
1723
+ },
1724
+ {
1725
+ "type": "FIELD",
1726
+ "name": "close",
1727
+ "content": {
1728
+ "type": "SYMBOL",
1729
+ "name": "_stmt_close"
1730
+ }
1731
+ },
1732
+ {
1733
+ "type": "FIELD",
1734
+ "name": "body",
1735
+ "content": {
1736
+ "type": "REPEAT",
1737
+ "content": {
1738
+ "type": "SYMBOL",
1739
+ "name": "_markup_node"
1740
+ }
1741
+ }
1742
+ },
1743
+ {
1744
+ "type": "FIELD",
1745
+ "name": "end_open",
1746
+ "content": {
1747
+ "type": "SYMBOL",
1748
+ "name": "_stmt_open"
1749
+ }
1750
+ },
1751
+ {
1752
+ "type": "STRING",
1753
+ "value": "endfor"
1754
+ },
1755
+ {
1756
+ "type": "FIELD",
1757
+ "name": "end_close",
1758
+ "content": {
1759
+ "type": "SYMBOL",
1760
+ "name": "_stmt_close"
1761
+ }
1762
+ }
1763
+ ]
1764
+ },
1765
+ {
1766
+ "type": "SEQ",
1767
+ "members": [
1768
+ {
1769
+ "type": "FIELD",
1770
+ "name": "open",
1771
+ "content": {
1772
+ "type": "SYMBOL",
1773
+ "name": "_stmt_open"
1774
+ }
1775
+ },
1776
+ {
1777
+ "type": "STRING",
1778
+ "value": "for"
1779
+ },
1780
+ {
1781
+ "type": "SYMBOL",
1782
+ "name": "_for_header"
1783
+ },
1784
+ {
1785
+ "type": "STRING",
1786
+ "value": ":"
1787
+ },
1788
+ {
1789
+ "type": "STRING",
1790
+ "value": "for"
1791
+ },
1792
+ {
1793
+ "type": "SYMBOL",
1794
+ "name": "_for_header"
1795
+ },
1796
+ {
1797
+ "type": "STRING",
1798
+ "value": ":"
1799
+ },
1800
+ {
1801
+ "type": "FIELD",
1802
+ "name": "close",
1803
+ "content": {
1804
+ "type": "SYMBOL",
1805
+ "name": "_stmt_close"
1036
1806
  }
1037
1807
  },
1038
1808
  {
1039
1809
  "type": "FIELD",
1040
- "name": "increment",
1810
+ "name": "body",
1041
1811
  "content": {
1042
- "type": "CHOICE",
1043
- "members": [
1044
- {
1045
- "type": "SYMBOL",
1046
- "name": "_expressions"
1047
- },
1048
- {
1049
- "type": "BLANK"
1050
- }
1051
- ]
1812
+ "type": "REPEAT",
1813
+ "content": {
1814
+ "type": "SYMBOL",
1815
+ "name": "_markup_node"
1816
+ }
1817
+ }
1818
+ },
1819
+ {
1820
+ "type": "FIELD",
1821
+ "name": "end_open",
1822
+ "content": {
1823
+ "type": "SYMBOL",
1824
+ "name": "_stmt_open"
1052
1825
  }
1053
1826
  },
1054
1827
  {
1055
1828
  "type": "STRING",
1056
- "value": ")"
1829
+ "value": "endfor"
1830
+ },
1831
+ {
1832
+ "type": "STRING",
1833
+ "value": ";"
1834
+ },
1835
+ {
1836
+ "type": "STRING",
1837
+ "value": "endfor"
1838
+ },
1839
+ {
1840
+ "type": "FIELD",
1841
+ "name": "end_close",
1842
+ "content": {
1843
+ "type": "SYMBOL",
1844
+ "name": "_stmt_close"
1845
+ }
1057
1846
  }
1058
1847
  ]
1059
- },
1060
- {
1061
- "type": "STRING",
1062
- "value": ":"
1063
- },
1064
- {
1065
- "type": "FIELD",
1066
- "name": "body",
1067
- "content": {
1068
- "type": "REPEAT",
1069
- "content": {
1070
- "type": "SYMBOL",
1071
- "name": "statement"
1072
- }
1073
- }
1074
- },
1075
- {
1076
- "type": "STRING",
1077
- "value": "endfor"
1078
- }
1079
- ]
1080
- },
1081
- "for_in_statement": {
1082
- "type": "SEQ",
1083
- "members": [
1084
- {
1085
- "type": "STRING",
1086
- "value": "for"
1087
- },
1088
- {
1089
- "type": "SYMBOL",
1090
- "name": "_for_header"
1091
- },
1092
- {
1093
- "type": "FIELD",
1094
- "name": "body",
1095
- "content": {
1096
- "type": "SYMBOL",
1097
- "name": "statement"
1098
- }
1099
- }
1100
- ]
1101
- },
1102
- "for_in_alt_statement": {
1103
- "type": "SEQ",
1104
- "members": [
1105
- {
1106
- "type": "STRING",
1107
- "value": "for"
1108
- },
1109
- {
1110
- "type": "SYMBOL",
1111
- "name": "_for_header"
1112
- },
1113
- {
1114
- "type": "STRING",
1115
- "value": ":"
1116
- },
1117
- {
1118
- "type": "FIELD",
1119
- "name": "body",
1120
- "content": {
1121
- "type": "REPEAT",
1122
- "content": {
1123
- "type": "SYMBOL",
1124
- "name": "statement"
1125
- }
1126
- }
1127
- },
1128
- {
1129
- "type": "STRING",
1130
- "value": "endfor"
1131
1848
  }
1132
1849
  ]
1133
1850
  },
@@ -1280,38 +1997,118 @@
1280
1997
  ]
1281
1998
  },
1282
1999
  "while_alt_statement": {
1283
- "type": "SEQ",
2000
+ "type": "CHOICE",
1284
2001
  "members": [
1285
2002
  {
1286
- "type": "STRING",
1287
- "value": "while"
1288
- },
1289
- {
1290
- "type": "FIELD",
1291
- "name": "condition",
1292
- "content": {
1293
- "type": "SYMBOL",
1294
- "name": "parenthesized_expression"
1295
- }
1296
- },
1297
- {
1298
- "type": "STRING",
1299
- "value": ":"
1300
- },
1301
- {
1302
- "type": "FIELD",
1303
- "name": "body",
1304
- "content": {
1305
- "type": "REPEAT",
1306
- "content": {
1307
- "type": "SYMBOL",
1308
- "name": "statement"
2003
+ "type": "SEQ",
2004
+ "members": [
2005
+ {
2006
+ "type": "STRING",
2007
+ "value": "while"
2008
+ },
2009
+ {
2010
+ "type": "FIELD",
2011
+ "name": "condition",
2012
+ "content": {
2013
+ "type": "SYMBOL",
2014
+ "name": "parenthesized_expression"
2015
+ }
2016
+ },
2017
+ {
2018
+ "type": "STRING",
2019
+ "value": ":"
2020
+ },
2021
+ {
2022
+ "type": "FIELD",
2023
+ "name": "body",
2024
+ "content": {
2025
+ "type": "REPEAT",
2026
+ "content": {
2027
+ "type": "SYMBOL",
2028
+ "name": "statement"
2029
+ }
2030
+ }
2031
+ },
2032
+ {
2033
+ "type": "STRING",
2034
+ "value": "endwhile"
1309
2035
  }
1310
- }
2036
+ ]
1311
2037
  },
1312
2038
  {
1313
- "type": "STRING",
1314
- "value": "endwhile"
2039
+ "type": "SEQ",
2040
+ "members": [
2041
+ {
2042
+ "type": "FIELD",
2043
+ "name": "open",
2044
+ "content": {
2045
+ "type": "SYMBOL",
2046
+ "name": "_stmt_open"
2047
+ }
2048
+ },
2049
+ {
2050
+ "type": "STRING",
2051
+ "value": "while"
2052
+ },
2053
+ {
2054
+ "type": "FIELD",
2055
+ "name": "condition",
2056
+ "content": {
2057
+ "type": "SYMBOL",
2058
+ "name": "parenthesized_expression"
2059
+ }
2060
+ },
2061
+ {
2062
+ "type": "STRING",
2063
+ "value": ":"
2064
+ },
2065
+ {
2066
+ "type": "REPEAT",
2067
+ "content": {
2068
+ "type": "SYMBOL",
2069
+ "name": "statement"
2070
+ }
2071
+ },
2072
+ {
2073
+ "type": "FIELD",
2074
+ "name": "close",
2075
+ "content": {
2076
+ "type": "SYMBOL",
2077
+ "name": "_stmt_close"
2078
+ }
2079
+ },
2080
+ {
2081
+ "type": "FIELD",
2082
+ "name": "body",
2083
+ "content": {
2084
+ "type": "REPEAT",
2085
+ "content": {
2086
+ "type": "SYMBOL",
2087
+ "name": "_markup_node"
2088
+ }
2089
+ }
2090
+ },
2091
+ {
2092
+ "type": "FIELD",
2093
+ "name": "end_open",
2094
+ "content": {
2095
+ "type": "SYMBOL",
2096
+ "name": "_stmt_open"
2097
+ }
2098
+ },
2099
+ {
2100
+ "type": "STRING",
2101
+ "value": "endwhile"
2102
+ },
2103
+ {
2104
+ "type": "FIELD",
2105
+ "name": "end_close",
2106
+ "content": {
2107
+ "type": "SYMBOL",
2108
+ "name": "_stmt_close"
2109
+ }
2110
+ }
2111
+ ]
1315
2112
  }
1316
2113
  ]
1317
2114
  },
@@ -4806,6 +5603,46 @@
4806
5603
  {
4807
5604
  "type": "SYMBOL",
4808
5605
  "name": "_ternary_qmark"
5606
+ },
5607
+ {
5608
+ "type": "SYMBOL",
5609
+ "name": "raw_text"
5610
+ },
5611
+ {
5612
+ "type": "SYMBOL",
5613
+ "name": "statement_tag_open"
5614
+ },
5615
+ {
5616
+ "type": "SYMBOL",
5617
+ "name": "statement_tag_trim_open"
5618
+ },
5619
+ {
5620
+ "type": "SYMBOL",
5621
+ "name": "statement_tag_lstrip_open"
5622
+ },
5623
+ {
5624
+ "type": "SYMBOL",
5625
+ "name": "statement_tag_close"
5626
+ },
5627
+ {
5628
+ "type": "SYMBOL",
5629
+ "name": "statement_tag_trim_close"
5630
+ },
5631
+ {
5632
+ "type": "SYMBOL",
5633
+ "name": "expression_tag_open"
5634
+ },
5635
+ {
5636
+ "type": "SYMBOL",
5637
+ "name": "expression_tag_trim_open"
5638
+ },
5639
+ {
5640
+ "type": "SYMBOL",
5641
+ "name": "expression_tag_close"
5642
+ },
5643
+ {
5644
+ "type": "SYMBOL",
5645
+ "name": "expression_tag_trim_close"
4809
5646
  }
4810
5647
  ],
4811
5648
  "inline": [
@@ -4815,7 +5652,13 @@
4815
5652
  "_semicolon",
4816
5653
  "_identifier",
4817
5654
  "_reserved_identifier",
4818
- "_lhs_expression"
5655
+ "_lhs_expression",
5656
+ "_markup_node",
5657
+ "_if_markup_node",
5658
+ "_stmt_open",
5659
+ "_stmt_close",
5660
+ "_expr_open",
5661
+ "_expr_close"
4819
5662
  ],
4820
5663
  "supertypes": [
4821
5664
  "statement",