tree-sitter-ucode 0.3.0 → 0.5.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 (53) hide show
  1. package/README.md +32 -81
  2. package/grammar.js +221 -35
  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 +5814 -0
  12. package/markup/src/node-types.json +3224 -0
  13. package/markup/src/parser.c +134512 -0
  14. package/markup/src/scanner.c +22 -0
  15. package/package.json +9 -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 +8 -0
  21. package/queries/tags.scm +15 -2
  22. package/scripts/generate-markup-grammar.js +93 -0
  23. package/src/grammar.json +1104 -233
  24. package/src/node-types.json +736 -69
  25. package/src/parser.c +106697 -25362
  26. package/src/scanner.c +16 -193
  27. package/src/scanner_impl.h +494 -0
  28. package/tree-sitter-ucode.wasm +0 -0
  29. package/tree-sitter-ucode_markup.wasm +0 -0
  30. package/tree-sitter.json +46 -22
  31. package/ucdocs/grammar.js +284 -0
  32. package/ucdocs/queries/highlights.scm +25 -0
  33. package/ucdocs/queries/tags.scm +22 -0
  34. package/ucdocs/src/grammar.json +1437 -0
  35. package/ucdocs/src/node-types.json +1347 -0
  36. package/ucdocs/src/parser.c +6387 -0
  37. package/ucdocs/src/tree_sitter/alloc.h +54 -0
  38. package/ucdocs/src/tree_sitter/array.h +330 -0
  39. package/ucdocs/src/tree_sitter/parser.h +286 -0
  40. package/tmpl/grammar.js +0 -68
  41. package/tmpl/queries/folds.scm +0 -4
  42. package/tmpl/queries/highlights.scm +0 -23
  43. package/tmpl/queries/indents.scm +0 -5
  44. package/tmpl/queries/injections.scm +0 -8
  45. package/tmpl/queries/locals.scm +0 -3
  46. package/tmpl/src/grammar.json +0 -251
  47. package/tmpl/src/node-types.json +0 -238
  48. package/tmpl/src/parser.c +0 -724
  49. package/tmpl/src/scanner.c +0 -174
  50. package/tree-sitter-ucode_tmpl.wasm +0 -0
  51. /package/{tmpl → markup}/src/tree_sitter/alloc.h +0 -0
  52. /package/{tmpl → markup}/src/tree_sitter/array.h +0 -0
  53. /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": "#!.*"
@@ -42,8 +223,12 @@
42
223
  "value": "export"
43
224
  },
44
225
  {
45
- "type": "SYMBOL",
46
- "name": "export_clause"
226
+ "type": "FIELD",
227
+ "name": "clause",
228
+ "content": {
229
+ "type": "SYMBOL",
230
+ "name": "export_clause"
231
+ }
47
232
  },
48
233
  {
49
234
  "type": "SYMBOL",
@@ -241,8 +426,12 @@
241
426
  "type": "SEQ",
242
427
  "members": [
243
428
  {
244
- "type": "SYMBOL",
245
- "name": "import_clause"
429
+ "type": "FIELD",
430
+ "name": "clause",
431
+ "content": {
432
+ "type": "SYMBOL",
433
+ "name": "import_clause"
434
+ }
246
435
  },
247
436
  {
248
437
  "type": "STRING",
@@ -278,19 +467,31 @@
278
467
  "type": "CHOICE",
279
468
  "members": [
280
469
  {
281
- "type": "SYMBOL",
282
- "name": "namespace_import"
470
+ "type": "FIELD",
471
+ "name": "namespace",
472
+ "content": {
473
+ "type": "SYMBOL",
474
+ "name": "namespace_import"
475
+ }
283
476
  },
284
477
  {
285
- "type": "SYMBOL",
286
- "name": "named_imports"
478
+ "type": "FIELD",
479
+ "name": "named",
480
+ "content": {
481
+ "type": "SYMBOL",
482
+ "name": "named_imports"
483
+ }
287
484
  },
288
485
  {
289
486
  "type": "SEQ",
290
487
  "members": [
291
488
  {
292
- "type": "SYMBOL",
293
- "name": "identifier"
489
+ "type": "FIELD",
490
+ "name": "default",
491
+ "content": {
492
+ "type": "SYMBOL",
493
+ "name": "identifier"
494
+ }
294
495
  },
295
496
  {
296
497
  "type": "CHOICE",
@@ -306,12 +507,20 @@
306
507
  "type": "CHOICE",
307
508
  "members": [
308
509
  {
309
- "type": "SYMBOL",
310
- "name": "namespace_import"
510
+ "type": "FIELD",
511
+ "name": "namespace",
512
+ "content": {
513
+ "type": "SYMBOL",
514
+ "name": "namespace_import"
515
+ }
311
516
  },
312
517
  {
313
- "type": "SYMBOL",
314
- "name": "named_imports"
518
+ "type": "FIELD",
519
+ "name": "named",
520
+ "content": {
521
+ "type": "SYMBOL",
522
+ "name": "named_imports"
523
+ }
315
524
  }
316
525
  ]
317
526
  }
@@ -708,82 +917,231 @@
708
917
  }
709
918
  },
710
919
  "if_alt_statement": {
711
- "type": "SEQ",
920
+ "type": "CHOICE",
712
921
  "members": [
713
922
  {
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",
923
+ "type": "SEQ",
753
924
  "members": [
925
+ {
926
+ "type": "STRING",
927
+ "value": "if"
928
+ },
754
929
  {
755
930
  "type": "FIELD",
756
- "name": "else_body",
931
+ "name": "condition",
757
932
  "content": {
758
933
  "type": "SYMBOL",
759
- "name": "else_alt_clause"
934
+ "name": "parenthesized_expression"
760
935
  }
761
936
  },
762
937
  {
763
- "type": "BLANK"
764
- }
765
- ]
766
- },
767
- {
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
- }
938
+ "type": "STRING",
939
+ "value": ":"
940
+ },
941
+ {
942
+ "type": "FIELD",
943
+ "name": "body",
944
+ "content": {
945
+ "type": "REPEAT",
946
+ "content": {
947
+ "type": "SYMBOL",
948
+ "name": "statement"
949
+ }
950
+ }
951
+ },
952
+ {
953
+ "type": "REPEAT",
954
+ "content": {
955
+ "type": "FIELD",
956
+ "name": "elif_clause",
957
+ "content": {
958
+ "type": "SYMBOL",
959
+ "name": "elif_clause"
960
+ }
961
+ }
962
+ },
963
+ {
964
+ "type": "CHOICE",
965
+ "members": [
966
+ {
967
+ "type": "FIELD",
968
+ "name": "else_body",
969
+ "content": {
970
+ "type": "SYMBOL",
971
+ "name": "else_alt_clause"
972
+ }
973
+ },
974
+ {
975
+ "type": "BLANK"
976
+ }
977
+ ]
978
+ },
979
+ {
980
+ "type": "STRING",
981
+ "value": "endif"
982
+ }
983
+ ]
984
+ },
985
+ {
986
+ "type": "SEQ",
987
+ "members": [
988
+ {
989
+ "type": "FIELD",
990
+ "name": "open",
991
+ "content": {
992
+ "type": "SYMBOL",
993
+ "name": "_stmt_open"
994
+ }
995
+ },
996
+ {
997
+ "type": "STRING",
998
+ "value": "if"
999
+ },
1000
+ {
1001
+ "type": "FIELD",
1002
+ "name": "condition",
1003
+ "content": {
1004
+ "type": "SYMBOL",
1005
+ "name": "parenthesized_expression"
1006
+ }
1007
+ },
1008
+ {
1009
+ "type": "STRING",
1010
+ "value": ":"
1011
+ },
1012
+ {
1013
+ "type": "REPEAT",
1014
+ "content": {
1015
+ "type": "SYMBOL",
1016
+ "name": "statement"
1017
+ }
1018
+ },
1019
+ {
1020
+ "type": "FIELD",
1021
+ "name": "close",
1022
+ "content": {
1023
+ "type": "SYMBOL",
1024
+ "name": "_stmt_close"
1025
+ }
1026
+ },
1027
+ {
1028
+ "type": "REPEAT",
1029
+ "content": {
1030
+ "type": "SYMBOL",
1031
+ "name": "_if_markup_node"
1032
+ }
1033
+ },
1034
+ {
1035
+ "type": "FIELD",
1036
+ "name": "end_open",
1037
+ "content": {
1038
+ "type": "SYMBOL",
1039
+ "name": "_stmt_open"
1040
+ }
1041
+ },
1042
+ {
1043
+ "type": "STRING",
1044
+ "value": "endif"
1045
+ },
1046
+ {
1047
+ "type": "FIELD",
1048
+ "name": "end_close",
1049
+ "content": {
1050
+ "type": "SYMBOL",
1051
+ "name": "_stmt_close"
1052
+ }
1053
+ }
1054
+ ]
1055
+ }
1056
+ ]
1057
+ },
1058
+ "_if_markup_node": {
1059
+ "type": "CHOICE",
1060
+ "members": [
1061
+ {
1062
+ "type": "SYMBOL",
1063
+ "name": "_markup_node"
1064
+ },
1065
+ {
1066
+ "type": "SYMBOL",
1067
+ "name": "elif_clause_tag"
1068
+ },
1069
+ {
1070
+ "type": "SYMBOL",
1071
+ "name": "else_alt_clause_tag"
1072
+ }
1073
+ ]
1074
+ },
1075
+ "_stmt_open": {
1076
+ "type": "CHOICE",
1077
+ "members": [
1078
+ {
1079
+ "type": "SYMBOL",
1080
+ "name": "statement_tag_open"
1081
+ },
1082
+ {
1083
+ "type": "SYMBOL",
1084
+ "name": "statement_tag_trim_open"
1085
+ },
1086
+ {
1087
+ "type": "SYMBOL",
1088
+ "name": "statement_tag_lstrip_open"
1089
+ }
1090
+ ]
1091
+ },
1092
+ "_stmt_close": {
1093
+ "type": "CHOICE",
1094
+ "members": [
1095
+ {
1096
+ "type": "SYMBOL",
1097
+ "name": "statement_tag_close"
1098
+ },
1099
+ {
1100
+ "type": "SYMBOL",
1101
+ "name": "statement_tag_trim_close"
1102
+ }
1103
+ ]
1104
+ },
1105
+ "_expr_open": {
1106
+ "type": "CHOICE",
1107
+ "members": [
1108
+ {
1109
+ "type": "SYMBOL",
1110
+ "name": "expression_tag_open"
1111
+ },
1112
+ {
1113
+ "type": "SYMBOL",
1114
+ "name": "expression_tag_trim_open"
1115
+ }
1116
+ ]
1117
+ },
1118
+ "_expr_close": {
1119
+ "type": "CHOICE",
1120
+ "members": [
1121
+ {
1122
+ "type": "SYMBOL",
1123
+ "name": "expression_tag_close"
1124
+ },
1125
+ {
1126
+ "type": "SYMBOL",
1127
+ "name": "expression_tag_trim_close"
1128
+ }
1129
+ ]
1130
+ },
1131
+ "elif_clause": {
1132
+ "type": "SEQ",
1133
+ "members": [
1134
+ {
1135
+ "type": "STRING",
1136
+ "value": "elif"
1137
+ },
1138
+ {
1139
+ "type": "FIELD",
1140
+ "name": "condition",
1141
+ "content": {
1142
+ "type": "SYMBOL",
1143
+ "name": "parenthesized_expression"
1144
+ }
787
1145
  },
788
1146
  {
789
1147
  "type": "STRING",
@@ -802,6 +1160,43 @@
802
1160
  }
803
1161
  ]
804
1162
  },
1163
+ "elif_clause_tag": {
1164
+ "type": "SEQ",
1165
+ "members": [
1166
+ {
1167
+ "type": "FIELD",
1168
+ "name": "open",
1169
+ "content": {
1170
+ "type": "SYMBOL",
1171
+ "name": "_stmt_open"
1172
+ }
1173
+ },
1174
+ {
1175
+ "type": "STRING",
1176
+ "value": "elif"
1177
+ },
1178
+ {
1179
+ "type": "FIELD",
1180
+ "name": "condition",
1181
+ "content": {
1182
+ "type": "SYMBOL",
1183
+ "name": "parenthesized_expression"
1184
+ }
1185
+ },
1186
+ {
1187
+ "type": "STRING",
1188
+ "value": ":"
1189
+ },
1190
+ {
1191
+ "type": "FIELD",
1192
+ "name": "close",
1193
+ "content": {
1194
+ "type": "SYMBOL",
1195
+ "name": "_stmt_close"
1196
+ }
1197
+ }
1198
+ ]
1199
+ },
805
1200
  "else_alt_clause": {
806
1201
  "type": "SEQ",
807
1202
  "members": [
@@ -822,6 +1217,31 @@
822
1217
  }
823
1218
  ]
824
1219
  },
1220
+ "else_alt_clause_tag": {
1221
+ "type": "SEQ",
1222
+ "members": [
1223
+ {
1224
+ "type": "FIELD",
1225
+ "name": "open",
1226
+ "content": {
1227
+ "type": "SYMBOL",
1228
+ "name": "_stmt_open"
1229
+ }
1230
+ },
1231
+ {
1232
+ "type": "STRING",
1233
+ "value": "else"
1234
+ },
1235
+ {
1236
+ "type": "FIELD",
1237
+ "name": "close",
1238
+ "content": {
1239
+ "type": "SYMBOL",
1240
+ "name": "_stmt_close"
1241
+ }
1242
+ }
1243
+ ]
1244
+ },
825
1245
  "switch_statement": {
826
1246
  "type": "SEQ",
827
1247
  "members": [
@@ -958,176 +1378,501 @@
958
1378
  ]
959
1379
  },
960
1380
  "for_alt_statement": {
961
- "type": "SEQ",
1381
+ "type": "CHOICE",
962
1382
  "members": [
963
1383
  {
964
1384
  "type": "SEQ",
965
1385
  "members": [
966
1386
  {
967
- "type": "STRING",
968
- "value": "for"
969
- },
970
- {
971
- "type": "STRING",
972
- "value": "("
973
- },
974
- {
975
- "type": "CHOICE",
1387
+ "type": "SEQ",
976
1388
  "members": [
977
1389
  {
978
- "type": "FIELD",
979
- "name": "initializer",
980
- "content": {
981
- "type": "SYMBOL",
982
- "name": "lexical_declaration"
983
- }
1390
+ "type": "STRING",
1391
+ "value": "for"
984
1392
  },
985
1393
  {
986
- "type": "SEQ",
1394
+ "type": "STRING",
1395
+ "value": "("
1396
+ },
1397
+ {
1398
+ "type": "CHOICE",
987
1399
  "members": [
988
1400
  {
989
1401
  "type": "FIELD",
990
1402
  "name": "initializer",
991
1403
  "content": {
992
1404
  "type": "SYMBOL",
993
- "name": "_expressions"
1405
+ "name": "lexical_declaration"
994
1406
  }
995
1407
  },
996
1408
  {
997
- "type": "STRING",
998
- "value": ";"
999
- }
1000
- ]
1001
- },
1002
- {
1003
- "type": "FIELD",
1004
- "name": "initializer",
1005
- "content": {
1006
- "type": "SYMBOL",
1007
- "name": "empty_statement"
1409
+ "type": "SEQ",
1410
+ "members": [
1411
+ {
1412
+ "type": "FIELD",
1413
+ "name": "initializer",
1414
+ "content": {
1415
+ "type": "SYMBOL",
1416
+ "name": "_expressions"
1417
+ }
1418
+ },
1419
+ {
1420
+ "type": "STRING",
1421
+ "value": ";"
1422
+ }
1423
+ ]
1424
+ },
1425
+ {
1426
+ "type": "FIELD",
1427
+ "name": "initializer",
1428
+ "content": {
1429
+ "type": "SYMBOL",
1430
+ "name": "empty_statement"
1431
+ }
1432
+ }
1433
+ ]
1434
+ },
1435
+ {
1436
+ "type": "FIELD",
1437
+ "name": "condition",
1438
+ "content": {
1439
+ "type": "CHOICE",
1440
+ "members": [
1441
+ {
1442
+ "type": "SEQ",
1443
+ "members": [
1444
+ {
1445
+ "type": "SYMBOL",
1446
+ "name": "_expressions"
1447
+ },
1448
+ {
1449
+ "type": "STRING",
1450
+ "value": ";"
1451
+ }
1452
+ ]
1453
+ },
1454
+ {
1455
+ "type": "SYMBOL",
1456
+ "name": "empty_statement"
1457
+ }
1458
+ ]
1008
1459
  }
1460
+ },
1461
+ {
1462
+ "type": "FIELD",
1463
+ "name": "increment",
1464
+ "content": {
1465
+ "type": "CHOICE",
1466
+ "members": [
1467
+ {
1468
+ "type": "SYMBOL",
1469
+ "name": "_expressions"
1470
+ },
1471
+ {
1472
+ "type": "BLANK"
1473
+ }
1474
+ ]
1475
+ }
1476
+ },
1477
+ {
1478
+ "type": "STRING",
1479
+ "value": ")"
1009
1480
  }
1010
1481
  ]
1011
1482
  },
1483
+ {
1484
+ "type": "STRING",
1485
+ "value": ":"
1486
+ },
1012
1487
  {
1013
1488
  "type": "FIELD",
1014
- "name": "condition",
1489
+ "name": "body",
1015
1490
  "content": {
1016
- "type": "CHOICE",
1017
- "members": [
1018
- {
1019
- "type": "SEQ",
1491
+ "type": "REPEAT",
1492
+ "content": {
1493
+ "type": "SYMBOL",
1494
+ "name": "statement"
1495
+ }
1496
+ }
1497
+ },
1498
+ {
1499
+ "type": "STRING",
1500
+ "value": "endfor"
1501
+ }
1502
+ ]
1503
+ },
1504
+ {
1505
+ "type": "SEQ",
1506
+ "members": [
1507
+ {
1508
+ "type": "FIELD",
1509
+ "name": "open",
1510
+ "content": {
1511
+ "type": "SYMBOL",
1512
+ "name": "_stmt_open"
1513
+ }
1514
+ },
1515
+ {
1516
+ "type": "SEQ",
1517
+ "members": [
1518
+ {
1519
+ "type": "STRING",
1520
+ "value": "for"
1521
+ },
1522
+ {
1523
+ "type": "STRING",
1524
+ "value": "("
1525
+ },
1526
+ {
1527
+ "type": "CHOICE",
1528
+ "members": [
1529
+ {
1530
+ "type": "FIELD",
1531
+ "name": "initializer",
1532
+ "content": {
1533
+ "type": "SYMBOL",
1534
+ "name": "lexical_declaration"
1535
+ }
1536
+ },
1537
+ {
1538
+ "type": "SEQ",
1539
+ "members": [
1540
+ {
1541
+ "type": "FIELD",
1542
+ "name": "initializer",
1543
+ "content": {
1544
+ "type": "SYMBOL",
1545
+ "name": "_expressions"
1546
+ }
1547
+ },
1548
+ {
1549
+ "type": "STRING",
1550
+ "value": ";"
1551
+ }
1552
+ ]
1553
+ },
1554
+ {
1555
+ "type": "FIELD",
1556
+ "name": "initializer",
1557
+ "content": {
1558
+ "type": "SYMBOL",
1559
+ "name": "empty_statement"
1560
+ }
1561
+ }
1562
+ ]
1563
+ },
1564
+ {
1565
+ "type": "FIELD",
1566
+ "name": "condition",
1567
+ "content": {
1568
+ "type": "CHOICE",
1569
+ "members": [
1570
+ {
1571
+ "type": "SEQ",
1572
+ "members": [
1573
+ {
1574
+ "type": "SYMBOL",
1575
+ "name": "_expressions"
1576
+ },
1577
+ {
1578
+ "type": "STRING",
1579
+ "value": ";"
1580
+ }
1581
+ ]
1582
+ },
1583
+ {
1584
+ "type": "SYMBOL",
1585
+ "name": "empty_statement"
1586
+ }
1587
+ ]
1588
+ }
1589
+ },
1590
+ {
1591
+ "type": "FIELD",
1592
+ "name": "increment",
1593
+ "content": {
1594
+ "type": "CHOICE",
1020
1595
  "members": [
1021
1596
  {
1022
1597
  "type": "SYMBOL",
1023
1598
  "name": "_expressions"
1024
1599
  },
1025
1600
  {
1026
- "type": "STRING",
1027
- "value": ";"
1601
+ "type": "BLANK"
1028
1602
  }
1029
1603
  ]
1030
- },
1031
- {
1032
- "type": "SYMBOL",
1033
- "name": "empty_statement"
1034
1604
  }
1035
- ]
1605
+ },
1606
+ {
1607
+ "type": "STRING",
1608
+ "value": ")"
1609
+ }
1610
+ ]
1611
+ },
1612
+ {
1613
+ "type": "STRING",
1614
+ "value": ":"
1615
+ },
1616
+ {
1617
+ "type": "REPEAT",
1618
+ "content": {
1619
+ "type": "SYMBOL",
1620
+ "name": "statement"
1621
+ }
1622
+ },
1623
+ {
1624
+ "type": "FIELD",
1625
+ "name": "close",
1626
+ "content": {
1627
+ "type": "SYMBOL",
1628
+ "name": "_stmt_close"
1629
+ }
1630
+ },
1631
+ {
1632
+ "type": "FIELD",
1633
+ "name": "body",
1634
+ "content": {
1635
+ "type": "REPEAT",
1636
+ "content": {
1637
+ "type": "SYMBOL",
1638
+ "name": "_markup_node"
1639
+ }
1640
+ }
1641
+ },
1642
+ {
1643
+ "type": "FIELD",
1644
+ "name": "end_open",
1645
+ "content": {
1646
+ "type": "SYMBOL",
1647
+ "name": "_stmt_open"
1648
+ }
1649
+ },
1650
+ {
1651
+ "type": "STRING",
1652
+ "value": "endfor"
1653
+ },
1654
+ {
1655
+ "type": "FIELD",
1656
+ "name": "end_close",
1657
+ "content": {
1658
+ "type": "SYMBOL",
1659
+ "name": "_stmt_close"
1660
+ }
1661
+ }
1662
+ ]
1663
+ }
1664
+ ]
1665
+ },
1666
+ "for_in_statement": {
1667
+ "type": "SEQ",
1668
+ "members": [
1669
+ {
1670
+ "type": "STRING",
1671
+ "value": "for"
1672
+ },
1673
+ {
1674
+ "type": "SYMBOL",
1675
+ "name": "_for_header"
1676
+ },
1677
+ {
1678
+ "type": "FIELD",
1679
+ "name": "body",
1680
+ "content": {
1681
+ "type": "SYMBOL",
1682
+ "name": "statement"
1683
+ }
1684
+ }
1685
+ ]
1686
+ },
1687
+ "for_in_alt_statement": {
1688
+ "type": "CHOICE",
1689
+ "members": [
1690
+ {
1691
+ "type": "SEQ",
1692
+ "members": [
1693
+ {
1694
+ "type": "STRING",
1695
+ "value": "for"
1696
+ },
1697
+ {
1698
+ "type": "SYMBOL",
1699
+ "name": "_for_header"
1700
+ },
1701
+ {
1702
+ "type": "STRING",
1703
+ "value": ":"
1704
+ },
1705
+ {
1706
+ "type": "FIELD",
1707
+ "name": "body",
1708
+ "content": {
1709
+ "type": "REPEAT",
1710
+ "content": {
1711
+ "type": "SYMBOL",
1712
+ "name": "statement"
1713
+ }
1714
+ }
1715
+ },
1716
+ {
1717
+ "type": "STRING",
1718
+ "value": "endfor"
1719
+ }
1720
+ ]
1721
+ },
1722
+ {
1723
+ "type": "SEQ",
1724
+ "members": [
1725
+ {
1726
+ "type": "FIELD",
1727
+ "name": "open",
1728
+ "content": {
1729
+ "type": "SYMBOL",
1730
+ "name": "_stmt_open"
1731
+ }
1732
+ },
1733
+ {
1734
+ "type": "STRING",
1735
+ "value": "for"
1736
+ },
1737
+ {
1738
+ "type": "SYMBOL",
1739
+ "name": "_for_header"
1740
+ },
1741
+ {
1742
+ "type": "STRING",
1743
+ "value": ":"
1744
+ },
1745
+ {
1746
+ "type": "REPEAT",
1747
+ "content": {
1748
+ "type": "SYMBOL",
1749
+ "name": "statement"
1750
+ }
1751
+ },
1752
+ {
1753
+ "type": "FIELD",
1754
+ "name": "close",
1755
+ "content": {
1756
+ "type": "SYMBOL",
1757
+ "name": "_stmt_close"
1758
+ }
1759
+ },
1760
+ {
1761
+ "type": "FIELD",
1762
+ "name": "body",
1763
+ "content": {
1764
+ "type": "REPEAT",
1765
+ "content": {
1766
+ "type": "SYMBOL",
1767
+ "name": "_markup_node"
1768
+ }
1769
+ }
1770
+ },
1771
+ {
1772
+ "type": "FIELD",
1773
+ "name": "end_open",
1774
+ "content": {
1775
+ "type": "SYMBOL",
1776
+ "name": "_stmt_open"
1777
+ }
1778
+ },
1779
+ {
1780
+ "type": "STRING",
1781
+ "value": "endfor"
1782
+ },
1783
+ {
1784
+ "type": "FIELD",
1785
+ "name": "end_close",
1786
+ "content": {
1787
+ "type": "SYMBOL",
1788
+ "name": "_stmt_close"
1789
+ }
1790
+ }
1791
+ ]
1792
+ },
1793
+ {
1794
+ "type": "SEQ",
1795
+ "members": [
1796
+ {
1797
+ "type": "FIELD",
1798
+ "name": "open",
1799
+ "content": {
1800
+ "type": "SYMBOL",
1801
+ "name": "_stmt_open"
1802
+ }
1803
+ },
1804
+ {
1805
+ "type": "STRING",
1806
+ "value": "for"
1807
+ },
1808
+ {
1809
+ "type": "SYMBOL",
1810
+ "name": "_for_header"
1811
+ },
1812
+ {
1813
+ "type": "STRING",
1814
+ "value": ":"
1815
+ },
1816
+ {
1817
+ "type": "STRING",
1818
+ "value": "for"
1819
+ },
1820
+ {
1821
+ "type": "SYMBOL",
1822
+ "name": "_for_header"
1823
+ },
1824
+ {
1825
+ "type": "STRING",
1826
+ "value": ":"
1827
+ },
1828
+ {
1829
+ "type": "FIELD",
1830
+ "name": "close",
1831
+ "content": {
1832
+ "type": "SYMBOL",
1833
+ "name": "_stmt_close"
1036
1834
  }
1037
1835
  },
1038
1836
  {
1039
1837
  "type": "FIELD",
1040
- "name": "increment",
1838
+ "name": "body",
1041
1839
  "content": {
1042
- "type": "CHOICE",
1043
- "members": [
1044
- {
1045
- "type": "SYMBOL",
1046
- "name": "_expressions"
1047
- },
1048
- {
1049
- "type": "BLANK"
1050
- }
1051
- ]
1840
+ "type": "REPEAT",
1841
+ "content": {
1842
+ "type": "SYMBOL",
1843
+ "name": "_markup_node"
1844
+ }
1845
+ }
1846
+ },
1847
+ {
1848
+ "type": "FIELD",
1849
+ "name": "end_open",
1850
+ "content": {
1851
+ "type": "SYMBOL",
1852
+ "name": "_stmt_open"
1052
1853
  }
1053
1854
  },
1054
1855
  {
1055
1856
  "type": "STRING",
1056
- "value": ")"
1857
+ "value": "endfor"
1858
+ },
1859
+ {
1860
+ "type": "STRING",
1861
+ "value": ";"
1862
+ },
1863
+ {
1864
+ "type": "STRING",
1865
+ "value": "endfor"
1866
+ },
1867
+ {
1868
+ "type": "FIELD",
1869
+ "name": "end_close",
1870
+ "content": {
1871
+ "type": "SYMBOL",
1872
+ "name": "_stmt_close"
1873
+ }
1057
1874
  }
1058
1875
  ]
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
1876
  }
1132
1877
  ]
1133
1878
  },
@@ -1280,38 +2025,118 @@
1280
2025
  ]
1281
2026
  },
1282
2027
  "while_alt_statement": {
1283
- "type": "SEQ",
2028
+ "type": "CHOICE",
1284
2029
  "members": [
1285
2030
  {
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"
2031
+ "type": "SEQ",
2032
+ "members": [
2033
+ {
2034
+ "type": "STRING",
2035
+ "value": "while"
2036
+ },
2037
+ {
2038
+ "type": "FIELD",
2039
+ "name": "condition",
2040
+ "content": {
2041
+ "type": "SYMBOL",
2042
+ "name": "parenthesized_expression"
2043
+ }
2044
+ },
2045
+ {
2046
+ "type": "STRING",
2047
+ "value": ":"
2048
+ },
2049
+ {
2050
+ "type": "FIELD",
2051
+ "name": "body",
2052
+ "content": {
2053
+ "type": "REPEAT",
2054
+ "content": {
2055
+ "type": "SYMBOL",
2056
+ "name": "statement"
2057
+ }
2058
+ }
2059
+ },
2060
+ {
2061
+ "type": "STRING",
2062
+ "value": "endwhile"
1309
2063
  }
1310
- }
2064
+ ]
1311
2065
  },
1312
2066
  {
1313
- "type": "STRING",
1314
- "value": "endwhile"
2067
+ "type": "SEQ",
2068
+ "members": [
2069
+ {
2070
+ "type": "FIELD",
2071
+ "name": "open",
2072
+ "content": {
2073
+ "type": "SYMBOL",
2074
+ "name": "_stmt_open"
2075
+ }
2076
+ },
2077
+ {
2078
+ "type": "STRING",
2079
+ "value": "while"
2080
+ },
2081
+ {
2082
+ "type": "FIELD",
2083
+ "name": "condition",
2084
+ "content": {
2085
+ "type": "SYMBOL",
2086
+ "name": "parenthesized_expression"
2087
+ }
2088
+ },
2089
+ {
2090
+ "type": "STRING",
2091
+ "value": ":"
2092
+ },
2093
+ {
2094
+ "type": "REPEAT",
2095
+ "content": {
2096
+ "type": "SYMBOL",
2097
+ "name": "statement"
2098
+ }
2099
+ },
2100
+ {
2101
+ "type": "FIELD",
2102
+ "name": "close",
2103
+ "content": {
2104
+ "type": "SYMBOL",
2105
+ "name": "_stmt_close"
2106
+ }
2107
+ },
2108
+ {
2109
+ "type": "FIELD",
2110
+ "name": "body",
2111
+ "content": {
2112
+ "type": "REPEAT",
2113
+ "content": {
2114
+ "type": "SYMBOL",
2115
+ "name": "_markup_node"
2116
+ }
2117
+ }
2118
+ },
2119
+ {
2120
+ "type": "FIELD",
2121
+ "name": "end_open",
2122
+ "content": {
2123
+ "type": "SYMBOL",
2124
+ "name": "_stmt_open"
2125
+ }
2126
+ },
2127
+ {
2128
+ "type": "STRING",
2129
+ "value": "endwhile"
2130
+ },
2131
+ {
2132
+ "type": "FIELD",
2133
+ "name": "end_close",
2134
+ "content": {
2135
+ "type": "SYMBOL",
2136
+ "name": "_stmt_close"
2137
+ }
2138
+ }
2139
+ ]
1315
2140
  }
1316
2141
  ]
1317
2142
  },
@@ -4806,6 +5631,46 @@
4806
5631
  {
4807
5632
  "type": "SYMBOL",
4808
5633
  "name": "_ternary_qmark"
5634
+ },
5635
+ {
5636
+ "type": "SYMBOL",
5637
+ "name": "raw_text"
5638
+ },
5639
+ {
5640
+ "type": "SYMBOL",
5641
+ "name": "statement_tag_open"
5642
+ },
5643
+ {
5644
+ "type": "SYMBOL",
5645
+ "name": "statement_tag_trim_open"
5646
+ },
5647
+ {
5648
+ "type": "SYMBOL",
5649
+ "name": "statement_tag_lstrip_open"
5650
+ },
5651
+ {
5652
+ "type": "SYMBOL",
5653
+ "name": "statement_tag_close"
5654
+ },
5655
+ {
5656
+ "type": "SYMBOL",
5657
+ "name": "statement_tag_trim_close"
5658
+ },
5659
+ {
5660
+ "type": "SYMBOL",
5661
+ "name": "expression_tag_open"
5662
+ },
5663
+ {
5664
+ "type": "SYMBOL",
5665
+ "name": "expression_tag_trim_open"
5666
+ },
5667
+ {
5668
+ "type": "SYMBOL",
5669
+ "name": "expression_tag_close"
5670
+ },
5671
+ {
5672
+ "type": "SYMBOL",
5673
+ "name": "expression_tag_trim_close"
4809
5674
  }
4810
5675
  ],
4811
5676
  "inline": [
@@ -4815,7 +5680,13 @@
4815
5680
  "_semicolon",
4816
5681
  "_identifier",
4817
5682
  "_reserved_identifier",
4818
- "_lhs_expression"
5683
+ "_lhs_expression",
5684
+ "_markup_node",
5685
+ "_if_markup_node",
5686
+ "_stmt_open",
5687
+ "_stmt_close",
5688
+ "_expr_open",
5689
+ "_expr_close"
4819
5690
  ],
4820
5691
  "supertypes": [
4821
5692
  "statement",