authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2026-07-07 13:57:24+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2026-07-08 11:49:02+02:00
log5bafdbf9d8d8006cb1e3a7f3e69b059c58443489
tree6e03e3cc19d2f2ce8faab5b982eb8590c69dc0d7
parent296b39c32324d536b13fe92fef42a7cca3487d35
signaturelock-open Commit is signed but in an unrecognized format.

tools/gen_parser_oracle: gen recursion guards for all defs

More rules are being made recursive for efficiency reasons, see the previous commit.

2 files changed, 1386 insertions(+), 34 deletions(-)

lib/std/zig/parser_generated_oracle.zig+1359-10
......@@ -10,16 +10,291 @@ const max_depth = 5;
1010/// the grammar.
1111/// Returns error.MaxDepth if more than `max_depth` levels of recursion/iteration are reached.
1212pub fn parse(source: []const u8) Error!bool {
13 var p: Parser = .{ .source = source, .i = 0, .expr_depth = 1, .block_depth = 1 };
13 var p: Parser = .{ .source = source, .i = 0, .depths = @splat(1) };
1414 return p.parseRoot();
1515}
16
16const Def = enum {
17 defRoot,
18 defContainerMembers,
19 defContainerDecl,
20 defContainerDeclPrefix,
21 defTestDecl,
22 defComptimeDecl,
23 defDecl,
24 defDeclPrefix,
25 defFnProto,
26 defVarDeclProto,
27 defGlobalVarDecl,
28 defContainerField,
29 defBlockStatement,
30 defStatement,
31 defStatementPrefix,
32 defIfStatement,
33 defLabeledStatement,
34 defLoopStatement,
35 defForStatement,
36 defWhileStatement,
37 defBlockExprStatement,
38 defBlockExprPrefix,
39 defBlockExpr,
40 defVarAssignStatement,
41 defAssignExpr,
42 defSingleAssignExpr,
43 defExpr,
44 defBoolOrExpr,
45 defBoolAndExpr,
46 defCompareExpr,
47 defBitwiseExpr,
48 defBitShiftExpr,
49 defAdditionExpr,
50 defMultiplyExpr,
51 defPrefixExpr,
52 defPrimaryExpr,
53 defIfExpr,
54 defBlock,
55 defLoopExpr,
56 defForExpr,
57 defWhileExpr,
58 defCurlySuffixExpr,
59 defInitList,
60 defTypeExpr,
61 defErrorUnionExpr,
62 defSuffixExpr,
63 defPrimaryTypeExpr,
64 defContainerType,
65 defErrorSetDecl,
66 defGroupedExpr,
67 defIfTypeExpr,
68 defLabeledTypeExpr,
69 defLoopTypeExpr,
70 defForTypeExpr,
71 defWhileTypeExpr,
72 defSwitchExpr,
73 defAsmExpr,
74 defAsmOutput,
75 defAsmOutputItem,
76 defAsmInput,
77 defAsmInputItem,
78 defAsmClobbers,
79 defBreakLabel,
80 defBlockLabel,
81 defFieldInit,
82 defWhileContinueExpr,
83 defLinkSection,
84 defAddrSpace,
85 defCallConv,
86 defParamDecl,
87 defParamType,
88 defIfPrefix,
89 defWhilePrefix,
90 defForPrefix,
91 defPayload,
92 defPtrPayload,
93 defPtrIndexPayload,
94 defPtrListPayload,
95 defSwitchProng,
96 defSwitchCase,
97 defSwitchItem,
98 defForArgumentsList,
99 defForItem,
100 defAssignOp,
101 defOrOp,
102 defAndOp,
103 defCompareOp,
104 defCompareOpTok,
105 defBitwiseOp,
106 defBitwiseOpTok,
107 defBitShiftOp,
108 defBitShiftOpTok,
109 defAdditionOp,
110 defAdditionOpTok,
111 defMultiplyOp,
112 defMultiplyOpTok,
113 defPrefixOp,
114 defPrefixTypeOp,
115 defPtrMods,
116 defSinglePtrMods,
117 defPtrMod,
118 defPrefixTypeOpPrefix,
119 defSuffixOp,
120 defSuffixOpPrefix,
121 defFnCallArguments,
122 defSliceTypeStart,
123 defSinglePtrTypeStart,
124 defManyPtrTypeStart,
125 defArrayTypeStart,
126 defContainerTypeAuto,
127 defContainerTypeKind,
128 defByteAlign,
129 defBitAlign,
130 defIdentifierList,
131 defSwitchProngList,
132 defAsmOutputList,
133 defAsmInputList,
134 defParamDeclList,
135 defParamDeclListRest,
136 defExprList,
137 defExprPrefix,
138 defbyte_order_mark,
139 defsof,
140 defeof,
141 defox80_oxBF,
142 defoxF4,
143 defox80_ox8F,
144 defoxF1_oxF3,
145 defoxF0,
146 defox90_0xBF,
147 defoxEE_oxEF,
148 defoxED,
149 defox80_ox9F,
150 defoxE1_oxEC,
151 defoxE0,
152 defoxA0_oxBF,
153 defoxC2_oxDF,
154 defmultibyte_utf8,
155 defnon_control_ascii,
156 defnon_control_utf8,
157 defchar_char,
158 defstring_char,
159 defcontainer_doc_comment,
160 defdoc_comment,
161 defline_comment,
162 defline_string,
163 defnewline,
164 defskip,
165 defskip_require_newline,
166 defpre_op_white,
167 defpost_op_white,
168 defCHAR_LITERAL,
169 defdigit,
170 defdigit_int,
171 defdigit_float,
172 defNUMBERLITERAL,
173 defstring,
174 defSTRINGLITERALSINGLE,
175 defSTRINGLITERAL,
176 defIDENTIFIER,
177 defBUILTINIDENTIFIER,
178 defAMPERSAND,
179 defAMPERSANDEQUAL,
180 defASTERISK,
181 defASTERISKEQUAL,
182 defASTERISKPERCENT,
183 defASTERISKPERCENTEQUAL,
184 defASTERISKPIPE,
185 defASTERISKPIPEEQUAL,
186 defCARET,
187 defCARETEQUAL,
188 defCOLON,
189 defCOMMA,
190 defDOT,
191 defDOT2,
192 defDOT3,
193 defDOTASTERISK,
194 defEQUAL,
195 defEQUALEQUAL,
196 defEQUALRARROW,
197 defEXCLAMATIONMARK,
198 defEXCLAMATIONMARKEQUAL,
199 defLARROW,
200 defLARROW2,
201 defLARROW2EQUAL,
202 defLARROW2PIPE,
203 defLARROW2PIPEEQUAL,
204 defLARROWEQUAL,
205 defLBRACE,
206 defLBRACKET,
207 defLPAREN,
208 defMINUS,
209 defMINUSEQUAL,
210 defMINUSPERCENT,
211 defMINUSPERCENTEQUAL,
212 defMINUSPIPE,
213 defMINUSPIPEEQUAL,
214 defMINUSRARROW,
215 defPERCENT,
216 defPERCENTEQUAL,
217 defPIPE,
218 defPIPE2,
219 defPIPEEQUAL,
220 defPLUS,
221 defPLUS2,
222 defPLUSEQUAL,
223 defPLUSPERCENT,
224 defPLUSPERCENTEQUAL,
225 defPLUSPIPE,
226 defPLUSPIPEEQUAL,
227 defLETTERC,
228 defQUESTIONMARK,
229 defRARROW,
230 defRARROW2,
231 defRARROW2EQUAL,
232 defRARROWEQUAL,
233 defRBRACE,
234 defRBRACKET,
235 defRPAREN,
236 defSEMICOLON,
237 defSLASH,
238 defSLASHEQUAL,
239 defTILDE,
240 defend_of_word,
241 defKEYWORD_addrspace,
242 defKEYWORD_align,
243 defKEYWORD_allowzero,
244 defKEYWORD_and,
245 defKEYWORD_anyframe,
246 defKEYWORD_anytype,
247 defKEYWORD_asm,
248 defKEYWORD_break,
249 defKEYWORD_callconv,
250 defKEYWORD_catch,
251 defKEYWORD_comptime,
252 defKEYWORD_const,
253 defKEYWORD_continue,
254 defKEYWORD_defer,
255 defKEYWORD_else,
256 defKEYWORD_enum,
257 defKEYWORD_errdefer,
258 defKEYWORD_error,
259 defKEYWORD_export,
260 defKEYWORD_extern,
261 defKEYWORD_fn,
262 defKEYWORD_for,
263 defKEYWORD_if,
264 defKEYWORD_inline,
265 defKEYWORD_noalias,
266 defKEYWORD_nosuspend,
267 defKEYWORD_noinline,
268 defKEYWORD_opaque,
269 defKEYWORD_or,
270 defKEYWORD_orelse,
271 defKEYWORD_packed,
272 defKEYWORD_pub,
273 defKEYWORD_resume,
274 defKEYWORD_return,
275 defKEYWORD_linksection,
276 defKEYWORD_struct,
277 defKEYWORD_suspend,
278 defKEYWORD_switch,
279 defKEYWORD_test,
280 defKEYWORD_threadlocal,
281 defKEYWORD_try,
282 defKEYWORD_union,
283 defKEYWORD_unreachable,
284 defKEYWORD_var,
285 defKEYWORD_volatile,
286 defKEYWORD_while,
287 defkeyword,
288};
17289const Parser = struct {
18290 source: []const u8,
19291 i: usize,
20 expr_depth: usize,
21 block_depth: usize,
292 depths: [271]u8,
22293 pub fn parseRoot(p: *Parser) Error!bool {
294 const def_index = @intFromEnum(Def.defRoot);
295 if (p.depths[def_index] > max_depth) return error.MaxDepth;
296 p.depths[def_index] += 1;
297 defer p.depths[def_index] -= 1;
23298 return blk_0: {
24299 const pos_0 = p.i;
25300 if (try p.parseContainerMembers() and try p.parseskip() and try p.parseeof()) break :blk_0 true;
......@@ -28,6 +303,10 @@ const Parser = struct {
28303 };
29304 }
30305 pub fn parseContainerMembers(p: *Parser) Error!bool {
306 const def_index = @intFromEnum(Def.defContainerMembers);
307 if (p.depths[def_index] > max_depth) return error.MaxDepth;
308 p.depths[def_index] += 1;
309 defer p.depths[def_index] -= 1;
31310 return blk_0: {
32311 const pos_0 = p.i;
33312 if ((try p.parsecontainer_doc_comment() or true) and blk_1: {
......@@ -84,6 +363,10 @@ const Parser = struct {
84363 };
85364 }
86365 pub fn parseContainerDecl(p: *Parser) Error!bool {
366 const def_index = @intFromEnum(Def.defContainerDecl);
367 if (p.depths[def_index] > max_depth) return error.MaxDepth;
368 p.depths[def_index] += 1;
369 defer p.depths[def_index] -= 1;
87370 return blk_0: {
88371 const pos_0 = p.i;
89372 if (try p.parseTestDecl()) break :blk_0 true;
......@@ -96,6 +379,10 @@ const Parser = struct {
96379 };
97380 }
98381 pub fn parseContainerDeclPrefix(p: *Parser) Error!bool {
382 const def_index = @intFromEnum(Def.defContainerDeclPrefix);
383 if (p.depths[def_index] > max_depth) return error.MaxDepth;
384 p.depths[def_index] += 1;
385 defer p.depths[def_index] -= 1;
99386 return blk_0: {
100387 const pos_0 = p.i;
101388 if (try p.parseKEYWORD_test()) break :blk_0 true;
......@@ -108,6 +395,10 @@ const Parser = struct {
108395 };
109396 }
110397 pub fn parseTestDecl(p: *Parser) Error!bool {
398 const def_index = @intFromEnum(Def.defTestDecl);
399 if (p.depths[def_index] > max_depth) return error.MaxDepth;
400 p.depths[def_index] += 1;
401 defer p.depths[def_index] -= 1;
111402 return blk_0: {
112403 const pos_0 = p.i;
113404 if (try p.parseKEYWORD_test() and (blk_3: {
......@@ -123,6 +414,10 @@ const Parser = struct {
123414 };
124415 }
125416 pub fn parseComptimeDecl(p: *Parser) Error!bool {
417 const def_index = @intFromEnum(Def.defComptimeDecl);
418 if (p.depths[def_index] > max_depth) return error.MaxDepth;
419 p.depths[def_index] += 1;
420 defer p.depths[def_index] -= 1;
126421 return blk_0: {
127422 const pos_0 = p.i;
128423 if (try p.parseKEYWORD_comptime() and try p.parseBlock()) break :blk_0 true;
......@@ -131,6 +426,10 @@ const Parser = struct {
131426 };
132427 }
133428 pub fn parseDecl(p: *Parser) Error!bool {
429 const def_index = @intFromEnum(Def.defDecl);
430 if (p.depths[def_index] > max_depth) return error.MaxDepth;
431 p.depths[def_index] += 1;
432 defer p.depths[def_index] -= 1;
134433 return blk_0: {
135434 const pos_0 = p.i;
136435 if ((blk_3: {
......@@ -166,6 +465,10 @@ const Parser = struct {
166465 };
167466 }
168467 pub fn parseDeclPrefix(p: *Parser) Error!bool {
468 const def_index = @intFromEnum(Def.defDeclPrefix);
469 if (p.depths[def_index] > max_depth) return error.MaxDepth;
470 p.depths[def_index] += 1;
471 defer p.depths[def_index] -= 1;
169472 return blk_0: {
170473 const pos_0 = p.i;
171474 if ((blk_3: {
......@@ -201,6 +504,10 @@ const Parser = struct {
201504 };
202505 }
203506 pub fn parseFnProto(p: *Parser) Error!bool {
507 const def_index = @intFromEnum(Def.defFnProto);
508 if (p.depths[def_index] > max_depth) return error.MaxDepth;
509 p.depths[def_index] += 1;
510 defer p.depths[def_index] -= 1;
204511 return blk_0: {
205512 const pos_0 = p.i;
206513 if (try p.parseKEYWORD_fn() and (try p.parseIDENTIFIER() or true) and try p.parseParamDeclList() and (try p.parseByteAlign() or true) and (try p.parseAddrSpace() or true) and (try p.parseLinkSection() or true) and (try p.parseCallConv() or true) and (try p.parseEXCLAMATIONMARK() or true) and try p.parseTypeExpr()) break :blk_0 true;
......@@ -209,6 +516,10 @@ const Parser = struct {
209516 };
210517 }
211518 pub fn parseVarDeclProto(p: *Parser) Error!bool {
519 const def_index = @intFromEnum(Def.defVarDeclProto);
520 if (p.depths[def_index] > max_depth) return error.MaxDepth;
521 p.depths[def_index] += 1;
522 defer p.depths[def_index] -= 1;
212523 return blk_0: {
213524 const pos_0 = p.i;
214525 if (blk_2: {
......@@ -229,6 +540,10 @@ const Parser = struct {
229540 };
230541 }
231542 pub fn parseGlobalVarDecl(p: *Parser) Error!bool {
543 const def_index = @intFromEnum(Def.defGlobalVarDecl);
544 if (p.depths[def_index] > max_depth) return error.MaxDepth;
545 p.depths[def_index] += 1;
546 defer p.depths[def_index] -= 1;
232547 return blk_0: {
233548 const pos_0 = p.i;
234549 if (try p.parseVarDeclProto() and (blk_3: {
......@@ -242,6 +557,10 @@ const Parser = struct {
242557 };
243558 }
244559 pub fn parseContainerField(p: *Parser) Error!bool {
560 const def_index = @intFromEnum(Def.defContainerField);
561 if (p.depths[def_index] > max_depth) return error.MaxDepth;
562 p.depths[def_index] += 1;
563 defer p.depths[def_index] -= 1;
245564 return blk_0: {
246565 const pos_0 = p.i;
247566 if ((try p.parsedoc_comment() or true) and (try p.parseKEYWORD_comptime() or true) and (blk_3: {
......@@ -260,6 +579,10 @@ const Parser = struct {
260579 };
261580 }
262581 pub fn parseBlockStatement(p: *Parser) Error!bool {
582 const def_index = @intFromEnum(Def.defBlockStatement);
583 if (p.depths[def_index] > max_depth) return error.MaxDepth;
584 p.depths[def_index] += 1;
585 defer p.depths[def_index] -= 1;
263586 return blk_0: {
264587 const pos_0 = p.i;
265588 if (try p.parseStatement()) break :blk_0 true;
......@@ -279,6 +602,10 @@ const Parser = struct {
279602 };
280603 }
281604 pub fn parseStatement(p: *Parser) Error!bool {
605 const def_index = @intFromEnum(Def.defStatement);
606 if (p.depths[def_index] > max_depth) return error.MaxDepth;
607 p.depths[def_index] += 1;
608 defer p.depths[def_index] -= 1;
282609 return blk_0: {
283610 const pos_0 = p.i;
284611 if (try p.parseIfStatement()) break :blk_0 true;
......@@ -302,6 +629,10 @@ const Parser = struct {
302629 };
303630 }
304631 pub fn parseStatementPrefix(p: *Parser) Error!bool {
632 const def_index = @intFromEnum(Def.defStatementPrefix);
633 if (p.depths[def_index] > max_depth) return error.MaxDepth;
634 p.depths[def_index] += 1;
635 defer p.depths[def_index] -= 1;
305636 return blk_0: {
306637 const pos_0 = p.i;
307638 if (try p.parseKEYWORD_if()) break :blk_0 true;
......@@ -332,6 +663,10 @@ const Parser = struct {
332663 };
333664 }
334665 pub fn parseIfStatement(p: *Parser) Error!bool {
666 const def_index = @intFromEnum(Def.defIfStatement);
667 if (p.depths[def_index] > max_depth) return error.MaxDepth;
668 p.depths[def_index] += 1;
669 defer p.depths[def_index] -= 1;
335670 return blk_0: {
336671 const pos_0 = p.i;
337672 if (try p.parseIfPrefix() and try p.parseBlockExpr() and blk_2: {
......@@ -366,6 +701,10 @@ const Parser = struct {
366701 };
367702 }
368703 pub fn parseLabeledStatement(p: *Parser) Error!bool {
704 const def_index = @intFromEnum(Def.defLabeledStatement);
705 if (p.depths[def_index] > max_depth) return error.MaxDepth;
706 p.depths[def_index] += 1;
707 defer p.depths[def_index] -= 1;
369708 return blk_0: {
370709 const pos_0 = p.i;
371710 if ((try p.parseBlockLabel() or true) and blk_2: {
......@@ -383,6 +722,10 @@ const Parser = struct {
383722 };
384723 }
385724 pub fn parseLoopStatement(p: *Parser) Error!bool {
725 const def_index = @intFromEnum(Def.defLoopStatement);
726 if (p.depths[def_index] > max_depth) return error.MaxDepth;
727 p.depths[def_index] += 1;
728 defer p.depths[def_index] -= 1;
386729 return blk_0: {
387730 const pos_0 = p.i;
388731 if ((try p.parseKEYWORD_inline() or true) and blk_2: {
......@@ -398,6 +741,10 @@ const Parser = struct {
398741 };
399742 }
400743 pub fn parseForStatement(p: *Parser) Error!bool {
744 const def_index = @intFromEnum(Def.defForStatement);
745 if (p.depths[def_index] > max_depth) return error.MaxDepth;
746 p.depths[def_index] += 1;
747 defer p.depths[def_index] -= 1;
401748 return blk_0: {
402749 const pos_0 = p.i;
403750 if (try p.parseForPrefix() and try p.parseBlockExpr() and blk_2: {
......@@ -432,6 +779,10 @@ const Parser = struct {
432779 };
433780 }
434781 pub fn parseWhileStatement(p: *Parser) Error!bool {
782 const def_index = @intFromEnum(Def.defWhileStatement);
783 if (p.depths[def_index] > max_depth) return error.MaxDepth;
784 p.depths[def_index] += 1;
785 defer p.depths[def_index] -= 1;
435786 return blk_0: {
436787 const pos_0 = p.i;
437788 if (try p.parseWhilePrefix() and try p.parseBlockExpr() and blk_2: {
......@@ -466,6 +817,10 @@ const Parser = struct {
466817 };
467818 }
468819 pub fn parseBlockExprStatement(p: *Parser) Error!bool {
820 const def_index = @intFromEnum(Def.defBlockExprStatement);
821 if (p.depths[def_index] > max_depth) return error.MaxDepth;
822 p.depths[def_index] += 1;
823 defer p.depths[def_index] -= 1;
469824 return blk_0: {
470825 const pos_0 = p.i;
471826 if (try p.parseBlockExpr()) break :blk_0 true;
......@@ -481,6 +836,10 @@ const Parser = struct {
481836 };
482837 }
483838 pub fn parseBlockExprPrefix(p: *Parser) Error!bool {
839 const def_index = @intFromEnum(Def.defBlockExprPrefix);
840 if (p.depths[def_index] > max_depth) return error.MaxDepth;
841 p.depths[def_index] += 1;
842 defer p.depths[def_index] -= 1;
484843 return blk_0: {
485844 const pos_0 = p.i;
486845 if ((try p.parseBlockLabel() or true) and try p.parseLBRACE()) break :blk_0 true;
......@@ -489,6 +848,10 @@ const Parser = struct {
489848 };
490849 }
491850 pub fn parseBlockExpr(p: *Parser) Error!bool {
851 const def_index = @intFromEnum(Def.defBlockExpr);
852 if (p.depths[def_index] > max_depth) return error.MaxDepth;
853 p.depths[def_index] += 1;
854 defer p.depths[def_index] -= 1;
492855 return blk_0: {
493856 const pos_0 = p.i;
494857 if ((try p.parseBlockLabel() or true) and try p.parseBlock()) break :blk_0 true;
......@@ -497,6 +860,10 @@ const Parser = struct {
497860 };
498861 }
499862 pub fn parseVarAssignStatement(p: *Parser) Error!bool {
863 const def_index = @intFromEnum(Def.defVarAssignStatement);
864 if (p.depths[def_index] > max_depth) return error.MaxDepth;
865 p.depths[def_index] += 1;
866 defer p.depths[def_index] -= 1;
500867 return blk_0: {
501868 const pos_0 = p.i;
502869 if (blk_2: {
......@@ -531,6 +898,10 @@ const Parser = struct {
531898 };
532899 }
533900 pub fn parseAssignExpr(p: *Parser) Error!bool {
901 const def_index = @intFromEnum(Def.defAssignExpr);
902 if (p.depths[def_index] > max_depth) return error.MaxDepth;
903 p.depths[def_index] += 1;
904 defer p.depths[def_index] -= 1;
534905 return blk_0: {
535906 const pos_0 = p.i;
536907 if (try p.parseExpr() and blk_2: {
......@@ -572,6 +943,10 @@ const Parser = struct {
572943 };
573944 }
574945 pub fn parseSingleAssignExpr(p: *Parser) Error!bool {
946 const def_index = @intFromEnum(Def.defSingleAssignExpr);
947 if (p.depths[def_index] > max_depth) return error.MaxDepth;
948 p.depths[def_index] += 1;
949 defer p.depths[def_index] -= 1;
575950 return blk_0: {
576951 const pos_0 = p.i;
577952 if (try p.parseExpr() and blk_2: {
......@@ -592,9 +967,10 @@ const Parser = struct {
592967 };
593968 }
594969 pub fn parseExpr(p: *Parser) Error!bool {
595 if (p.expr_depth >= max_depth) return error.MaxDepth;
596 p.expr_depth += 1;
597 defer p.expr_depth -= 1;
970 const def_index = @intFromEnum(Def.defExpr);
971 if (p.depths[def_index] > max_depth) return error.MaxDepth;
972 p.depths[def_index] += 1;
973 defer p.depths[def_index] -= 1;
598974 return blk_0: {
599975 const pos_0 = p.i;
600976 if (try p.parseBoolOrExpr()) break :blk_0 true;
......@@ -603,6 +979,10 @@ const Parser = struct {
603979 };
604980 }
605981 pub fn parseBoolOrExpr(p: *Parser) Error!bool {
982 const def_index = @intFromEnum(Def.defBoolOrExpr);
983 if (p.depths[def_index] > max_depth) return error.MaxDepth;
984 p.depths[def_index] += 1;
985 defer p.depths[def_index] -= 1;
606986 return blk_0: {
607987 const pos_0 = p.i;
608988 if (try p.parseBoolAndExpr() and blk_1: {
......@@ -628,6 +1008,10 @@ const Parser = struct {
6281008 };
6291009 }
6301010 pub fn parseBoolAndExpr(p: *Parser) Error!bool {
1011 const def_index = @intFromEnum(Def.defBoolAndExpr);
1012 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1013 p.depths[def_index] += 1;
1014 defer p.depths[def_index] -= 1;
6311015 return blk_0: {
6321016 const pos_0 = p.i;
6331017 if (try p.parseCompareExpr() and blk_1: {
......@@ -653,6 +1037,10 @@ const Parser = struct {
6531037 };
6541038 }
6551039 pub fn parseCompareExpr(p: *Parser) Error!bool {
1040 const def_index = @intFromEnum(Def.defCompareExpr);
1041 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1042 p.depths[def_index] += 1;
1043 defer p.depths[def_index] -= 1;
6561044 return blk_0: {
6571045 const pos_0 = p.i;
6581046 if (try p.parseBitwiseExpr() and (blk_3: {
......@@ -671,6 +1059,10 @@ const Parser = struct {
6711059 };
6721060 }
6731061 pub fn parseBitwiseExpr(p: *Parser) Error!bool {
1062 const def_index = @intFromEnum(Def.defBitwiseExpr);
1063 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1064 p.depths[def_index] += 1;
1065 defer p.depths[def_index] -= 1;
6741066 return blk_0: {
6751067 const pos_0 = p.i;
6761068 if (try p.parseBitShiftExpr() and blk_1: {
......@@ -696,6 +1088,10 @@ const Parser = struct {
6961088 };
6971089 }
6981090 pub fn parseBitShiftExpr(p: *Parser) Error!bool {
1091 const def_index = @intFromEnum(Def.defBitShiftExpr);
1092 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1093 p.depths[def_index] += 1;
1094 defer p.depths[def_index] -= 1;
6991095 return blk_0: {
7001096 const pos_0 = p.i;
7011097 if (try p.parseAdditionExpr() and blk_1: {
......@@ -721,6 +1117,10 @@ const Parser = struct {
7211117 };
7221118 }
7231119 pub fn parseAdditionExpr(p: *Parser) Error!bool {
1120 const def_index = @intFromEnum(Def.defAdditionExpr);
1121 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1122 p.depths[def_index] += 1;
1123 defer p.depths[def_index] -= 1;
7241124 return blk_0: {
7251125 const pos_0 = p.i;
7261126 if (try p.parseMultiplyExpr() and blk_1: {
......@@ -746,6 +1146,10 @@ const Parser = struct {
7461146 };
7471147 }
7481148 pub fn parseMultiplyExpr(p: *Parser) Error!bool {
1149 const def_index = @intFromEnum(Def.defMultiplyExpr);
1150 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1151 p.depths[def_index] += 1;
1152 defer p.depths[def_index] -= 1;
7491153 return blk_0: {
7501154 const pos_0 = p.i;
7511155 if (try p.parsePrefixExpr() and blk_1: {
......@@ -771,6 +1175,10 @@ const Parser = struct {
7711175 };
7721176 }
7731177 pub fn parsePrefixExpr(p: *Parser) Error!bool {
1178 const def_index = @intFromEnum(Def.defPrefixExpr);
1179 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1180 p.depths[def_index] += 1;
1181 defer p.depths[def_index] -= 1;
7741182 return blk_0: {
7751183 const pos_0 = p.i;
7761184 if (blk_1: {
......@@ -791,6 +1199,10 @@ const Parser = struct {
7911199 };
7921200 }
7931201 pub fn parsePrimaryExpr(p: *Parser) Error!bool {
1202 const def_index = @intFromEnum(Def.defPrimaryExpr);
1203 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1204 p.depths[def_index] += 1;
1205 defer p.depths[def_index] -= 1;
7941206 return blk_0: {
7951207 const pos_0 = p.i;
7961208 if (try p.parseAsmExpr()) break :blk_0 true;
......@@ -855,6 +1267,10 @@ const Parser = struct {
8551267 };
8561268 }
8571269 pub fn parseIfExpr(p: *Parser) Error!bool {
1270 const def_index = @intFromEnum(Def.defIfExpr);
1271 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1272 p.depths[def_index] += 1;
1273 defer p.depths[def_index] -= 1;
8581274 return blk_0: {
8591275 const pos_0 = p.i;
8601276 if (try p.parseIfPrefix() and try p.parseExpr() and blk_2: {
......@@ -875,9 +1291,10 @@ const Parser = struct {
8751291 };
8761292 }
8771293 pub fn parseBlock(p: *Parser) Error!bool {
878 if (p.block_depth >= max_depth) return error.MaxDepth;
879 p.block_depth += 1;
880 defer p.block_depth -= 1;
1294 const def_index = @intFromEnum(Def.defBlock);
1295 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1296 p.depths[def_index] += 1;
1297 defer p.depths[def_index] -= 1;
8811298 return blk_0: {
8821299 const pos_0 = p.i;
8831300 if (try p.parseLBRACE() and blk_1: {
......@@ -893,6 +1310,10 @@ const Parser = struct {
8931310 };
8941311 }
8951312 pub fn parseLoopExpr(p: *Parser) Error!bool {
1313 const def_index = @intFromEnum(Def.defLoopExpr);
1314 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1315 p.depths[def_index] += 1;
1316 defer p.depths[def_index] -= 1;
8961317 return blk_0: {
8971318 const pos_0 = p.i;
8981319 if ((try p.parseKEYWORD_inline() or true) and blk_2: {
......@@ -908,6 +1329,10 @@ const Parser = struct {
9081329 };
9091330 }
9101331 pub fn parseForExpr(p: *Parser) Error!bool {
1332 const def_index = @intFromEnum(Def.defForExpr);
1333 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1334 p.depths[def_index] += 1;
1335 defer p.depths[def_index] -= 1;
9111336 return blk_0: {
9121337 const pos_0 = p.i;
9131338 if (try p.parseForPrefix() and try p.parseExpr() and blk_2: {
......@@ -928,6 +1353,10 @@ const Parser = struct {
9281353 };
9291354 }
9301355 pub fn parseWhileExpr(p: *Parser) Error!bool {
1356 const def_index = @intFromEnum(Def.defWhileExpr);
1357 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1358 p.depths[def_index] += 1;
1359 defer p.depths[def_index] -= 1;
9311360 return blk_0: {
9321361 const pos_0 = p.i;
9331362 if (try p.parseWhilePrefix() and try p.parseExpr() and (blk_3: {
......@@ -941,6 +1370,10 @@ const Parser = struct {
9411370 };
9421371 }
9431372 pub fn parseCurlySuffixExpr(p: *Parser) Error!bool {
1373 const def_index = @intFromEnum(Def.defCurlySuffixExpr);
1374 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1375 p.depths[def_index] += 1;
1376 defer p.depths[def_index] -= 1;
9441377 return blk_0: {
9451378 const pos_0 = p.i;
9461379 if (try p.parseTypeExpr() and blk_2: {
......@@ -961,6 +1394,10 @@ const Parser = struct {
9611394 };
9621395 }
9631396 pub fn parseInitList(p: *Parser) Error!bool {
1397 const def_index = @intFromEnum(Def.defInitList);
1398 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1399 p.depths[def_index] += 1;
1400 defer p.depths[def_index] -= 1;
9641401 return blk_0: {
9651402 const pos_0 = p.i;
9661403 if (try p.parseLBRACE() and try p.parseFieldInit() and blk_1: {
......@@ -997,6 +1434,10 @@ const Parser = struct {
9971434 };
9981435 }
9991436 pub fn parseTypeExpr(p: *Parser) Error!bool {
1437 const def_index = @intFromEnum(Def.defTypeExpr);
1438 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1439 p.depths[def_index] += 1;
1440 defer p.depths[def_index] -= 1;
10001441 return blk_0: {
10011442 const pos_0 = p.i;
10021443 if (blk_1: {
......@@ -1017,6 +1458,10 @@ const Parser = struct {
10171458 };
10181459 }
10191460 pub fn parseErrorUnionExpr(p: *Parser) Error!bool {
1461 const def_index = @intFromEnum(Def.defErrorUnionExpr);
1462 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1463 p.depths[def_index] += 1;
1464 defer p.depths[def_index] -= 1;
10201465 return blk_0: {
10211466 const pos_0 = p.i;
10221467 if (try p.parseSuffixExpr() and blk_2: {
......@@ -1037,6 +1482,10 @@ const Parser = struct {
10371482 };
10381483 }
10391484 pub fn parseSuffixExpr(p: *Parser) Error!bool {
1485 const def_index = @intFromEnum(Def.defSuffixExpr);
1486 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1487 p.depths[def_index] += 1;
1488 defer p.depths[def_index] -= 1;
10401489 return blk_0: {
10411490 const pos_0 = p.i;
10421491 if (try p.parsePrimaryTypeExpr() and blk_1: {
......@@ -1057,6 +1506,10 @@ const Parser = struct {
10571506 };
10581507 }
10591508 pub fn parsePrimaryTypeExpr(p: *Parser) Error!bool {
1509 const def_index = @intFromEnum(Def.defPrimaryTypeExpr);
1510 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1511 p.depths[def_index] += 1;
1512 defer p.depths[def_index] -= 1;
10601513 return blk_0: {
10611514 const pos_0 = p.i;
10621515 if (try p.parseBUILTINIDENTIFIER() and try p.parseFnCallArguments()) break :blk_0 true;
......@@ -1097,6 +1550,10 @@ const Parser = struct {
10971550 };
10981551 }
10991552 pub fn parseContainerType(p: *Parser) Error!bool {
1553 const def_index = @intFromEnum(Def.defContainerType);
1554 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1555 p.depths[def_index] += 1;
1556 defer p.depths[def_index] -= 1;
11001557 return blk_0: {
11011558 const pos_0 = p.i;
11021559 if ((blk_3: {
......@@ -1112,6 +1569,10 @@ const Parser = struct {
11121569 };
11131570 }
11141571 pub fn parseErrorSetDecl(p: *Parser) Error!bool {
1572 const def_index = @intFromEnum(Def.defErrorSetDecl);
1573 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1574 p.depths[def_index] += 1;
1575 defer p.depths[def_index] -= 1;
11151576 return blk_0: {
11161577 const pos_0 = p.i;
11171578 if (try p.parseKEYWORD_error() and try p.parseLBRACE() and try p.parseIdentifierList() and try p.parseRBRACE()) break :blk_0 true;
......@@ -1120,6 +1581,10 @@ const Parser = struct {
11201581 };
11211582 }
11221583 pub fn parseGroupedExpr(p: *Parser) Error!bool {
1584 const def_index = @intFromEnum(Def.defGroupedExpr);
1585 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1586 p.depths[def_index] += 1;
1587 defer p.depths[def_index] -= 1;
11231588 return blk_0: {
11241589 const pos_0 = p.i;
11251590 if (try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_0 true;
......@@ -1128,6 +1593,10 @@ const Parser = struct {
11281593 };
11291594 }
11301595 pub fn parseIfTypeExpr(p: *Parser) Error!bool {
1596 const def_index = @intFromEnum(Def.defIfTypeExpr);
1597 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1598 p.depths[def_index] += 1;
1599 defer p.depths[def_index] -= 1;
11311600 return blk_0: {
11321601 const pos_0 = p.i;
11331602 if (try p.parseIfPrefix() and try p.parseTypeExpr() and blk_2: {
......@@ -1148,6 +1617,10 @@ const Parser = struct {
11481617 };
11491618 }
11501619 pub fn parseLabeledTypeExpr(p: *Parser) Error!bool {
1620 const def_index = @intFromEnum(Def.defLabeledTypeExpr);
1621 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1622 p.depths[def_index] += 1;
1623 defer p.depths[def_index] -= 1;
11511624 return blk_0: {
11521625 const pos_0 = p.i;
11531626 if (try p.parseBlockLabel() and try p.parseBlock()) break :blk_0 true;
......@@ -1160,6 +1633,10 @@ const Parser = struct {
11601633 };
11611634 }
11621635 pub fn parseLoopTypeExpr(p: *Parser) Error!bool {
1636 const def_index = @intFromEnum(Def.defLoopTypeExpr);
1637 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1638 p.depths[def_index] += 1;
1639 defer p.depths[def_index] -= 1;
11631640 return blk_0: {
11641641 const pos_0 = p.i;
11651642 if ((try p.parseKEYWORD_inline() or true) and blk_2: {
......@@ -1175,6 +1652,10 @@ const Parser = struct {
11751652 };
11761653 }
11771654 pub fn parseForTypeExpr(p: *Parser) Error!bool {
1655 const def_index = @intFromEnum(Def.defForTypeExpr);
1656 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1657 p.depths[def_index] += 1;
1658 defer p.depths[def_index] -= 1;
11781659 return blk_0: {
11791660 const pos_0 = p.i;
11801661 if (try p.parseForPrefix() and try p.parseTypeExpr() and blk_2: {
......@@ -1195,6 +1676,10 @@ const Parser = struct {
11951676 };
11961677 }
11971678 pub fn parseWhileTypeExpr(p: *Parser) Error!bool {
1679 const def_index = @intFromEnum(Def.defWhileTypeExpr);
1680 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1681 p.depths[def_index] += 1;
1682 defer p.depths[def_index] -= 1;
11981683 return blk_0: {
11991684 const pos_0 = p.i;
12001685 if (try p.parseWhilePrefix() and try p.parseTypeExpr() and blk_2: {
......@@ -1215,6 +1700,10 @@ const Parser = struct {
12151700 };
12161701 }
12171702 pub fn parseSwitchExpr(p: *Parser) Error!bool {
1703 const def_index = @intFromEnum(Def.defSwitchExpr);
1704 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1705 p.depths[def_index] += 1;
1706 defer p.depths[def_index] -= 1;
12181707 return blk_0: {
12191708 const pos_0 = p.i;
12201709 if (try p.parseKEYWORD_switch() and try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN() and try p.parseLBRACE() and try p.parseSwitchProngList() and try p.parseRBRACE()) break :blk_0 true;
......@@ -1223,6 +1712,10 @@ const Parser = struct {
12231712 };
12241713 }
12251714 pub fn parseAsmExpr(p: *Parser) Error!bool {
1715 const def_index = @intFromEnum(Def.defAsmExpr);
1716 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1717 p.depths[def_index] += 1;
1718 defer p.depths[def_index] -= 1;
12261719 return blk_0: {
12271720 const pos_0 = p.i;
12281721 if (try p.parseKEYWORD_asm() and (try p.parseKEYWORD_volatile() or true) and try p.parseLPAREN() and try p.parseExpr() and (try p.parseAsmOutput() or true) and try p.parseRPAREN()) break :blk_0 true;
......@@ -1231,6 +1724,10 @@ const Parser = struct {
12311724 };
12321725 }
12331726 pub fn parseAsmOutput(p: *Parser) Error!bool {
1727 const def_index = @intFromEnum(Def.defAsmOutput);
1728 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1729 p.depths[def_index] += 1;
1730 defer p.depths[def_index] -= 1;
12341731 return blk_0: {
12351732 const pos_0 = p.i;
12361733 if (try p.parseCOLON() and try p.parseAsmOutputList() and (try p.parseAsmInput() or true)) break :blk_0 true;
......@@ -1239,6 +1736,10 @@ const Parser = struct {
12391736 };
12401737 }
12411738 pub fn parseAsmOutputItem(p: *Parser) Error!bool {
1739 const def_index = @intFromEnum(Def.defAsmOutputItem);
1740 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1741 p.depths[def_index] += 1;
1742 defer p.depths[def_index] -= 1;
12421743 return blk_0: {
12431744 const pos_0 = p.i;
12441745 if (try p.parseLBRACKET() and try p.parseIDENTIFIER() and try p.parseRBRACKET() and try p.parseSTRINGLITERALSINGLE() and try p.parseLPAREN() and blk_2: {
......@@ -1254,6 +1755,10 @@ const Parser = struct {
12541755 };
12551756 }
12561757 pub fn parseAsmInput(p: *Parser) Error!bool {
1758 const def_index = @intFromEnum(Def.defAsmInput);
1759 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1760 p.depths[def_index] += 1;
1761 defer p.depths[def_index] -= 1;
12571762 return blk_0: {
12581763 const pos_0 = p.i;
12591764 if (try p.parseCOLON() and try p.parseAsmInputList() and (try p.parseAsmClobbers() or true)) break :blk_0 true;
......@@ -1262,6 +1767,10 @@ const Parser = struct {
12621767 };
12631768 }
12641769 pub fn parseAsmInputItem(p: *Parser) Error!bool {
1770 const def_index = @intFromEnum(Def.defAsmInputItem);
1771 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1772 p.depths[def_index] += 1;
1773 defer p.depths[def_index] -= 1;
12651774 return blk_0: {
12661775 const pos_0 = p.i;
12671776 if (try p.parseLBRACKET() and try p.parseIDENTIFIER() and try p.parseRBRACKET() and try p.parseSTRINGLITERALSINGLE() and try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_0 true;
......@@ -1270,6 +1779,10 @@ const Parser = struct {
12701779 };
12711780 }
12721781 pub fn parseAsmClobbers(p: *Parser) Error!bool {
1782 const def_index = @intFromEnum(Def.defAsmClobbers);
1783 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1784 p.depths[def_index] += 1;
1785 defer p.depths[def_index] -= 1;
12731786 return blk_0: {
12741787 const pos_0 = p.i;
12751788 if (try p.parseCOLON() and try p.parseExpr()) break :blk_0 true;
......@@ -1278,6 +1791,10 @@ const Parser = struct {
12781791 };
12791792 }
12801793 pub fn parseBreakLabel(p: *Parser) Error!bool {
1794 const def_index = @intFromEnum(Def.defBreakLabel);
1795 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1796 p.depths[def_index] += 1;
1797 defer p.depths[def_index] -= 1;
12811798 return blk_0: {
12821799 const pos_0 = p.i;
12831800 if (try p.parseCOLON() and try p.parseIDENTIFIER()) break :blk_0 true;
......@@ -1286,6 +1803,10 @@ const Parser = struct {
12861803 };
12871804 }
12881805 pub fn parseBlockLabel(p: *Parser) Error!bool {
1806 const def_index = @intFromEnum(Def.defBlockLabel);
1807 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1808 p.depths[def_index] += 1;
1809 defer p.depths[def_index] -= 1;
12891810 return blk_0: {
12901811 const pos_0 = p.i;
12911812 if (try p.parseIDENTIFIER() and try p.parseCOLON()) break :blk_0 true;
......@@ -1294,6 +1815,10 @@ const Parser = struct {
12941815 };
12951816 }
12961817 pub fn parseFieldInit(p: *Parser) Error!bool {
1818 const def_index = @intFromEnum(Def.defFieldInit);
1819 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1820 p.depths[def_index] += 1;
1821 defer p.depths[def_index] -= 1;
12971822 return blk_0: {
12981823 const pos_0 = p.i;
12991824 if (try p.parseDOT() and try p.parseIDENTIFIER() and try p.parseEQUAL() and try p.parseExpr()) break :blk_0 true;
......@@ -1302,6 +1827,10 @@ const Parser = struct {
13021827 };
13031828 }
13041829 pub fn parseWhileContinueExpr(p: *Parser) Error!bool {
1830 const def_index = @intFromEnum(Def.defWhileContinueExpr);
1831 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1832 p.depths[def_index] += 1;
1833 defer p.depths[def_index] -= 1;
13051834 return blk_0: {
13061835 const pos_0 = p.i;
13071836 if (try p.parseCOLON() and try p.parseLPAREN() and try p.parseAssignExpr() and try p.parseRPAREN()) break :blk_0 true;
......@@ -1310,6 +1839,10 @@ const Parser = struct {
13101839 };
13111840 }
13121841 pub fn parseLinkSection(p: *Parser) Error!bool {
1842 const def_index = @intFromEnum(Def.defLinkSection);
1843 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1844 p.depths[def_index] += 1;
1845 defer p.depths[def_index] -= 1;
13131846 return blk_0: {
13141847 const pos_0 = p.i;
13151848 if (try p.parseKEYWORD_linksection() and try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_0 true;
......@@ -1318,6 +1851,10 @@ const Parser = struct {
13181851 };
13191852 }
13201853 pub fn parseAddrSpace(p: *Parser) Error!bool {
1854 const def_index = @intFromEnum(Def.defAddrSpace);
1855 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1856 p.depths[def_index] += 1;
1857 defer p.depths[def_index] -= 1;
13211858 return blk_0: {
13221859 const pos_0 = p.i;
13231860 if (try p.parseKEYWORD_addrspace() and try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_0 true;
......@@ -1326,6 +1863,10 @@ const Parser = struct {
13261863 };
13271864 }
13281865 pub fn parseCallConv(p: *Parser) Error!bool {
1866 const def_index = @intFromEnum(Def.defCallConv);
1867 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1868 p.depths[def_index] += 1;
1869 defer p.depths[def_index] -= 1;
13291870 return blk_0: {
13301871 const pos_0 = p.i;
13311872 if (try p.parseKEYWORD_callconv() and try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_0 true;
......@@ -1334,6 +1875,10 @@ const Parser = struct {
13341875 };
13351876 }
13361877 pub fn parseParamDecl(p: *Parser) Error!bool {
1878 const def_index = @intFromEnum(Def.defParamDecl);
1879 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1880 p.depths[def_index] += 1;
1881 defer p.depths[def_index] -= 1;
13371882 return blk_0: {
13381883 const pos_0 = p.i;
13391884 if ((try p.parsedoc_comment() or true) and blk_2: {
......@@ -1354,6 +1899,10 @@ const Parser = struct {
13541899 };
13551900 }
13561901 pub fn parseParamType(p: *Parser) Error!bool {
1902 const def_index = @intFromEnum(Def.defParamType);
1903 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1904 p.depths[def_index] += 1;
1905 defer p.depths[def_index] -= 1;
13571906 return blk_0: {
13581907 const pos_0 = p.i;
13591908 if (try p.parseKEYWORD_anytype()) break :blk_0 true;
......@@ -1364,6 +1913,10 @@ const Parser = struct {
13641913 };
13651914 }
13661915 pub fn parseIfPrefix(p: *Parser) Error!bool {
1916 const def_index = @intFromEnum(Def.defIfPrefix);
1917 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1918 p.depths[def_index] += 1;
1919 defer p.depths[def_index] -= 1;
13671920 return blk_0: {
13681921 const pos_0 = p.i;
13691922 if (try p.parseKEYWORD_if() and try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN() and (try p.parsePtrPayload() or true)) break :blk_0 true;
......@@ -1372,6 +1925,10 @@ const Parser = struct {
13721925 };
13731926 }
13741927 pub fn parseWhilePrefix(p: *Parser) Error!bool {
1928 const def_index = @intFromEnum(Def.defWhilePrefix);
1929 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1930 p.depths[def_index] += 1;
1931 defer p.depths[def_index] -= 1;
13751932 return blk_0: {
13761933 const pos_0 = p.i;
13771934 if (try p.parseKEYWORD_while() and try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN() and (try p.parsePtrPayload() or true) and (try p.parseWhileContinueExpr() or true)) break :blk_0 true;
......@@ -1380,6 +1937,10 @@ const Parser = struct {
13801937 };
13811938 }
13821939 pub fn parseForPrefix(p: *Parser) Error!bool {
1940 const def_index = @intFromEnum(Def.defForPrefix);
1941 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1942 p.depths[def_index] += 1;
1943 defer p.depths[def_index] -= 1;
13831944 return blk_0: {
13841945 const pos_0 = p.i;
13851946 if (try p.parseKEYWORD_for() and try p.parseLPAREN() and try p.parseForArgumentsList() and try p.parseRPAREN() and try p.parsePtrListPayload()) break :blk_0 true;
......@@ -1388,6 +1949,10 @@ const Parser = struct {
13881949 };
13891950 }
13901951 pub fn parsePayload(p: *Parser) Error!bool {
1952 const def_index = @intFromEnum(Def.defPayload);
1953 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1954 p.depths[def_index] += 1;
1955 defer p.depths[def_index] -= 1;
13911956 return blk_0: {
13921957 const pos_0 = p.i;
13931958 if (try p.parsePIPE() and try p.parseIDENTIFIER() and try p.parsePIPE()) break :blk_0 true;
......@@ -1396,6 +1961,10 @@ const Parser = struct {
13961961 };
13971962 }
13981963 pub fn parsePtrPayload(p: *Parser) Error!bool {
1964 const def_index = @intFromEnum(Def.defPtrPayload);
1965 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1966 p.depths[def_index] += 1;
1967 defer p.depths[def_index] -= 1;
13991968 return blk_0: {
14001969 const pos_0 = p.i;
14011970 if (try p.parsePIPE() and (try p.parseASTERISK() or true) and try p.parseIDENTIFIER() and try p.parsePIPE()) break :blk_0 true;
......@@ -1404,6 +1973,10 @@ const Parser = struct {
14041973 };
14051974 }
14061975 pub fn parsePtrIndexPayload(p: *Parser) Error!bool {
1976 const def_index = @intFromEnum(Def.defPtrIndexPayload);
1977 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1978 p.depths[def_index] += 1;
1979 defer p.depths[def_index] -= 1;
14071980 return blk_0: {
14081981 const pos_0 = p.i;
14091982 if (try p.parsePIPE() and (try p.parseASTERISK() or true) and try p.parseIDENTIFIER() and (blk_3: {
......@@ -1417,6 +1990,10 @@ const Parser = struct {
14171990 };
14181991 }
14191992 pub fn parsePtrListPayload(p: *Parser) Error!bool {
1993 const def_index = @intFromEnum(Def.defPtrListPayload);
1994 if (p.depths[def_index] > max_depth) return error.MaxDepth;
1995 p.depths[def_index] += 1;
1996 defer p.depths[def_index] -= 1;
14201997 return blk_0: {
14211998 const pos_0 = p.i;
14221999 if (try p.parsePIPE() and (try p.parseASTERISK() or true) and try p.parseIDENTIFIER() and blk_1: {
......@@ -1437,6 +2014,10 @@ const Parser = struct {
14372014 };
14382015 }
14392016 pub fn parseSwitchProng(p: *Parser) Error!bool {
2017 const def_index = @intFromEnum(Def.defSwitchProng);
2018 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2019 p.depths[def_index] += 1;
2020 defer p.depths[def_index] -= 1;
14402021 return blk_0: {
14412022 const pos_0 = p.i;
14422023 if ((try p.parseKEYWORD_inline() or true) and try p.parseSwitchCase() and try p.parseEQUALRARROW() and (try p.parsePtrIndexPayload() or true) and try p.parseSingleAssignExpr()) break :blk_0 true;
......@@ -1445,6 +2026,10 @@ const Parser = struct {
14452026 };
14462027 }
14472028 pub fn parseSwitchCase(p: *Parser) Error!bool {
2029 const def_index = @intFromEnum(Def.defSwitchCase);
2030 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2031 p.depths[def_index] += 1;
2032 defer p.depths[def_index] -= 1;
14482033 return blk_0: {
14492034 const pos_0 = p.i;
14502035 if (try p.parseSwitchItem() and blk_1: {
......@@ -1467,6 +2052,10 @@ const Parser = struct {
14672052 };
14682053 }
14692054 pub fn parseSwitchItem(p: *Parser) Error!bool {
2055 const def_index = @intFromEnum(Def.defSwitchItem);
2056 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2057 p.depths[def_index] += 1;
2058 defer p.depths[def_index] -= 1;
14702059 return blk_0: {
14712060 const pos_0 = p.i;
14722061 if (try p.parseExpr() and (blk_3: {
......@@ -1480,6 +2069,10 @@ const Parser = struct {
14802069 };
14812070 }
14822071 pub fn parseForArgumentsList(p: *Parser) Error!bool {
2072 const def_index = @intFromEnum(Def.defForArgumentsList);
2073 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2074 p.depths[def_index] += 1;
2075 defer p.depths[def_index] -= 1;
14832076 return blk_0: {
14842077 const pos_0 = p.i;
14852078 if (try p.parseForItem() and blk_1: {
......@@ -1500,6 +2093,10 @@ const Parser = struct {
15002093 };
15012094 }
15022095 pub fn parseForItem(p: *Parser) Error!bool {
2096 const def_index = @intFromEnum(Def.defForItem);
2097 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2098 p.depths[def_index] += 1;
2099 defer p.depths[def_index] -= 1;
15032100 return blk_0: {
15042101 const pos_0 = p.i;
15052102 if (try p.parseExpr() and blk_2: {
......@@ -1532,6 +2129,10 @@ const Parser = struct {
15322129 };
15332130 }
15342131 pub fn parseAssignOp(p: *Parser) Error!bool {
2132 const def_index = @intFromEnum(Def.defAssignOp);
2133 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2134 p.depths[def_index] += 1;
2135 defer p.depths[def_index] -= 1;
15352136 return blk_0: {
15362137 const pos_0 = p.i;
15372138 if (try p.parseASTERISKEQUAL()) break :blk_0 true;
......@@ -1574,6 +2175,10 @@ const Parser = struct {
15742175 };
15752176 }
15762177 pub fn parseOrOp(p: *Parser) Error!bool {
2178 const def_index = @intFromEnum(Def.defOrOp);
2179 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2180 p.depths[def_index] += 1;
2181 defer p.depths[def_index] -= 1;
15772182 return blk_0: {
15782183 const pos_0 = p.i;
15792184 if (try p.parsepre_op_white() and try p.parseKEYWORD_or() and try p.parsepost_op_white()) break :blk_0 true;
......@@ -1594,6 +2199,10 @@ const Parser = struct {
15942199 };
15952200 }
15962201 pub fn parseAndOp(p: *Parser) Error!bool {
2202 const def_index = @intFromEnum(Def.defAndOp);
2203 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2204 p.depths[def_index] += 1;
2205 defer p.depths[def_index] -= 1;
15972206 return blk_0: {
15982207 const pos_0 = p.i;
15992208 if (try p.parsepre_op_white() and try p.parseKEYWORD_and() and try p.parsepost_op_white()) break :blk_0 true;
......@@ -1614,6 +2223,10 @@ const Parser = struct {
16142223 };
16152224 }
16162225 pub fn parseCompareOp(p: *Parser) Error!bool {
2226 const def_index = @intFromEnum(Def.defCompareOp);
2227 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2228 p.depths[def_index] += 1;
2229 defer p.depths[def_index] -= 1;
16172230 return blk_0: {
16182231 const pos_0 = p.i;
16192232 if (try p.parsepre_op_white() and try p.parseCompareOpTok() and try p.parsepost_op_white()) break :blk_0 true;
......@@ -1634,6 +2247,10 @@ const Parser = struct {
16342247 };
16352248 }
16362249 pub fn parseCompareOpTok(p: *Parser) Error!bool {
2250 const def_index = @intFromEnum(Def.defCompareOpTok);
2251 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2252 p.depths[def_index] += 1;
2253 defer p.depths[def_index] -= 1;
16372254 return blk_0: {
16382255 const pos_0 = p.i;
16392256 if (try p.parseEQUALEQUAL()) break :blk_0 true;
......@@ -1652,6 +2269,10 @@ const Parser = struct {
16522269 };
16532270 }
16542271 pub fn parseBitwiseOp(p: *Parser) Error!bool {
2272 const def_index = @intFromEnum(Def.defBitwiseOp);
2273 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2274 p.depths[def_index] += 1;
2275 defer p.depths[def_index] -= 1;
16552276 return blk_0: {
16562277 const pos_0 = p.i;
16572278 if (try p.parsepre_op_white() and try p.parseBitwiseOpTok() and try p.parsepost_op_white()) break :blk_0 true;
......@@ -1686,6 +2307,10 @@ const Parser = struct {
16862307 };
16872308 }
16882309 pub fn parseBitwiseOpTok(p: *Parser) Error!bool {
2310 const def_index = @intFromEnum(Def.defBitwiseOpTok);
2311 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2312 p.depths[def_index] += 1;
2313 defer p.depths[def_index] -= 1;
16892314 return blk_0: {
16902315 const pos_0 = p.i;
16912316 if (try p.parseAMPERSAND() and blk_1: {
......@@ -1712,6 +2337,10 @@ const Parser = struct {
17122337 };
17132338 }
17142339 pub fn parseBitShiftOp(p: *Parser) Error!bool {
2340 const def_index = @intFromEnum(Def.defBitShiftOp);
2341 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2342 p.depths[def_index] += 1;
2343 defer p.depths[def_index] -= 1;
17152344 return blk_0: {
17162345 const pos_0 = p.i;
17172346 if (try p.parsepre_op_white() and try p.parseBitShiftOpTok() and try p.parsepost_op_white()) break :blk_0 true;
......@@ -1732,6 +2361,10 @@ const Parser = struct {
17322361 };
17332362 }
17342363 pub fn parseBitShiftOpTok(p: *Parser) Error!bool {
2364 const def_index = @intFromEnum(Def.defBitShiftOpTok);
2365 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2366 p.depths[def_index] += 1;
2367 defer p.depths[def_index] -= 1;
17352368 return blk_0: {
17362369 const pos_0 = p.i;
17372370 if (try p.parseLARROW2()) break :blk_0 true;
......@@ -1744,6 +2377,10 @@ const Parser = struct {
17442377 };
17452378 }
17462379 pub fn parseAdditionOp(p: *Parser) Error!bool {
2380 const def_index = @intFromEnum(Def.defAdditionOp);
2381 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2382 p.depths[def_index] += 1;
2383 defer p.depths[def_index] -= 1;
17472384 return blk_0: {
17482385 const pos_0 = p.i;
17492386 if (try p.parsepre_op_white() and try p.parseAdditionOpTok() and try p.parsepost_op_white()) break :blk_0 true;
......@@ -1764,6 +2401,10 @@ const Parser = struct {
17642401 };
17652402 }
17662403 pub fn parseAdditionOpTok(p: *Parser) Error!bool {
2404 const def_index = @intFromEnum(Def.defAdditionOpTok);
2405 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2406 p.depths[def_index] += 1;
2407 defer p.depths[def_index] -= 1;
17672408 return blk_0: {
17682409 const pos_0 = p.i;
17692410 if (try p.parsePLUS()) break :blk_0 true;
......@@ -1784,6 +2425,10 @@ const Parser = struct {
17842425 };
17852426 }
17862427 pub fn parseMultiplyOp(p: *Parser) Error!bool {
2428 const def_index = @intFromEnum(Def.defMultiplyOp);
2429 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2430 p.depths[def_index] += 1;
2431 defer p.depths[def_index] -= 1;
17872432 return blk_0: {
17882433 const pos_0 = p.i;
17892434 if (try p.parsepre_op_white() and try p.parseMultiplyOpTok() and try p.parsepost_op_white()) break :blk_0 true;
......@@ -1804,6 +2449,10 @@ const Parser = struct {
18042449 };
18052450 }
18062451 pub fn parseMultiplyOpTok(p: *Parser) Error!bool {
2452 const def_index = @intFromEnum(Def.defMultiplyOpTok);
2453 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2454 p.depths[def_index] += 1;
2455 defer p.depths[def_index] -= 1;
18072456 return blk_0: {
18082457 const pos_0 = p.i;
18092458 if (try p.parsePIPE2()) break :blk_0 true;
......@@ -1822,6 +2471,10 @@ const Parser = struct {
18222471 };
18232472 }
18242473 pub fn parsePrefixOp(p: *Parser) Error!bool {
2474 const def_index = @intFromEnum(Def.defPrefixOp);
2475 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2476 p.depths[def_index] += 1;
2477 defer p.depths[def_index] -= 1;
18252478 return blk_0: {
18262479 const pos_0 = p.i;
18272480 if (try p.parseEXCLAMATIONMARK()) break :blk_0 true;
......@@ -1840,6 +2493,10 @@ const Parser = struct {
18402493 };
18412494 }
18422495 pub fn parsePrefixTypeOp(p: *Parser) Error!bool {
2496 const def_index = @intFromEnum(Def.defPrefixTypeOp);
2497 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2498 p.depths[def_index] += 1;
2499 defer p.depths[def_index] -= 1;
18432500 return blk_0: {
18442501 const pos_0 = p.i;
18452502 if (try p.parseQUESTIONMARK()) break :blk_0 true;
......@@ -1863,6 +2520,10 @@ const Parser = struct {
18632520 };
18642521 }
18652522 pub fn parsePtrMods(p: *Parser) Error!bool {
2523 const def_index = @intFromEnum(Def.defPtrMods);
2524 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2525 p.depths[def_index] += 1;
2526 defer p.depths[def_index] -= 1;
18662527 return blk_0: {
18672528 const pos_0 = p.i;
18682529 if (blk_1: {
......@@ -1925,6 +2586,10 @@ const Parser = struct {
19252586 };
19262587 }
19272588 pub fn parseSinglePtrMods(p: *Parser) Error!bool {
2589 const def_index = @intFromEnum(Def.defSinglePtrMods);
2590 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2591 p.depths[def_index] += 1;
2592 defer p.depths[def_index] -= 1;
19282593 return blk_0: {
19292594 const pos_0 = p.i;
19302595 if (blk_1: {
......@@ -1987,6 +2652,10 @@ const Parser = struct {
19872652 };
19882653 }
19892654 pub fn parsePtrMod(p: *Parser) Error!bool {
2655 const def_index = @intFromEnum(Def.defPtrMod);
2656 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2657 p.depths[def_index] += 1;
2658 defer p.depths[def_index] -= 1;
19902659 return blk_0: {
19912660 const pos_0 = p.i;
19922661 if (try p.parseKEYWORD_allowzero()) break :blk_0 true;
......@@ -1999,6 +2668,10 @@ const Parser = struct {
19992668 };
20002669 }
20012670 pub fn parsePrefixTypeOpPrefix(p: *Parser) Error!bool {
2671 const def_index = @intFromEnum(Def.defPrefixTypeOpPrefix);
2672 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2673 p.depths[def_index] += 1;
2674 defer p.depths[def_index] -= 1;
20022675 return blk_0: {
20032676 const pos_0 = p.i;
20042677 if (try p.parseQUESTIONMARK()) break :blk_0 true;
......@@ -2013,6 +2686,10 @@ const Parser = struct {
20132686 };
20142687 }
20152688 pub fn parseSuffixOp(p: *Parser) Error!bool {
2689 const def_index = @intFromEnum(Def.defSuffixOp);
2690 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2691 p.depths[def_index] += 1;
2692 defer p.depths[def_index] -= 1;
20162693 return blk_0: {
20172694 const pos_0 = p.i;
20182695 if (try p.parseLBRACKET() and try p.parseExpr() and (blk_3: {
......@@ -2051,6 +2728,10 @@ const Parser = struct {
20512728 };
20522729 }
20532730 pub fn parseSuffixOpPrefix(p: *Parser) Error!bool {
2731 const def_index = @intFromEnum(Def.defSuffixOpPrefix);
2732 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2733 p.depths[def_index] += 1;
2734 defer p.depths[def_index] -= 1;
20542735 return blk_0: {
20552736 const pos_0 = p.i;
20562737 if (try p.parseLBRACKET()) break :blk_0 true;
......@@ -2067,6 +2748,10 @@ const Parser = struct {
20672748 };
20682749 }
20692750 pub fn parseFnCallArguments(p: *Parser) Error!bool {
2751 const def_index = @intFromEnum(Def.defFnCallArguments);
2752 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2753 p.depths[def_index] += 1;
2754 defer p.depths[def_index] -= 1;
20702755 return blk_0: {
20712756 const pos_0 = p.i;
20722757 if (try p.parseLPAREN() and try p.parseExprList() and try p.parseRPAREN()) break :blk_0 true;
......@@ -2075,6 +2760,10 @@ const Parser = struct {
20752760 };
20762761 }
20772762 pub fn parseSliceTypeStart(p: *Parser) Error!bool {
2763 const def_index = @intFromEnum(Def.defSliceTypeStart);
2764 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2765 p.depths[def_index] += 1;
2766 defer p.depths[def_index] -= 1;
20782767 return blk_0: {
20792768 const pos_0 = p.i;
20802769 if (try p.parseLBRACKET() and (blk_3: {
......@@ -2088,6 +2777,10 @@ const Parser = struct {
20882777 };
20892778 }
20902779 pub fn parseSinglePtrTypeStart(p: *Parser) Error!bool {
2780 const def_index = @intFromEnum(Def.defSinglePtrTypeStart);
2781 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2782 p.depths[def_index] += 1;
2783 defer p.depths[def_index] -= 1;
20912784 return blk_0: {
20922785 const pos_0 = p.i;
20932786 if (try p.parseASTERISK()) break :blk_0 true;
......@@ -2096,6 +2789,10 @@ const Parser = struct {
20962789 };
20972790 }
20982791 pub fn parseManyPtrTypeStart(p: *Parser) Error!bool {
2792 const def_index = @intFromEnum(Def.defManyPtrTypeStart);
2793 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2794 p.depths[def_index] += 1;
2795 defer p.depths[def_index] -= 1;
20992796 return blk_0: {
21002797 const pos_0 = p.i;
21012798 if (try p.parseLBRACKET() and try p.parseASTERISK() and (blk_3: {
......@@ -2111,6 +2808,10 @@ const Parser = struct {
21112808 };
21122809 }
21132810 pub fn parseArrayTypeStart(p: *Parser) Error!bool {
2811 const def_index = @intFromEnum(Def.defArrayTypeStart);
2812 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2813 p.depths[def_index] += 1;
2814 defer p.depths[def_index] -= 1;
21142815 return blk_0: {
21152816 const pos_0 = p.i;
21162817 if (try p.parseLBRACKET() and blk_1: {
......@@ -2129,6 +2830,10 @@ const Parser = struct {
21292830 };
21302831 }
21312832 pub fn parseContainerTypeAuto(p: *Parser) Error!bool {
2833 const def_index = @intFromEnum(Def.defContainerTypeAuto);
2834 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2835 p.depths[def_index] += 1;
2836 defer p.depths[def_index] -= 1;
21322837 return blk_0: {
21332838 const pos_0 = p.i;
21342839 if (try p.parseContainerTypeKind() and try p.parseLBRACE() and try p.parseContainerMembers() and try p.parseRBRACE()) break :blk_0 true;
......@@ -2137,6 +2842,10 @@ const Parser = struct {
21372842 };
21382843 }
21392844 pub fn parseContainerTypeKind(p: *Parser) Error!bool {
2845 const def_index = @intFromEnum(Def.defContainerTypeKind);
2846 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2847 p.depths[def_index] += 1;
2848 defer p.depths[def_index] -= 1;
21402849 return blk_0: {
21412850 const pos_0 = p.i;
21422851 if (try p.parseKEYWORD_struct() and (blk_3: {
......@@ -2178,6 +2887,10 @@ const Parser = struct {
21782887 };
21792888 }
21802889 pub fn parseByteAlign(p: *Parser) Error!bool {
2890 const def_index = @intFromEnum(Def.defByteAlign);
2891 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2892 p.depths[def_index] += 1;
2893 defer p.depths[def_index] -= 1;
21812894 return blk_0: {
21822895 const pos_0 = p.i;
21832896 if (try p.parseKEYWORD_align() and try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_0 true;
......@@ -2186,6 +2899,10 @@ const Parser = struct {
21862899 };
21872900 }
21882901 pub fn parseBitAlign(p: *Parser) Error!bool {
2902 const def_index = @intFromEnum(Def.defBitAlign);
2903 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2904 p.depths[def_index] += 1;
2905 defer p.depths[def_index] -= 1;
21892906 return blk_0: {
21902907 const pos_0 = p.i;
21912908 if (try p.parseKEYWORD_align() and try p.parseLPAREN() and try p.parseExpr() and (blk_3: {
......@@ -2199,6 +2916,10 @@ const Parser = struct {
21992916 };
22002917 }
22012918 pub fn parseIdentifierList(p: *Parser) Error!bool {
2919 const def_index = @intFromEnum(Def.defIdentifierList);
2920 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2921 p.depths[def_index] += 1;
2922 defer p.depths[def_index] -= 1;
22022923 return blk_0: {
22032924 const pos_0 = p.i;
22042925 if (blk_1: {
......@@ -2224,6 +2945,10 @@ const Parser = struct {
22242945 };
22252946 }
22262947 pub fn parseSwitchProngList(p: *Parser) Error!bool {
2948 const def_index = @intFromEnum(Def.defSwitchProngList);
2949 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2950 p.depths[def_index] += 1;
2951 defer p.depths[def_index] -= 1;
22272952 return blk_0: {
22282953 const pos_0 = p.i;
22292954 if (blk_1: {
......@@ -2244,6 +2969,10 @@ const Parser = struct {
22442969 };
22452970 }
22462971 pub fn parseAsmOutputList(p: *Parser) Error!bool {
2972 const def_index = @intFromEnum(Def.defAsmOutputList);
2973 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2974 p.depths[def_index] += 1;
2975 defer p.depths[def_index] -= 1;
22472976 return blk_0: {
22482977 const pos_0 = p.i;
22492978 if (blk_1: {
......@@ -2264,6 +2993,10 @@ const Parser = struct {
22642993 };
22652994 }
22662995 pub fn parseAsmInputList(p: *Parser) Error!bool {
2996 const def_index = @intFromEnum(Def.defAsmInputList);
2997 if (p.depths[def_index] > max_depth) return error.MaxDepth;
2998 p.depths[def_index] += 1;
2999 defer p.depths[def_index] -= 1;
22673000 return blk_0: {
22683001 const pos_0 = p.i;
22693002 if (blk_1: {
......@@ -2284,6 +3017,10 @@ const Parser = struct {
22843017 };
22853018 }
22863019 pub fn parseParamDeclList(p: *Parser) Error!bool {
3020 const def_index = @intFromEnum(Def.defParamDeclList);
3021 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3022 p.depths[def_index] += 1;
3023 defer p.depths[def_index] -= 1;
22873024 return blk_0: {
22883025 const pos_0 = p.i;
22893026 if (try p.parseLPAREN() and try p.parseParamDeclListRest()) break :blk_0 true;
......@@ -2292,6 +3029,10 @@ const Parser = struct {
22923029 };
22933030 }
22943031 pub fn parseParamDeclListRest(p: *Parser) Error!bool {
3032 const def_index = @intFromEnum(Def.defParamDeclListRest);
3033 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3034 p.depths[def_index] += 1;
3035 defer p.depths[def_index] -= 1;
22953036 return blk_0: {
22963037 const pos_0 = p.i;
22973038 if (try p.parseRPAREN()) break :blk_0 true;
......@@ -2311,6 +3052,10 @@ const Parser = struct {
23113052 };
23123053 }
23133054 pub fn parseExprList(p: *Parser) Error!bool {
3055 const def_index = @intFromEnum(Def.defExprList);
3056 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3057 p.depths[def_index] += 1;
3058 defer p.depths[def_index] -= 1;
23143059 return blk_0: {
23153060 const pos_0 = p.i;
23163061 if (blk_1: {
......@@ -2343,6 +3088,10 @@ const Parser = struct {
23433088 };
23443089 }
23453090 pub fn parseExprPrefix(p: *Parser) Error!bool {
3091 const def_index = @intFromEnum(Def.defExprPrefix);
3092 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3093 p.depths[def_index] += 1;
3094 defer p.depths[def_index] -= 1;
23463095 return blk_0: {
23473096 const pos_0 = p.i;
23483097 if (try p.parseASTERISK()) break :blk_0 true;
......@@ -2351,6 +3100,10 @@ const Parser = struct {
23513100 };
23523101 }
23533102 pub fn parsebyte_order_mark(p: *Parser) Error!bool {
3103 const def_index = @intFromEnum(Def.defbyte_order_mark);
3104 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3105 p.depths[def_index] += 1;
3106 defer p.depths[def_index] -= 1;
23543107 return blk_0: {
23553108 const pos_0 = p.i;
23563109 if (blk_1: {
......@@ -2365,6 +3118,10 @@ const Parser = struct {
23653118 };
23663119 }
23673120 pub fn parsesof(p: *Parser) Error!bool {
3121 const def_index = @intFromEnum(Def.defsof);
3122 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3123 p.depths[def_index] += 1;
3124 defer p.depths[def_index] -= 1;
23683125 return blk_0: {
23693126 const pos_0 = p.i;
23703127 if ((p.i == 0) and (try p.parsebyte_order_mark() or true)) break :blk_0 true;
......@@ -2373,6 +3130,10 @@ const Parser = struct {
23733130 };
23743131 }
23753132 pub fn parseeof(p: *Parser) Error!bool {
3133 const def_index = @intFromEnum(Def.defeof);
3134 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3135 p.depths[def_index] += 1;
3136 defer p.depths[def_index] -= 1;
23763137 return blk_0: {
23773138 const pos_0 = p.i;
23783139 if (blk_1: {
......@@ -2392,6 +3153,10 @@ const Parser = struct {
23923153 };
23933154 }
23943155 pub fn parseox80_oxBF(p: *Parser) Error!bool {
3156 const def_index = @intFromEnum(Def.defox80_oxBF);
3157 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3158 p.depths[def_index] += 1;
3159 defer p.depths[def_index] -= 1;
23953160 return blk_0: {
23963161 const pos_0 = p.i;
23973162 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -2407,6 +3172,10 @@ const Parser = struct {
24073172 };
24083173 }
24093174 pub fn parseoxF4(p: *Parser) Error!bool {
3175 const def_index = @intFromEnum(Def.defoxF4);
3176 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3177 p.depths[def_index] += 1;
3178 defer p.depths[def_index] -= 1;
24103179 return blk_0: {
24113180 const pos_0 = p.i;
24123181 if (blk_1: {
......@@ -2421,6 +3190,10 @@ const Parser = struct {
24213190 };
24223191 }
24233192 pub fn parseox80_ox8F(p: *Parser) Error!bool {
3193 const def_index = @intFromEnum(Def.defox80_ox8F);
3194 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3195 p.depths[def_index] += 1;
3196 defer p.depths[def_index] -= 1;
24243197 return blk_0: {
24253198 const pos_0 = p.i;
24263199 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -2436,6 +3209,10 @@ const Parser = struct {
24363209 };
24373210 }
24383211 pub fn parseoxF1_oxF3(p: *Parser) Error!bool {
3212 const def_index = @intFromEnum(Def.defoxF1_oxF3);
3213 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3214 p.depths[def_index] += 1;
3215 defer p.depths[def_index] -= 1;
24393216 return blk_0: {
24403217 const pos_0 = p.i;
24413218 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -2451,6 +3228,10 @@ const Parser = struct {
24513228 };
24523229 }
24533230 pub fn parseoxF0(p: *Parser) Error!bool {
3231 const def_index = @intFromEnum(Def.defoxF0);
3232 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3233 p.depths[def_index] += 1;
3234 defer p.depths[def_index] -= 1;
24543235 return blk_0: {
24553236 const pos_0 = p.i;
24563237 if (blk_1: {
......@@ -2465,6 +3246,10 @@ const Parser = struct {
24653246 };
24663247 }
24673248 pub fn parseox90_0xBF(p: *Parser) Error!bool {
3249 const def_index = @intFromEnum(Def.defox90_0xBF);
3250 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3251 p.depths[def_index] += 1;
3252 defer p.depths[def_index] -= 1;
24683253 return blk_0: {
24693254 const pos_0 = p.i;
24703255 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -2480,6 +3265,10 @@ const Parser = struct {
24803265 };
24813266 }
24823267 pub fn parseoxEE_oxEF(p: *Parser) Error!bool {
3268 const def_index = @intFromEnum(Def.defoxEE_oxEF);
3269 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3270 p.depths[def_index] += 1;
3271 defer p.depths[def_index] -= 1;
24833272 return blk_0: {
24843273 const pos_0 = p.i;
24853274 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -2495,6 +3284,10 @@ const Parser = struct {
24953284 };
24963285 }
24973286 pub fn parseoxED(p: *Parser) Error!bool {
3287 const def_index = @intFromEnum(Def.defoxED);
3288 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3289 p.depths[def_index] += 1;
3290 defer p.depths[def_index] -= 1;
24983291 return blk_0: {
24993292 const pos_0 = p.i;
25003293 if (blk_1: {
......@@ -2509,6 +3302,10 @@ const Parser = struct {
25093302 };
25103303 }
25113304 pub fn parseox80_ox9F(p: *Parser) Error!bool {
3305 const def_index = @intFromEnum(Def.defox80_ox9F);
3306 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3307 p.depths[def_index] += 1;
3308 defer p.depths[def_index] -= 1;
25123309 return blk_0: {
25133310 const pos_0 = p.i;
25143311 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -2524,6 +3321,10 @@ const Parser = struct {
25243321 };
25253322 }
25263323 pub fn parseoxE1_oxEC(p: *Parser) Error!bool {
3324 const def_index = @intFromEnum(Def.defoxE1_oxEC);
3325 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3326 p.depths[def_index] += 1;
3327 defer p.depths[def_index] -= 1;
25273328 return blk_0: {
25283329 const pos_0 = p.i;
25293330 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -2539,6 +3340,10 @@ const Parser = struct {
25393340 };
25403341 }
25413342 pub fn parseoxE0(p: *Parser) Error!bool {
3343 const def_index = @intFromEnum(Def.defoxE0);
3344 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3345 p.depths[def_index] += 1;
3346 defer p.depths[def_index] -= 1;
25423347 return blk_0: {
25433348 const pos_0 = p.i;
25443349 if (blk_1: {
......@@ -2553,6 +3358,10 @@ const Parser = struct {
25533358 };
25543359 }
25553360 pub fn parseoxA0_oxBF(p: *Parser) Error!bool {
3361 const def_index = @intFromEnum(Def.defoxA0_oxBF);
3362 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3363 p.depths[def_index] += 1;
3364 defer p.depths[def_index] -= 1;
25563365 return blk_0: {
25573366 const pos_0 = p.i;
25583367 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -2568,6 +3377,10 @@ const Parser = struct {
25683377 };
25693378 }
25703379 pub fn parseoxC2_oxDF(p: *Parser) Error!bool {
3380 const def_index = @intFromEnum(Def.defoxC2_oxDF);
3381 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3382 p.depths[def_index] += 1;
3383 defer p.depths[def_index] -= 1;
25713384 return blk_0: {
25723385 const pos_0 = p.i;
25733386 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -2583,6 +3396,10 @@ const Parser = struct {
25833396 };
25843397 }
25853398 pub fn parsemultibyte_utf8(p: *Parser) Error!bool {
3399 const def_index = @intFromEnum(Def.defmultibyte_utf8);
3400 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3401 p.depths[def_index] += 1;
3402 defer p.depths[def_index] -= 1;
25863403 return blk_0: {
25873404 const pos_0 = p.i;
25883405 if (try p.parseoxF4() and try p.parseox80_ox8F() and try p.parseox80_oxBF() and try p.parseox80_oxBF()) break :blk_0 true;
......@@ -2605,6 +3422,10 @@ const Parser = struct {
26053422 };
26063423 }
26073424 pub fn parsenon_control_ascii(p: *Parser) Error!bool {
3425 const def_index = @intFromEnum(Def.defnon_control_ascii);
3426 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3427 p.depths[def_index] += 1;
3428 defer p.depths[def_index] -= 1;
26083429 return blk_0: {
26093430 const pos_0 = p.i;
26103431 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -2620,6 +3441,10 @@ const Parser = struct {
26203441 };
26213442 }
26223443 pub fn parsenon_control_utf8(p: *Parser) Error!bool {
3444 const def_index = @intFromEnum(Def.defnon_control_utf8);
3445 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3446 p.depths[def_index] += 1;
3447 defer p.depths[def_index] -= 1;
26233448 return blk_0: {
26243449 const pos_0 = p.i;
26253450 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -2636,6 +3461,10 @@ const Parser = struct {
26363461 };
26373462 }
26383463 pub fn parsechar_char(p: *Parser) Error!bool {
3464 const def_index = @intFromEnum(Def.defchar_char);
3465 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3466 p.depths[def_index] += 1;
3467 defer p.depths[def_index] -= 1;
26393468 return blk_0: {
26403469 const pos_0 = p.i;
26413470 if (blk_1: {
......@@ -2672,6 +3501,10 @@ const Parser = struct {
26723501 };
26733502 }
26743503 pub fn parsestring_char(p: *Parser) Error!bool {
3504 const def_index = @intFromEnum(Def.defstring_char);
3505 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3506 p.depths[def_index] += 1;
3507 defer p.depths[def_index] -= 1;
26753508 return blk_0: {
26763509 const pos_0 = p.i;
26773510 if (blk_1: {
......@@ -2708,6 +3541,10 @@ const Parser = struct {
27083541 };
27093542 }
27103543 pub fn parsecontainer_doc_comment(p: *Parser) Error!bool {
3544 const def_index = @intFromEnum(Def.defcontainer_doc_comment);
3545 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3546 p.depths[def_index] += 1;
3547 defer p.depths[def_index] -= 1;
27113548 return blk_0: {
27123549 const pos_0 = p.i;
27133550 if (blk_1: {
......@@ -2743,6 +3580,10 @@ const Parser = struct {
27433580 };
27443581 }
27453582 pub fn parsedoc_comment(p: *Parser) Error!bool {
3583 const def_index = @intFromEnum(Def.defdoc_comment);
3584 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3585 p.depths[def_index] += 1;
3586 defer p.depths[def_index] -= 1;
27463587 return blk_0: {
27473588 const pos_0 = p.i;
27483589 if (blk_2: {
......@@ -2785,6 +3626,10 @@ const Parser = struct {
27853626 };
27863627 }
27873628 pub fn parseline_comment(p: *Parser) Error!bool {
3629 const def_index = @intFromEnum(Def.defline_comment);
3630 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3631 p.depths[def_index] += 1;
3632 defer p.depths[def_index] -= 1;
27883633 return blk_0: {
27893634 const pos_0 = p.i;
27903635 if (blk_1: {
......@@ -2834,6 +3679,10 @@ const Parser = struct {
28343679 };
28353680 }
28363681 pub fn parseline_string(p: *Parser) Error!bool {
3682 const def_index = @intFromEnum(Def.defline_string);
3683 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3684 p.depths[def_index] += 1;
3685 defer p.depths[def_index] -= 1;
28373686 return blk_0: {
28383687 const pos_0 = p.i;
28393688 if (blk_1: {
......@@ -2855,6 +3704,10 @@ const Parser = struct {
28553704 };
28563705 }
28573706 pub fn parsenewline(p: *Parser) Error!bool {
3707 const def_index = @intFromEnum(Def.defnewline);
3708 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3709 p.depths[def_index] += 1;
3710 defer p.depths[def_index] -= 1;
28583711 return blk_0: {
28593712 const pos_0 = p.i;
28603713 if (blk_1: {
......@@ -2889,6 +3742,10 @@ const Parser = struct {
28893742 };
28903743 }
28913744 pub fn parseskip(p: *Parser) Error!bool {
3745 const def_index = @intFromEnum(Def.defskip);
3746 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3747 p.depths[def_index] += 1;
3748 defer p.depths[def_index] -= 1;
28923749 return blk_0: {
28933750 const pos_0 = p.i;
28943751 if ((try p.parsesof() or true) and blk_1: {
......@@ -2921,6 +3778,10 @@ const Parser = struct {
29213778 };
29223779 }
29233780 pub fn parseskip_require_newline(p: *Parser) Error!bool {
3781 const def_index = @intFromEnum(Def.defskip_require_newline);
3782 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3783 p.depths[def_index] += 1;
3784 defer p.depths[def_index] -= 1;
29243785 return blk_0: {
29253786 const pos_0 = p.i;
29263787 if (blk_1: {
......@@ -2959,6 +3820,10 @@ const Parser = struct {
29593820 };
29603821 }
29613822 pub fn parsepre_op_white(p: *Parser) Error!bool {
3823 const def_index = @intFromEnum(Def.defpre_op_white);
3824 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3825 p.depths[def_index] += 1;
3826 defer p.depths[def_index] -= 1;
29623827 return blk_0: {
29633828 const pos_0 = p.i;
29643829 if (blk_1: {
......@@ -2993,6 +3858,10 @@ const Parser = struct {
29933858 };
29943859 }
29953860 pub fn parsepost_op_white(p: *Parser) Error!bool {
3861 const def_index = @intFromEnum(Def.defpost_op_white);
3862 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3863 p.depths[def_index] += 1;
3864 defer p.depths[def_index] -= 1;
29963865 return blk_0: {
29973866 const pos_0 = p.i;
29983867 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -3011,6 +3880,10 @@ const Parser = struct {
30113880 };
30123881 }
30133882 pub fn parseCHAR_LITERAL(p: *Parser) Error!bool {
3883 const def_index = @intFromEnum(Def.defCHAR_LITERAL);
3884 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3885 p.depths[def_index] += 1;
3886 defer p.depths[def_index] -= 1;
30143887 return blk_0: {
30153888 const pos_0 = p.i;
30163889 if (try p.parseskip() and (p.i < p.source.len and switch (p.source[p.i]) {
......@@ -3040,6 +3913,10 @@ const Parser = struct {
30403913 };
30413914 }
30423915 pub fn parsedigit(p: *Parser) Error!bool {
3916 const def_index = @intFromEnum(Def.defdigit);
3917 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3918 p.depths[def_index] += 1;
3919 defer p.depths[def_index] -= 1;
30433920 return blk_0: {
30443921 const pos_0 = p.i;
30453922 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -3062,6 +3939,10 @@ const Parser = struct {
30623939 };
30633940 }
30643941 pub fn parsedigit_int(p: *Parser) Error!bool {
3942 const def_index = @intFromEnum(Def.defdigit_int);
3943 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3944 p.depths[def_index] += 1;
3945 defer p.depths[def_index] -= 1;
30653946 return blk_0: {
30663947 const pos_0 = p.i;
30673948 if (try p.parsedigit()) break :blk_0 true;
......@@ -3082,6 +3963,10 @@ const Parser = struct {
30823963 };
30833964 }
30843965 pub fn parsedigit_float(p: *Parser) Error!bool {
3966 const def_index = @intFromEnum(Def.defdigit_float);
3967 if (p.depths[def_index] > max_depth) return error.MaxDepth;
3968 p.depths[def_index] += 1;
3969 defer p.depths[def_index] -= 1;
30853970 return blk_0: {
30863971 const pos_0 = p.i;
30873972 if (try p.parsedigit()) break :blk_0 true;
......@@ -3110,6 +3995,10 @@ const Parser = struct {
31103995 };
31113996 }
31123997 pub fn parseNUMBERLITERAL(p: *Parser) Error!bool {
3998 const def_index = @intFromEnum(Def.defNUMBERLITERAL);
3999 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4000 p.depths[def_index] += 1;
4001 defer p.depths[def_index] -= 1;
31134002 return blk_0: {
31144003 const pos_0 = p.i;
31154004 if (try p.parseskip() and (p.i < p.source.len and switch (p.source[p.i]) {
......@@ -3163,6 +4052,10 @@ const Parser = struct {
31634052 };
31644053 }
31654054 pub fn parsestring(p: *Parser) Error!bool {
4055 const def_index = @intFromEnum(Def.defstring);
4056 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4057 p.depths[def_index] += 1;
4058 defer p.depths[def_index] -= 1;
31664059 return blk_0: {
31674060 const pos_0 = p.i;
31684061 if ((p.i < p.source.len and switch (p.source[p.i]) {
......@@ -3192,6 +4085,10 @@ const Parser = struct {
31924085 };
31934086 }
31944087 pub fn parseSTRINGLITERALSINGLE(p: *Parser) Error!bool {
4088 const def_index = @intFromEnum(Def.defSTRINGLITERALSINGLE);
4089 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4090 p.depths[def_index] += 1;
4091 defer p.depths[def_index] -= 1;
31954092 return blk_0: {
31964093 const pos_0 = p.i;
31974094 if (try p.parseskip() and try p.parsestring()) break :blk_0 true;
......@@ -3200,6 +4097,10 @@ const Parser = struct {
32004097 };
32014098 }
32024099 pub fn parseSTRINGLITERAL(p: *Parser) Error!bool {
4100 const def_index = @intFromEnum(Def.defSTRINGLITERAL);
4101 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4102 p.depths[def_index] += 1;
4103 defer p.depths[def_index] -= 1;
32034104 return blk_0: {
32044105 const pos_0 = p.i;
32054106 if (try p.parseskip() and try p.parsestring()) break :blk_0 true;
......@@ -3224,6 +4125,10 @@ const Parser = struct {
32244125 };
32254126 }
32264127 pub fn parseIDENTIFIER(p: *Parser) Error!bool {
4128 const def_index = @intFromEnum(Def.defIDENTIFIER);
4129 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4130 p.depths[def_index] += 1;
4131 defer p.depths[def_index] -= 1;
32274132 return blk_0: {
32284133 const pos_0 = p.i;
32294134 if (try p.parseskip() and blk_1: {
......@@ -3271,6 +4176,10 @@ const Parser = struct {
32714176 };
32724177 }
32734178 pub fn parseBUILTINIDENTIFIER(p: *Parser) Error!bool {
4179 const def_index = @intFromEnum(Def.defBUILTINIDENTIFIER);
4180 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4181 p.depths[def_index] += 1;
4182 defer p.depths[def_index] -= 1;
32744183 return blk_0: {
32754184 const pos_0 = p.i;
32764185 if (try p.parseskip() and blk_1: {
......@@ -3311,6 +4220,10 @@ const Parser = struct {
33114220 };
33124221 }
33134222 pub fn parseAMPERSAND(p: *Parser) Error!bool {
4223 const def_index = @intFromEnum(Def.defAMPERSAND);
4224 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4225 p.depths[def_index] += 1;
4226 defer p.depths[def_index] -= 1;
33144227 return blk_0: {
33154228 const pos_0 = p.i;
33164229 if (try p.parseskip() and blk_1: {
......@@ -3337,6 +4250,10 @@ const Parser = struct {
33374250 };
33384251 }
33394252 pub fn parseAMPERSANDEQUAL(p: *Parser) Error!bool {
4253 const def_index = @intFromEnum(Def.defAMPERSANDEQUAL);
4254 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4255 p.depths[def_index] += 1;
4256 defer p.depths[def_index] -= 1;
33404257 return blk_0: {
33414258 const pos_0 = p.i;
33424259 if (try p.parseskip() and blk_1: {
......@@ -3351,6 +4268,10 @@ const Parser = struct {
33514268 };
33524269 }
33534270 pub fn parseASTERISK(p: *Parser) Error!bool {
4271 const def_index = @intFromEnum(Def.defASTERISK);
4272 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4273 p.depths[def_index] += 1;
4274 defer p.depths[def_index] -= 1;
33544275 return blk_0: {
33554276 const pos_0 = p.i;
33564277 if (try p.parseskip() and blk_1: {
......@@ -3379,6 +4300,10 @@ const Parser = struct {
33794300 };
33804301 }
33814302 pub fn parseASTERISKEQUAL(p: *Parser) Error!bool {
4303 const def_index = @intFromEnum(Def.defASTERISKEQUAL);
4304 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4305 p.depths[def_index] += 1;
4306 defer p.depths[def_index] -= 1;
33824307 return blk_0: {
33834308 const pos_0 = p.i;
33844309 if (try p.parseskip() and blk_1: {
......@@ -3393,6 +4318,10 @@ const Parser = struct {
33934318 };
33944319 }
33954320 pub fn parseASTERISKPERCENT(p: *Parser) Error!bool {
4321 const def_index = @intFromEnum(Def.defASTERISKPERCENT);
4322 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4323 p.depths[def_index] += 1;
4324 defer p.depths[def_index] -= 1;
33964325 return blk_0: {
33974326 const pos_0 = p.i;
33984327 if (try p.parseskip() and blk_1: {
......@@ -3419,6 +4348,10 @@ const Parser = struct {
34194348 };
34204349 }
34214350 pub fn parseASTERISKPERCENTEQUAL(p: *Parser) Error!bool {
4351 const def_index = @intFromEnum(Def.defASTERISKPERCENTEQUAL);
4352 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4353 p.depths[def_index] += 1;
4354 defer p.depths[def_index] -= 1;
34224355 return blk_0: {
34234356 const pos_0 = p.i;
34244357 if (try p.parseskip() and blk_1: {
......@@ -3433,6 +4366,10 @@ const Parser = struct {
34334366 };
34344367 }
34354368 pub fn parseASTERISKPIPE(p: *Parser) Error!bool {
4369 const def_index = @intFromEnum(Def.defASTERISKPIPE);
4370 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4371 p.depths[def_index] += 1;
4372 defer p.depths[def_index] -= 1;
34364373 return blk_0: {
34374374 const pos_0 = p.i;
34384375 if (try p.parseskip() and blk_1: {
......@@ -3459,6 +4396,10 @@ const Parser = struct {
34594396 };
34604397 }
34614398 pub fn parseASTERISKPIPEEQUAL(p: *Parser) Error!bool {
4399 const def_index = @intFromEnum(Def.defASTERISKPIPEEQUAL);
4400 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4401 p.depths[def_index] += 1;
4402 defer p.depths[def_index] -= 1;
34624403 return blk_0: {
34634404 const pos_0 = p.i;
34644405 if (try p.parseskip() and blk_1: {
......@@ -3473,6 +4414,10 @@ const Parser = struct {
34734414 };
34744415 }
34754416 pub fn parseCARET(p: *Parser) Error!bool {
4417 const def_index = @intFromEnum(Def.defCARET);
4418 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4419 p.depths[def_index] += 1;
4420 defer p.depths[def_index] -= 1;
34764421 return blk_0: {
34774422 const pos_0 = p.i;
34784423 if (try p.parseskip() and blk_1: {
......@@ -3499,6 +4444,10 @@ const Parser = struct {
34994444 };
35004445 }
35014446 pub fn parseCARETEQUAL(p: *Parser) Error!bool {
4447 const def_index = @intFromEnum(Def.defCARETEQUAL);
4448 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4449 p.depths[def_index] += 1;
4450 defer p.depths[def_index] -= 1;
35024451 return blk_0: {
35034452 const pos_0 = p.i;
35044453 if (try p.parseskip() and blk_1: {
......@@ -3513,6 +4462,10 @@ const Parser = struct {
35134462 };
35144463 }
35154464 pub fn parseCOLON(p: *Parser) Error!bool {
4465 const def_index = @intFromEnum(Def.defCOLON);
4466 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4467 p.depths[def_index] += 1;
4468 defer p.depths[def_index] -= 1;
35164469 return blk_0: {
35174470 const pos_0 = p.i;
35184471 if (try p.parseskip() and blk_1: {
......@@ -3527,6 +4480,10 @@ const Parser = struct {
35274480 };
35284481 }
35294482 pub fn parseCOMMA(p: *Parser) Error!bool {
4483 const def_index = @intFromEnum(Def.defCOMMA);
4484 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4485 p.depths[def_index] += 1;
4486 defer p.depths[def_index] -= 1;
35304487 return blk_0: {
35314488 const pos_0 = p.i;
35324489 if (try p.parseskip() and blk_1: {
......@@ -3541,6 +4498,10 @@ const Parser = struct {
35414498 };
35424499 }
35434500 pub fn parseDOT(p: *Parser) Error!bool {
4501 const def_index = @intFromEnum(Def.defDOT);
4502 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4503 p.depths[def_index] += 1;
4504 defer p.depths[def_index] -= 1;
35444505 return blk_0: {
35454506 const pos_0 = p.i;
35464507 if (try p.parseskip() and blk_1: {
......@@ -3568,6 +4529,10 @@ const Parser = struct {
35684529 };
35694530 }
35704531 pub fn parseDOT2(p: *Parser) Error!bool {
4532 const def_index = @intFromEnum(Def.defDOT2);
4533 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4534 p.depths[def_index] += 1;
4535 defer p.depths[def_index] -= 1;
35714536 return blk_0: {
35724537 const pos_0 = p.i;
35734538 if (try p.parseskip() and blk_1: {
......@@ -3594,6 +4559,10 @@ const Parser = struct {
35944559 };
35954560 }
35964561 pub fn parseDOT3(p: *Parser) Error!bool {
4562 const def_index = @intFromEnum(Def.defDOT3);
4563 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4564 p.depths[def_index] += 1;
4565 defer p.depths[def_index] -= 1;
35974566 return blk_0: {
35984567 const pos_0 = p.i;
35994568 if (try p.parseskip() and blk_1: {
......@@ -3608,6 +4577,10 @@ const Parser = struct {
36084577 };
36094578 }
36104579 pub fn parseDOTASTERISK(p: *Parser) Error!bool {
4580 const def_index = @intFromEnum(Def.defDOTASTERISK);
4581 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4582 p.depths[def_index] += 1;
4583 defer p.depths[def_index] -= 1;
36114584 return blk_0: {
36124585 const pos_0 = p.i;
36134586 if (try p.parseskip() and blk_1: {
......@@ -3622,6 +4595,10 @@ const Parser = struct {
36224595 };
36234596 }
36244597 pub fn parseEQUAL(p: *Parser) Error!bool {
4598 const def_index = @intFromEnum(Def.defEQUAL);
4599 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4600 p.depths[def_index] += 1;
4601 defer p.depths[def_index] -= 1;
36254602 return blk_0: {
36264603 const pos_0 = p.i;
36274604 if (try p.parseskip() and blk_1: {
......@@ -3649,6 +4626,10 @@ const Parser = struct {
36494626 };
36504627 }
36514628 pub fn parseEQUALEQUAL(p: *Parser) Error!bool {
4629 const def_index = @intFromEnum(Def.defEQUALEQUAL);
4630 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4631 p.depths[def_index] += 1;
4632 defer p.depths[def_index] -= 1;
36524633 return blk_0: {
36534634 const pos_0 = p.i;
36544635 if (try p.parseskip() and blk_1: {
......@@ -3663,6 +4644,10 @@ const Parser = struct {
36634644 };
36644645 }
36654646 pub fn parseEQUALRARROW(p: *Parser) Error!bool {
4647 const def_index = @intFromEnum(Def.defEQUALRARROW);
4648 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4649 p.depths[def_index] += 1;
4650 defer p.depths[def_index] -= 1;
36664651 return blk_0: {
36674652 const pos_0 = p.i;
36684653 if (try p.parseskip() and blk_1: {
......@@ -3677,6 +4662,10 @@ const Parser = struct {
36774662 };
36784663 }
36794664 pub fn parseEXCLAMATIONMARK(p: *Parser) Error!bool {
4665 const def_index = @intFromEnum(Def.defEXCLAMATIONMARK);
4666 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4667 p.depths[def_index] += 1;
4668 defer p.depths[def_index] -= 1;
36804669 return blk_0: {
36814670 const pos_0 = p.i;
36824671 if (try p.parseskip() and blk_1: {
......@@ -3703,6 +4692,10 @@ const Parser = struct {
37034692 };
37044693 }
37054694 pub fn parseEXCLAMATIONMARKEQUAL(p: *Parser) Error!bool {
4695 const def_index = @intFromEnum(Def.defEXCLAMATIONMARKEQUAL);
4696 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4697 p.depths[def_index] += 1;
4698 defer p.depths[def_index] -= 1;
37064699 return blk_0: {
37074700 const pos_0 = p.i;
37084701 if (try p.parseskip() and blk_1: {
......@@ -3717,6 +4710,10 @@ const Parser = struct {
37174710 };
37184711 }
37194712 pub fn parseLARROW(p: *Parser) Error!bool {
4713 const def_index = @intFromEnum(Def.defLARROW);
4714 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4715 p.depths[def_index] += 1;
4716 defer p.depths[def_index] -= 1;
37204717 return blk_0: {
37214718 const pos_0 = p.i;
37224719 if (try p.parseskip() and blk_1: {
......@@ -3744,6 +4741,10 @@ const Parser = struct {
37444741 };
37454742 }
37464743 pub fn parseLARROW2(p: *Parser) Error!bool {
4744 const def_index = @intFromEnum(Def.defLARROW2);
4745 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4746 p.depths[def_index] += 1;
4747 defer p.depths[def_index] -= 1;
37474748 return blk_0: {
37484749 const pos_0 = p.i;
37494750 if (try p.parseskip() and blk_1: {
......@@ -3771,6 +4772,10 @@ const Parser = struct {
37714772 };
37724773 }
37734774 pub fn parseLARROW2EQUAL(p: *Parser) Error!bool {
4775 const def_index = @intFromEnum(Def.defLARROW2EQUAL);
4776 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4777 p.depths[def_index] += 1;
4778 defer p.depths[def_index] -= 1;
37744779 return blk_0: {
37754780 const pos_0 = p.i;
37764781 if (try p.parseskip() and blk_1: {
......@@ -3785,6 +4790,10 @@ const Parser = struct {
37854790 };
37864791 }
37874792 pub fn parseLARROW2PIPE(p: *Parser) Error!bool {
4793 const def_index = @intFromEnum(Def.defLARROW2PIPE);
4794 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4795 p.depths[def_index] += 1;
4796 defer p.depths[def_index] -= 1;
37884797 return blk_0: {
37894798 const pos_0 = p.i;
37904799 if (try p.parseskip() and blk_1: {
......@@ -3811,6 +4820,10 @@ const Parser = struct {
38114820 };
38124821 }
38134822 pub fn parseLARROW2PIPEEQUAL(p: *Parser) Error!bool {
4823 const def_index = @intFromEnum(Def.defLARROW2PIPEEQUAL);
4824 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4825 p.depths[def_index] += 1;
4826 defer p.depths[def_index] -= 1;
38144827 return blk_0: {
38154828 const pos_0 = p.i;
38164829 if (try p.parseskip() and blk_1: {
......@@ -3825,6 +4838,10 @@ const Parser = struct {
38254838 };
38264839 }
38274840 pub fn parseLARROWEQUAL(p: *Parser) Error!bool {
4841 const def_index = @intFromEnum(Def.defLARROWEQUAL);
4842 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4843 p.depths[def_index] += 1;
4844 defer p.depths[def_index] -= 1;
38284845 return blk_0: {
38294846 const pos_0 = p.i;
38304847 if (try p.parseskip() and blk_1: {
......@@ -3839,6 +4856,10 @@ const Parser = struct {
38394856 };
38404857 }
38414858 pub fn parseLBRACE(p: *Parser) Error!bool {
4859 const def_index = @intFromEnum(Def.defLBRACE);
4860 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4861 p.depths[def_index] += 1;
4862 defer p.depths[def_index] -= 1;
38424863 return blk_0: {
38434864 const pos_0 = p.i;
38444865 if (try p.parseskip() and blk_1: {
......@@ -3853,6 +4874,10 @@ const Parser = struct {
38534874 };
38544875 }
38554876 pub fn parseLBRACKET(p: *Parser) Error!bool {
4877 const def_index = @intFromEnum(Def.defLBRACKET);
4878 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4879 p.depths[def_index] += 1;
4880 defer p.depths[def_index] -= 1;
38564881 return blk_0: {
38574882 const pos_0 = p.i;
38584883 if (try p.parseskip() and blk_1: {
......@@ -3867,6 +4892,10 @@ const Parser = struct {
38674892 };
38684893 }
38694894 pub fn parseLPAREN(p: *Parser) Error!bool {
4895 const def_index = @intFromEnum(Def.defLPAREN);
4896 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4897 p.depths[def_index] += 1;
4898 defer p.depths[def_index] -= 1;
38704899 return blk_0: {
38714900 const pos_0 = p.i;
38724901 if (try p.parseskip() and blk_1: {
......@@ -3881,6 +4910,10 @@ const Parser = struct {
38814910 };
38824911 }
38834912 pub fn parseMINUS(p: *Parser) Error!bool {
4913 const def_index = @intFromEnum(Def.defMINUS);
4914 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4915 p.depths[def_index] += 1;
4916 defer p.depths[def_index] -= 1;
38844917 return blk_0: {
38854918 const pos_0 = p.i;
38864919 if (try p.parseskip() and blk_1: {
......@@ -3910,6 +4943,10 @@ const Parser = struct {
39104943 };
39114944 }
39124945 pub fn parseMINUSEQUAL(p: *Parser) Error!bool {
4946 const def_index = @intFromEnum(Def.defMINUSEQUAL);
4947 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4948 p.depths[def_index] += 1;
4949 defer p.depths[def_index] -= 1;
39134950 return blk_0: {
39144951 const pos_0 = p.i;
39154952 if (try p.parseskip() and blk_1: {
......@@ -3924,6 +4961,10 @@ const Parser = struct {
39244961 };
39254962 }
39264963 pub fn parseMINUSPERCENT(p: *Parser) Error!bool {
4964 const def_index = @intFromEnum(Def.defMINUSPERCENT);
4965 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4966 p.depths[def_index] += 1;
4967 defer p.depths[def_index] -= 1;
39274968 return blk_0: {
39284969 const pos_0 = p.i;
39294970 if (try p.parseskip() and blk_1: {
......@@ -3950,6 +4991,10 @@ const Parser = struct {
39504991 };
39514992 }
39524993 pub fn parseMINUSPERCENTEQUAL(p: *Parser) Error!bool {
4994 const def_index = @intFromEnum(Def.defMINUSPERCENTEQUAL);
4995 if (p.depths[def_index] > max_depth) return error.MaxDepth;
4996 p.depths[def_index] += 1;
4997 defer p.depths[def_index] -= 1;
39534998 return blk_0: {
39544999 const pos_0 = p.i;
39555000 if (try p.parseskip() and blk_1: {
......@@ -3964,6 +5009,10 @@ const Parser = struct {
39645009 };
39655010 }
39665011 pub fn parseMINUSPIPE(p: *Parser) Error!bool {
5012 const def_index = @intFromEnum(Def.defMINUSPIPE);
5013 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5014 p.depths[def_index] += 1;
5015 defer p.depths[def_index] -= 1;
39675016 return blk_0: {
39685017 const pos_0 = p.i;
39695018 if (try p.parseskip() and blk_1: {
......@@ -3990,6 +5039,10 @@ const Parser = struct {
39905039 };
39915040 }
39925041 pub fn parseMINUSPIPEEQUAL(p: *Parser) Error!bool {
5042 const def_index = @intFromEnum(Def.defMINUSPIPEEQUAL);
5043 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5044 p.depths[def_index] += 1;
5045 defer p.depths[def_index] -= 1;
39935046 return blk_0: {
39945047 const pos_0 = p.i;
39955048 if (try p.parseskip() and blk_1: {
......@@ -4004,6 +5057,10 @@ const Parser = struct {
40045057 };
40055058 }
40065059 pub fn parseMINUSRARROW(p: *Parser) Error!bool {
5060 const def_index = @intFromEnum(Def.defMINUSRARROW);
5061 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5062 p.depths[def_index] += 1;
5063 defer p.depths[def_index] -= 1;
40075064 return blk_0: {
40085065 const pos_0 = p.i;
40095066 if (try p.parseskip() and blk_1: {
......@@ -4018,6 +5075,10 @@ const Parser = struct {
40185075 };
40195076 }
40205077 pub fn parsePERCENT(p: *Parser) Error!bool {
5078 const def_index = @intFromEnum(Def.defPERCENT);
5079 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5080 p.depths[def_index] += 1;
5081 defer p.depths[def_index] -= 1;
40215082 return blk_0: {
40225083 const pos_0 = p.i;
40235084 if (try p.parseskip() and blk_1: {
......@@ -4044,6 +5105,10 @@ const Parser = struct {
40445105 };
40455106 }
40465107 pub fn parsePERCENTEQUAL(p: *Parser) Error!bool {
5108 const def_index = @intFromEnum(Def.defPERCENTEQUAL);
5109 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5110 p.depths[def_index] += 1;
5111 defer p.depths[def_index] -= 1;
40475112 return blk_0: {
40485113 const pos_0 = p.i;
40495114 if (try p.parseskip() and blk_1: {
......@@ -4058,6 +5123,10 @@ const Parser = struct {
40585123 };
40595124 }
40605125 pub fn parsePIPE(p: *Parser) Error!bool {
5126 const def_index = @intFromEnum(Def.defPIPE);
5127 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5128 p.depths[def_index] += 1;
5129 defer p.depths[def_index] -= 1;
40615130 return blk_0: {
40625131 const pos_0 = p.i;
40635132 if (try p.parseskip() and blk_1: {
......@@ -4085,6 +5154,10 @@ const Parser = struct {
40855154 };
40865155 }
40875156 pub fn parsePIPE2(p: *Parser) Error!bool {
5157 const def_index = @intFromEnum(Def.defPIPE2);
5158 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5159 p.depths[def_index] += 1;
5160 defer p.depths[def_index] -= 1;
40885161 return blk_0: {
40895162 const pos_0 = p.i;
40905163 if (try p.parseskip() and blk_1: {
......@@ -4099,6 +5172,10 @@ const Parser = struct {
40995172 };
41005173 }
41015174 pub fn parsePIPEEQUAL(p: *Parser) Error!bool {
5175 const def_index = @intFromEnum(Def.defPIPEEQUAL);
5176 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5177 p.depths[def_index] += 1;
5178 defer p.depths[def_index] -= 1;
41025179 return blk_0: {
41035180 const pos_0 = p.i;
41045181 if (try p.parseskip() and blk_1: {
......@@ -4113,6 +5190,10 @@ const Parser = struct {
41135190 };
41145191 }
41155192 pub fn parsePLUS(p: *Parser) Error!bool {
5193 const def_index = @intFromEnum(Def.defPLUS);
5194 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5195 p.depths[def_index] += 1;
5196 defer p.depths[def_index] -= 1;
41165197 return blk_0: {
41175198 const pos_0 = p.i;
41185199 if (try p.parseskip() and blk_1: {
......@@ -4142,6 +5223,10 @@ const Parser = struct {
41425223 };
41435224 }
41445225 pub fn parsePLUS2(p: *Parser) Error!bool {
5226 const def_index = @intFromEnum(Def.defPLUS2);
5227 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5228 p.depths[def_index] += 1;
5229 defer p.depths[def_index] -= 1;
41455230 return blk_0: {
41465231 const pos_0 = p.i;
41475232 if (try p.parseskip() and blk_1: {
......@@ -4156,6 +5241,10 @@ const Parser = struct {
41565241 };
41575242 }
41585243 pub fn parsePLUSEQUAL(p: *Parser) Error!bool {
5244 const def_index = @intFromEnum(Def.defPLUSEQUAL);
5245 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5246 p.depths[def_index] += 1;
5247 defer p.depths[def_index] -= 1;
41595248 return blk_0: {
41605249 const pos_0 = p.i;
41615250 if (try p.parseskip() and blk_1: {
......@@ -4170,6 +5259,10 @@ const Parser = struct {
41705259 };
41715260 }
41725261 pub fn parsePLUSPERCENT(p: *Parser) Error!bool {
5262 const def_index = @intFromEnum(Def.defPLUSPERCENT);
5263 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5264 p.depths[def_index] += 1;
5265 defer p.depths[def_index] -= 1;
41735266 return blk_0: {
41745267 const pos_0 = p.i;
41755268 if (try p.parseskip() and blk_1: {
......@@ -4196,6 +5289,10 @@ const Parser = struct {
41965289 };
41975290 }
41985291 pub fn parsePLUSPERCENTEQUAL(p: *Parser) Error!bool {
5292 const def_index = @intFromEnum(Def.defPLUSPERCENTEQUAL);
5293 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5294 p.depths[def_index] += 1;
5295 defer p.depths[def_index] -= 1;
41995296 return blk_0: {
42005297 const pos_0 = p.i;
42015298 if (try p.parseskip() and blk_1: {
......@@ -4210,6 +5307,10 @@ const Parser = struct {
42105307 };
42115308 }
42125309 pub fn parsePLUSPIPE(p: *Parser) Error!bool {
5310 const def_index = @intFromEnum(Def.defPLUSPIPE);
5311 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5312 p.depths[def_index] += 1;
5313 defer p.depths[def_index] -= 1;
42135314 return blk_0: {
42145315 const pos_0 = p.i;
42155316 if (try p.parseskip() and blk_1: {
......@@ -4236,6 +5337,10 @@ const Parser = struct {
42365337 };
42375338 }
42385339 pub fn parsePLUSPIPEEQUAL(p: *Parser) Error!bool {
5340 const def_index = @intFromEnum(Def.defPLUSPIPEEQUAL);
5341 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5342 p.depths[def_index] += 1;
5343 defer p.depths[def_index] -= 1;
42395344 return blk_0: {
42405345 const pos_0 = p.i;
42415346 if (try p.parseskip() and blk_1: {
......@@ -4250,6 +5355,10 @@ const Parser = struct {
42505355 };
42515356 }
42525357 pub fn parseLETTERC(p: *Parser) Error!bool {
5358 const def_index = @intFromEnum(Def.defLETTERC);
5359 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5360 p.depths[def_index] += 1;
5361 defer p.depths[def_index] -= 1;
42535362 return blk_0: {
42545363 const pos_0 = p.i;
42555364 if (try p.parseskip() and blk_1: {
......@@ -4264,6 +5373,10 @@ const Parser = struct {
42645373 };
42655374 }
42665375 pub fn parseQUESTIONMARK(p: *Parser) Error!bool {
5376 const def_index = @intFromEnum(Def.defQUESTIONMARK);
5377 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5378 p.depths[def_index] += 1;
5379 defer p.depths[def_index] -= 1;
42675380 return blk_0: {
42685381 const pos_0 = p.i;
42695382 if (try p.parseskip() and blk_1: {
......@@ -4278,6 +5391,10 @@ const Parser = struct {
42785391 };
42795392 }
42805393 pub fn parseRARROW(p: *Parser) Error!bool {
5394 const def_index = @intFromEnum(Def.defRARROW);
5395 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5396 p.depths[def_index] += 1;
5397 defer p.depths[def_index] -= 1;
42815398 return blk_0: {
42825399 const pos_0 = p.i;
42835400 if (try p.parseskip() and blk_1: {
......@@ -4305,6 +5422,10 @@ const Parser = struct {
43055422 };
43065423 }
43075424 pub fn parseRARROW2(p: *Parser) Error!bool {
5425 const def_index = @intFromEnum(Def.defRARROW2);
5426 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5427 p.depths[def_index] += 1;
5428 defer p.depths[def_index] -= 1;
43085429 return blk_0: {
43095430 const pos_0 = p.i;
43105431 if (try p.parseskip() and blk_1: {
......@@ -4331,6 +5452,10 @@ const Parser = struct {
43315452 };
43325453 }
43335454 pub fn parseRARROW2EQUAL(p: *Parser) Error!bool {
5455 const def_index = @intFromEnum(Def.defRARROW2EQUAL);
5456 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5457 p.depths[def_index] += 1;
5458 defer p.depths[def_index] -= 1;
43345459 return blk_0: {
43355460 const pos_0 = p.i;
43365461 if (try p.parseskip() and blk_1: {
......@@ -4345,6 +5470,10 @@ const Parser = struct {
43455470 };
43465471 }
43475472 pub fn parseRARROWEQUAL(p: *Parser) Error!bool {
5473 const def_index = @intFromEnum(Def.defRARROWEQUAL);
5474 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5475 p.depths[def_index] += 1;
5476 defer p.depths[def_index] -= 1;
43485477 return blk_0: {
43495478 const pos_0 = p.i;
43505479 if (try p.parseskip() and blk_1: {
......@@ -4359,6 +5488,10 @@ const Parser = struct {
43595488 };
43605489 }
43615490 pub fn parseRBRACE(p: *Parser) Error!bool {
5491 const def_index = @intFromEnum(Def.defRBRACE);
5492 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5493 p.depths[def_index] += 1;
5494 defer p.depths[def_index] -= 1;
43625495 return blk_0: {
43635496 const pos_0 = p.i;
43645497 if (try p.parseskip() and blk_1: {
......@@ -4373,6 +5506,10 @@ const Parser = struct {
43735506 };
43745507 }
43755508 pub fn parseRBRACKET(p: *Parser) Error!bool {
5509 const def_index = @intFromEnum(Def.defRBRACKET);
5510 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5511 p.depths[def_index] += 1;
5512 defer p.depths[def_index] -= 1;
43765513 return blk_0: {
43775514 const pos_0 = p.i;
43785515 if (try p.parseskip() and blk_1: {
......@@ -4387,6 +5524,10 @@ const Parser = struct {
43875524 };
43885525 }
43895526 pub fn parseRPAREN(p: *Parser) Error!bool {
5527 const def_index = @intFromEnum(Def.defRPAREN);
5528 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5529 p.depths[def_index] += 1;
5530 defer p.depths[def_index] -= 1;
43905531 return blk_0: {
43915532 const pos_0 = p.i;
43925533 if (try p.parseskip() and blk_1: {
......@@ -4401,6 +5542,10 @@ const Parser = struct {
44015542 };
44025543 }
44035544 pub fn parseSEMICOLON(p: *Parser) Error!bool {
5545 const def_index = @intFromEnum(Def.defSEMICOLON);
5546 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5547 p.depths[def_index] += 1;
5548 defer p.depths[def_index] -= 1;
44045549 return blk_0: {
44055550 const pos_0 = p.i;
44065551 if (try p.parseskip() and blk_1: {
......@@ -4415,6 +5560,10 @@ const Parser = struct {
44155560 };
44165561 }
44175562 pub fn parseSLASH(p: *Parser) Error!bool {
5563 const def_index = @intFromEnum(Def.defSLASH);
5564 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5565 p.depths[def_index] += 1;
5566 defer p.depths[def_index] -= 1;
44185567 return blk_0: {
44195568 const pos_0 = p.i;
44205569 if (try p.parseskip() and blk_1: {
......@@ -4442,6 +5591,10 @@ const Parser = struct {
44425591 };
44435592 }
44445593 pub fn parseSLASHEQUAL(p: *Parser) Error!bool {
5594 const def_index = @intFromEnum(Def.defSLASHEQUAL);
5595 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5596 p.depths[def_index] += 1;
5597 defer p.depths[def_index] -= 1;
44455598 return blk_0: {
44465599 const pos_0 = p.i;
44475600 if (try p.parseskip() and blk_1: {
......@@ -4456,6 +5609,10 @@ const Parser = struct {
44565609 };
44575610 }
44585611 pub fn parseTILDE(p: *Parser) Error!bool {
5612 const def_index = @intFromEnum(Def.defTILDE);
5613 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5614 p.depths[def_index] += 1;
5615 defer p.depths[def_index] -= 1;
44595616 return blk_0: {
44605617 const pos_0 = p.i;
44615618 if (try p.parseskip() and blk_1: {
......@@ -4470,6 +5627,10 @@ const Parser = struct {
44705627 };
44715628 }
44725629 pub fn parseend_of_word(p: *Parser) Error!bool {
5630 const def_index = @intFromEnum(Def.defend_of_word);
5631 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5632 p.depths[def_index] += 1;
5633 defer p.depths[def_index] -= 1;
44735634 return blk_0: {
44745635 const pos_0 = p.i;
44755636 if (blk_1: {
......@@ -4493,6 +5654,10 @@ const Parser = struct {
44935654 };
44945655 }
44955656 pub fn parseKEYWORD_addrspace(p: *Parser) Error!bool {
5657 const def_index = @intFromEnum(Def.defKEYWORD_addrspace);
5658 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5659 p.depths[def_index] += 1;
5660 defer p.depths[def_index] -= 1;
44965661 return blk_0: {
44975662 const pos_0 = p.i;
44985663 if (try p.parseskip() and blk_1: {
......@@ -4507,6 +5672,10 @@ const Parser = struct {
45075672 };
45085673 }
45095674 pub fn parseKEYWORD_align(p: *Parser) Error!bool {
5675 const def_index = @intFromEnum(Def.defKEYWORD_align);
5676 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5677 p.depths[def_index] += 1;
5678 defer p.depths[def_index] -= 1;
45105679 return blk_0: {
45115680 const pos_0 = p.i;
45125681 if (try p.parseskip() and blk_1: {
......@@ -4521,6 +5690,10 @@ const Parser = struct {
45215690 };
45225691 }
45235692 pub fn parseKEYWORD_allowzero(p: *Parser) Error!bool {
5693 const def_index = @intFromEnum(Def.defKEYWORD_allowzero);
5694 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5695 p.depths[def_index] += 1;
5696 defer p.depths[def_index] -= 1;
45245697 return blk_0: {
45255698 const pos_0 = p.i;
45265699 if (try p.parseskip() and blk_1: {
......@@ -4535,6 +5708,10 @@ const Parser = struct {
45355708 };
45365709 }
45375710 pub fn parseKEYWORD_and(p: *Parser) Error!bool {
5711 const def_index = @intFromEnum(Def.defKEYWORD_and);
5712 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5713 p.depths[def_index] += 1;
5714 defer p.depths[def_index] -= 1;
45385715 return blk_0: {
45395716 const pos_0 = p.i;
45405717 if (try p.parseskip() and blk_1: {
......@@ -4549,6 +5726,10 @@ const Parser = struct {
45495726 };
45505727 }
45515728 pub fn parseKEYWORD_anyframe(p: *Parser) Error!bool {
5729 const def_index = @intFromEnum(Def.defKEYWORD_anyframe);
5730 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5731 p.depths[def_index] += 1;
5732 defer p.depths[def_index] -= 1;
45525733 return blk_0: {
45535734 const pos_0 = p.i;
45545735 if (try p.parseskip() and blk_1: {
......@@ -4563,6 +5744,10 @@ const Parser = struct {
45635744 };
45645745 }
45655746 pub fn parseKEYWORD_anytype(p: *Parser) Error!bool {
5747 const def_index = @intFromEnum(Def.defKEYWORD_anytype);
5748 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5749 p.depths[def_index] += 1;
5750 defer p.depths[def_index] -= 1;
45665751 return blk_0: {
45675752 const pos_0 = p.i;
45685753 if (try p.parseskip() and blk_1: {
......@@ -4577,6 +5762,10 @@ const Parser = struct {
45775762 };
45785763 }
45795764 pub fn parseKEYWORD_asm(p: *Parser) Error!bool {
5765 const def_index = @intFromEnum(Def.defKEYWORD_asm);
5766 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5767 p.depths[def_index] += 1;
5768 defer p.depths[def_index] -= 1;
45805769 return blk_0: {
45815770 const pos_0 = p.i;
45825771 if (try p.parseskip() and blk_1: {
......@@ -4591,6 +5780,10 @@ const Parser = struct {
45915780 };
45925781 }
45935782 pub fn parseKEYWORD_break(p: *Parser) Error!bool {
5783 const def_index = @intFromEnum(Def.defKEYWORD_break);
5784 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5785 p.depths[def_index] += 1;
5786 defer p.depths[def_index] -= 1;
45945787 return blk_0: {
45955788 const pos_0 = p.i;
45965789 if (try p.parseskip() and blk_1: {
......@@ -4605,6 +5798,10 @@ const Parser = struct {
46055798 };
46065799 }
46075800 pub fn parseKEYWORD_callconv(p: *Parser) Error!bool {
5801 const def_index = @intFromEnum(Def.defKEYWORD_callconv);
5802 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5803 p.depths[def_index] += 1;
5804 defer p.depths[def_index] -= 1;
46085805 return blk_0: {
46095806 const pos_0 = p.i;
46105807 if (try p.parseskip() and blk_1: {
......@@ -4619,6 +5816,10 @@ const Parser = struct {
46195816 };
46205817 }
46215818 pub fn parseKEYWORD_catch(p: *Parser) Error!bool {
5819 const def_index = @intFromEnum(Def.defKEYWORD_catch);
5820 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5821 p.depths[def_index] += 1;
5822 defer p.depths[def_index] -= 1;
46225823 return blk_0: {
46235824 const pos_0 = p.i;
46245825 if (try p.parseskip() and blk_1: {
......@@ -4633,6 +5834,10 @@ const Parser = struct {
46335834 };
46345835 }
46355836 pub fn parseKEYWORD_comptime(p: *Parser) Error!bool {
5837 const def_index = @intFromEnum(Def.defKEYWORD_comptime);
5838 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5839 p.depths[def_index] += 1;
5840 defer p.depths[def_index] -= 1;
46365841 return blk_0: {
46375842 const pos_0 = p.i;
46385843 if (try p.parseskip() and blk_1: {
......@@ -4647,6 +5852,10 @@ const Parser = struct {
46475852 };
46485853 }
46495854 pub fn parseKEYWORD_const(p: *Parser) Error!bool {
5855 const def_index = @intFromEnum(Def.defKEYWORD_const);
5856 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5857 p.depths[def_index] += 1;
5858 defer p.depths[def_index] -= 1;
46505859 return blk_0: {
46515860 const pos_0 = p.i;
46525861 if (try p.parseskip() and blk_1: {
......@@ -4661,6 +5870,10 @@ const Parser = struct {
46615870 };
46625871 }
46635872 pub fn parseKEYWORD_continue(p: *Parser) Error!bool {
5873 const def_index = @intFromEnum(Def.defKEYWORD_continue);
5874 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5875 p.depths[def_index] += 1;
5876 defer p.depths[def_index] -= 1;
46645877 return blk_0: {
46655878 const pos_0 = p.i;
46665879 if (try p.parseskip() and blk_1: {
......@@ -4675,6 +5888,10 @@ const Parser = struct {
46755888 };
46765889 }
46775890 pub fn parseKEYWORD_defer(p: *Parser) Error!bool {
5891 const def_index = @intFromEnum(Def.defKEYWORD_defer);
5892 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5893 p.depths[def_index] += 1;
5894 defer p.depths[def_index] -= 1;
46785895 return blk_0: {
46795896 const pos_0 = p.i;
46805897 if (try p.parseskip() and blk_1: {
......@@ -4689,6 +5906,10 @@ const Parser = struct {
46895906 };
46905907 }
46915908 pub fn parseKEYWORD_else(p: *Parser) Error!bool {
5909 const def_index = @intFromEnum(Def.defKEYWORD_else);
5910 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5911 p.depths[def_index] += 1;
5912 defer p.depths[def_index] -= 1;
46925913 return blk_0: {
46935914 const pos_0 = p.i;
46945915 if (try p.parseskip() and blk_1: {
......@@ -4703,6 +5924,10 @@ const Parser = struct {
47035924 };
47045925 }
47055926 pub fn parseKEYWORD_enum(p: *Parser) Error!bool {
5927 const def_index = @intFromEnum(Def.defKEYWORD_enum);
5928 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5929 p.depths[def_index] += 1;
5930 defer p.depths[def_index] -= 1;
47065931 return blk_0: {
47075932 const pos_0 = p.i;
47085933 if (try p.parseskip() and blk_1: {
......@@ -4717,6 +5942,10 @@ const Parser = struct {
47175942 };
47185943 }
47195944 pub fn parseKEYWORD_errdefer(p: *Parser) Error!bool {
5945 const def_index = @intFromEnum(Def.defKEYWORD_errdefer);
5946 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5947 p.depths[def_index] += 1;
5948 defer p.depths[def_index] -= 1;
47205949 return blk_0: {
47215950 const pos_0 = p.i;
47225951 if (try p.parseskip() and blk_1: {
......@@ -4731,6 +5960,10 @@ const Parser = struct {
47315960 };
47325961 }
47335962 pub fn parseKEYWORD_error(p: *Parser) Error!bool {
5963 const def_index = @intFromEnum(Def.defKEYWORD_error);
5964 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5965 p.depths[def_index] += 1;
5966 defer p.depths[def_index] -= 1;
47345967 return blk_0: {
47355968 const pos_0 = p.i;
47365969 if (try p.parseskip() and blk_1: {
......@@ -4745,6 +5978,10 @@ const Parser = struct {
47455978 };
47465979 }
47475980 pub fn parseKEYWORD_export(p: *Parser) Error!bool {
5981 const def_index = @intFromEnum(Def.defKEYWORD_export);
5982 if (p.depths[def_index] > max_depth) return error.MaxDepth;
5983 p.depths[def_index] += 1;
5984 defer p.depths[def_index] -= 1;
47485985 return blk_0: {
47495986 const pos_0 = p.i;
47505987 if (try p.parseskip() and blk_1: {
......@@ -4759,6 +5996,10 @@ const Parser = struct {
47595996 };
47605997 }
47615998 pub fn parseKEYWORD_extern(p: *Parser) Error!bool {
5999 const def_index = @intFromEnum(Def.defKEYWORD_extern);
6000 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6001 p.depths[def_index] += 1;
6002 defer p.depths[def_index] -= 1;
47626003 return blk_0: {
47636004 const pos_0 = p.i;
47646005 if (try p.parseskip() and blk_1: {
......@@ -4773,6 +6014,10 @@ const Parser = struct {
47736014 };
47746015 }
47756016 pub fn parseKEYWORD_fn(p: *Parser) Error!bool {
6017 const def_index = @intFromEnum(Def.defKEYWORD_fn);
6018 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6019 p.depths[def_index] += 1;
6020 defer p.depths[def_index] -= 1;
47766021 return blk_0: {
47776022 const pos_0 = p.i;
47786023 if (try p.parseskip() and blk_1: {
......@@ -4787,6 +6032,10 @@ const Parser = struct {
47876032 };
47886033 }
47896034 pub fn parseKEYWORD_for(p: *Parser) Error!bool {
6035 const def_index = @intFromEnum(Def.defKEYWORD_for);
6036 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6037 p.depths[def_index] += 1;
6038 defer p.depths[def_index] -= 1;
47906039 return blk_0: {
47916040 const pos_0 = p.i;
47926041 if (try p.parseskip() and blk_1: {
......@@ -4801,6 +6050,10 @@ const Parser = struct {
48016050 };
48026051 }
48036052 pub fn parseKEYWORD_if(p: *Parser) Error!bool {
6053 const def_index = @intFromEnum(Def.defKEYWORD_if);
6054 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6055 p.depths[def_index] += 1;
6056 defer p.depths[def_index] -= 1;
48046057 return blk_0: {
48056058 const pos_0 = p.i;
48066059 if (try p.parseskip() and blk_1: {
......@@ -4815,6 +6068,10 @@ const Parser = struct {
48156068 };
48166069 }
48176070 pub fn parseKEYWORD_inline(p: *Parser) Error!bool {
6071 const def_index = @intFromEnum(Def.defKEYWORD_inline);
6072 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6073 p.depths[def_index] += 1;
6074 defer p.depths[def_index] -= 1;
48186075 return blk_0: {
48196076 const pos_0 = p.i;
48206077 if (try p.parseskip() and blk_1: {
......@@ -4829,6 +6086,10 @@ const Parser = struct {
48296086 };
48306087 }
48316088 pub fn parseKEYWORD_noalias(p: *Parser) Error!bool {
6089 const def_index = @intFromEnum(Def.defKEYWORD_noalias);
6090 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6091 p.depths[def_index] += 1;
6092 defer p.depths[def_index] -= 1;
48326093 return blk_0: {
48336094 const pos_0 = p.i;
48346095 if (try p.parseskip() and blk_1: {
......@@ -4843,6 +6104,10 @@ const Parser = struct {
48436104 };
48446105 }
48456106 pub fn parseKEYWORD_nosuspend(p: *Parser) Error!bool {
6107 const def_index = @intFromEnum(Def.defKEYWORD_nosuspend);
6108 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6109 p.depths[def_index] += 1;
6110 defer p.depths[def_index] -= 1;
48466111 return blk_0: {
48476112 const pos_0 = p.i;
48486113 if (try p.parseskip() and blk_1: {
......@@ -4857,6 +6122,10 @@ const Parser = struct {
48576122 };
48586123 }
48596124 pub fn parseKEYWORD_noinline(p: *Parser) Error!bool {
6125 const def_index = @intFromEnum(Def.defKEYWORD_noinline);
6126 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6127 p.depths[def_index] += 1;
6128 defer p.depths[def_index] -= 1;
48606129 return blk_0: {
48616130 const pos_0 = p.i;
48626131 if (try p.parseskip() and blk_1: {
......@@ -4871,6 +6140,10 @@ const Parser = struct {
48716140 };
48726141 }
48736142 pub fn parseKEYWORD_opaque(p: *Parser) Error!bool {
6143 const def_index = @intFromEnum(Def.defKEYWORD_opaque);
6144 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6145 p.depths[def_index] += 1;
6146 defer p.depths[def_index] -= 1;
48746147 return blk_0: {
48756148 const pos_0 = p.i;
48766149 if (try p.parseskip() and blk_1: {
......@@ -4885,6 +6158,10 @@ const Parser = struct {
48856158 };
48866159 }
48876160 pub fn parseKEYWORD_or(p: *Parser) Error!bool {
6161 const def_index = @intFromEnum(Def.defKEYWORD_or);
6162 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6163 p.depths[def_index] += 1;
6164 defer p.depths[def_index] -= 1;
48886165 return blk_0: {
48896166 const pos_0 = p.i;
48906167 if (try p.parseskip() and blk_1: {
......@@ -4899,6 +6176,10 @@ const Parser = struct {
48996176 };
49006177 }
49016178 pub fn parseKEYWORD_orelse(p: *Parser) Error!bool {
6179 const def_index = @intFromEnum(Def.defKEYWORD_orelse);
6180 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6181 p.depths[def_index] += 1;
6182 defer p.depths[def_index] -= 1;
49026183 return blk_0: {
49036184 const pos_0 = p.i;
49046185 if (try p.parseskip() and blk_1: {
......@@ -4913,6 +6194,10 @@ const Parser = struct {
49136194 };
49146195 }
49156196 pub fn parseKEYWORD_packed(p: *Parser) Error!bool {
6197 const def_index = @intFromEnum(Def.defKEYWORD_packed);
6198 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6199 p.depths[def_index] += 1;
6200 defer p.depths[def_index] -= 1;
49166201 return blk_0: {
49176202 const pos_0 = p.i;
49186203 if (try p.parseskip() and blk_1: {
......@@ -4927,6 +6212,10 @@ const Parser = struct {
49276212 };
49286213 }
49296214 pub fn parseKEYWORD_pub(p: *Parser) Error!bool {
6215 const def_index = @intFromEnum(Def.defKEYWORD_pub);
6216 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6217 p.depths[def_index] += 1;
6218 defer p.depths[def_index] -= 1;
49306219 return blk_0: {
49316220 const pos_0 = p.i;
49326221 if (try p.parseskip() and blk_1: {
......@@ -4941,6 +6230,10 @@ const Parser = struct {
49416230 };
49426231 }
49436232 pub fn parseKEYWORD_resume(p: *Parser) Error!bool {
6233 const def_index = @intFromEnum(Def.defKEYWORD_resume);
6234 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6235 p.depths[def_index] += 1;
6236 defer p.depths[def_index] -= 1;
49446237 return blk_0: {
49456238 const pos_0 = p.i;
49466239 if (try p.parseskip() and blk_1: {
......@@ -4955,6 +6248,10 @@ const Parser = struct {
49556248 };
49566249 }
49576250 pub fn parseKEYWORD_return(p: *Parser) Error!bool {
6251 const def_index = @intFromEnum(Def.defKEYWORD_return);
6252 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6253 p.depths[def_index] += 1;
6254 defer p.depths[def_index] -= 1;
49586255 return blk_0: {
49596256 const pos_0 = p.i;
49606257 if (try p.parseskip() and blk_1: {
......@@ -4969,6 +6266,10 @@ const Parser = struct {
49696266 };
49706267 }
49716268 pub fn parseKEYWORD_linksection(p: *Parser) Error!bool {
6269 const def_index = @intFromEnum(Def.defKEYWORD_linksection);
6270 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6271 p.depths[def_index] += 1;
6272 defer p.depths[def_index] -= 1;
49726273 return blk_0: {
49736274 const pos_0 = p.i;
49746275 if (try p.parseskip() and blk_1: {
......@@ -4983,6 +6284,10 @@ const Parser = struct {
49836284 };
49846285 }
49856286 pub fn parseKEYWORD_struct(p: *Parser) Error!bool {
6287 const def_index = @intFromEnum(Def.defKEYWORD_struct);
6288 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6289 p.depths[def_index] += 1;
6290 defer p.depths[def_index] -= 1;
49866291 return blk_0: {
49876292 const pos_0 = p.i;
49886293 if (try p.parseskip() and blk_1: {
......@@ -4997,6 +6302,10 @@ const Parser = struct {
49976302 };
49986303 }
49996304 pub fn parseKEYWORD_suspend(p: *Parser) Error!bool {
6305 const def_index = @intFromEnum(Def.defKEYWORD_suspend);
6306 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6307 p.depths[def_index] += 1;
6308 defer p.depths[def_index] -= 1;
50006309 return blk_0: {
50016310 const pos_0 = p.i;
50026311 if (try p.parseskip() and blk_1: {
......@@ -5011,6 +6320,10 @@ const Parser = struct {
50116320 };
50126321 }
50136322 pub fn parseKEYWORD_switch(p: *Parser) Error!bool {
6323 const def_index = @intFromEnum(Def.defKEYWORD_switch);
6324 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6325 p.depths[def_index] += 1;
6326 defer p.depths[def_index] -= 1;
50146327 return blk_0: {
50156328 const pos_0 = p.i;
50166329 if (try p.parseskip() and blk_1: {
......@@ -5025,6 +6338,10 @@ const Parser = struct {
50256338 };
50266339 }
50276340 pub fn parseKEYWORD_test(p: *Parser) Error!bool {
6341 const def_index = @intFromEnum(Def.defKEYWORD_test);
6342 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6343 p.depths[def_index] += 1;
6344 defer p.depths[def_index] -= 1;
50286345 return blk_0: {
50296346 const pos_0 = p.i;
50306347 if (try p.parseskip() and blk_1: {
......@@ -5039,6 +6356,10 @@ const Parser = struct {
50396356 };
50406357 }
50416358 pub fn parseKEYWORD_threadlocal(p: *Parser) Error!bool {
6359 const def_index = @intFromEnum(Def.defKEYWORD_threadlocal);
6360 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6361 p.depths[def_index] += 1;
6362 defer p.depths[def_index] -= 1;
50426363 return blk_0: {
50436364 const pos_0 = p.i;
50446365 if (try p.parseskip() and blk_1: {
......@@ -5053,6 +6374,10 @@ const Parser = struct {
50536374 };
50546375 }
50556376 pub fn parseKEYWORD_try(p: *Parser) Error!bool {
6377 const def_index = @intFromEnum(Def.defKEYWORD_try);
6378 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6379 p.depths[def_index] += 1;
6380 defer p.depths[def_index] -= 1;
50566381 return blk_0: {
50576382 const pos_0 = p.i;
50586383 if (try p.parseskip() and blk_1: {
......@@ -5067,6 +6392,10 @@ const Parser = struct {
50676392 };
50686393 }
50696394 pub fn parseKEYWORD_union(p: *Parser) Error!bool {
6395 const def_index = @intFromEnum(Def.defKEYWORD_union);
6396 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6397 p.depths[def_index] += 1;
6398 defer p.depths[def_index] -= 1;
50706399 return blk_0: {
50716400 const pos_0 = p.i;
50726401 if (try p.parseskip() and blk_1: {
......@@ -5081,6 +6410,10 @@ const Parser = struct {
50816410 };
50826411 }
50836412 pub fn parseKEYWORD_unreachable(p: *Parser) Error!bool {
6413 const def_index = @intFromEnum(Def.defKEYWORD_unreachable);
6414 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6415 p.depths[def_index] += 1;
6416 defer p.depths[def_index] -= 1;
50846417 return blk_0: {
50856418 const pos_0 = p.i;
50866419 if (try p.parseskip() and blk_1: {
......@@ -5095,6 +6428,10 @@ const Parser = struct {
50956428 };
50966429 }
50976430 pub fn parseKEYWORD_var(p: *Parser) Error!bool {
6431 const def_index = @intFromEnum(Def.defKEYWORD_var);
6432 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6433 p.depths[def_index] += 1;
6434 defer p.depths[def_index] -= 1;
50986435 return blk_0: {
50996436 const pos_0 = p.i;
51006437 if (try p.parseskip() and blk_1: {
......@@ -5109,6 +6446,10 @@ const Parser = struct {
51096446 };
51106447 }
51116448 pub fn parseKEYWORD_volatile(p: *Parser) Error!bool {
6449 const def_index = @intFromEnum(Def.defKEYWORD_volatile);
6450 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6451 p.depths[def_index] += 1;
6452 defer p.depths[def_index] -= 1;
51126453 return blk_0: {
51136454 const pos_0 = p.i;
51146455 if (try p.parseskip() and blk_1: {
......@@ -5123,6 +6464,10 @@ const Parser = struct {
51236464 };
51246465 }
51256466 pub fn parseKEYWORD_while(p: *Parser) Error!bool {
6467 const def_index = @intFromEnum(Def.defKEYWORD_while);
6468 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6469 p.depths[def_index] += 1;
6470 defer p.depths[def_index] -= 1;
51266471 return blk_0: {
51276472 const pos_0 = p.i;
51286473 if (try p.parseskip() and blk_1: {
......@@ -5137,6 +6482,10 @@ const Parser = struct {
51376482 };
51386483 }
51396484 pub fn parsekeyword(p: *Parser) Error!bool {
6485 const def_index = @intFromEnum(Def.defkeyword);
6486 if (p.depths[def_index] > max_depth) return error.MaxDepth;
6487 p.depths[def_index] += 1;
6488 defer p.depths[def_index] -= 1;
51406489 return blk_0: {
51416490 const pos_0 = p.i;
51426491 if (try p.parseKEYWORD_addrspace()) break :blk_0 true;
tools/gen_parser_oracle.zig+27-24
......@@ -89,18 +89,31 @@ const Generator = struct {
8989 \\/// the grammar.
9090 \\/// Returns error.MaxDepth if more than `max_depth` levels of recursion/iteration are reached.
9191 \\pub fn parse(source: []const u8) Error!bool {
92 \\ var p: Parser = .{ .source = source, .i = 0, .expr_depth = 1, .block_depth = 1 };
92 \\ var p: Parser = .{ .source = source, .i = 0, .depths = @splat(1) };
9393 \\ return p.parseRoot();
9494 \\}
95 \\
96 \\const Parser = struct {
95 );
96
97 const defs = g.p.getExtra(node.get(g.p).root);
98
99 // This enum exists to minimize git diffs in the generated oracle when
100 // the grammar is modified. It allows mapping from def name (stable) to
101 // def index (unstable).
102 try g.w.writeAll("const Def = enum {");
103 for (defs) |n| {
104 const def = n.get(g.p).def;
105 const id = def.id.get(g.p).id;
106 try g.w.print("def{s},", .{id});
107 }
108 try g.w.writeAll("};");
109
110 try g.w.print(
111 \\const Parser = struct {{
97112 \\ source: []const u8,
98113 \\ i: usize,
99 \\ expr_depth: usize,
100 \\ block_depth: usize,
101 \\
102 );
103 for (g.p.getExtra(node.get(g.p).root)) |def| {
114 \\ depths: [{d}]u8,
115 , .{defs.len});
116 for (defs) |def| {
104117 try g.genDef(def);
105118 }
106119 try g.w.writeAll("};");
......@@ -111,22 +124,12 @@ const Generator = struct {
111124 const id = def.id.get(g.p).id;
112125 assert(g.suffix == 0);
113126 try g.w.print("pub fn parse{s}(p: *Parser) Error!bool {{", .{id});
114 // The grammar can infinitely recurse through the Expr rule
115 if (mem.eql(u8, "Expr", id)) {
116 try g.w.print(
117 \\if (p.expr_depth >= max_depth) return error.MaxDepth;
118 \\p.expr_depth += 1;
119 \\defer p.expr_depth -= 1;
120 , .{});
121 }
122 // The grammar can infinitely recurse through the Block rule
123 if (mem.eql(u8, "Block", id)) {
124 try g.w.print(
125 \\if (p.block_depth >= max_depth) return error.MaxDepth;
126 \\p.block_depth += 1;
127 \\defer p.block_depth -= 1;
128 , .{});
129 }
127 try g.w.print(
128 \\const def_index = @intFromEnum(Def.def{s});
129 \\if (p.depths[def_index] > max_depth) return error.MaxDepth;
130 \\p.depths[def_index] += 1;
131 \\defer p.depths[def_index] -= 1;
132 , .{id});
130133 try g.w.writeAll("return ");
131134 try g.genExpr(def.expr);
132135 try g.w.writeAll(";}");