authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2026-07-03 13:49:02+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2026-07-08 11:49:00+02:00
log775dac91494ed602061ce4a28e7da8d64a0bd18a
tree9997465b0970532376e6aad38856f7fd28faa342
parent3681c7c506829322a2980d5bd98e493968fdea68
signaturelock-open Commit is signed but in an unrecognized format.

tools: add max depth to parser oracle

This is useful to avoid unbounded recursion/iteration while fuzzing. It's not interesting to learn that the parser hits a stack overflow when fed a million open parens for example.

3 files changed, 1269 insertions(+), 1008 deletions(-)

lib/std/zig/parser_fuzz.zig+15-2
...@@ -14,7 +14,18 @@ fn fuzzAgainstOracle(_: void, smith: *Smith) !void {...@@ -14,7 +14,18 @@ fn fuzzAgainstOracle(_: void, smith: *Smith) !void {
14 buffer[len] = 0;14 buffer[len] = 0;
15 const source = buffer[0..len :0];15 const source = buffer[0..len :0];
1616
17 try checkAgainstOracle(source);17 checkAgainstOracle(source) catch |err| switch (err) {
18 error.MaxDepth => return error.SkipZigTest,
19 else => |e| return e,
20 };
21}
22
23test "max depth" {
24 try std.testing.expectError(error.MaxDepth, checkAgainstOracle("((((("));
25 _ = checkAgainstOracle("((((") catch |err| switch (err) {
26 error.MaxDepth => try std.testing.expect(false),
27 else => |e| return e,
28 };
18}29}
1930
20// Found using AFL++31// Found using AFL++
...@@ -109,8 +120,10 @@ fn checkAgainstOracle(source: [:0]const u8) !void {...@@ -109,8 +120,10 @@ fn checkAgainstOracle(source: [:0]const u8) !void {
109120
110 const ast = try std.zig.Ast.parse(fba.allocator(), source, .zig);121 const ast = try std.zig.Ast.parse(fba.allocator(), source, .zig);
111122
123 const expected = try oracle.parse(source);
124
112 errdefer logBadSource(source, ast);125 errdefer logBadSource(source, ast);
113 try std.testing.expectEqual(oracle.parse(source), ast.errors.len == 0);126 try std.testing.expectEqual(expected, ast.errors.len == 0);
114}127}
115128
116fn logBadSource(source: []const u8, ast: std.zig.Ast) void {129fn logBadSource(source: []const u8, ast: std.zig.Ast) void {
lib/std/zig/parser_generated_oracle.zig+1222-996
...@@ -3,59 +3,76 @@...@@ -3,59 +3,76 @@
33
4const std = @import("std");4const std = @import("std");
55
6const Error = error{MaxDepth};
7const max_depth = 5;
8
6/// Returns true if the input source is in the language defined by9/// Returns true if the input source is in the language defined by
7/// the grammar.10/// the grammar.
8pub fn parse(source: []const u8) bool {11/// Returns error.MaxDepth if more than `max_depth` levels of recursion/iteration are reached.
9 var p: Parser = .{ .source = source, .i = 0 };12pub fn parse(source: []const u8) Error!bool {
13 var p: Parser = .{ .source = source, .i = 0, .expr_depth = 1 };
10 return p.parseRoot();14 return p.parseRoot();
11}15}
1216
13const Parser = struct {17const Parser = struct {
14 source: []const u8,18 source: []const u8,
15 i: usize,19 i: usize,
16 pub fn parseRoot(p: *Parser) bool {20 expr_depth: usize,
21 pub fn parseRoot(p: *Parser) Error!bool {
17 return blk_0: {22 return blk_0: {
18 const pos_0 = p.i;23 const pos_0 = p.i;
19 if (p.parseContainerMembers() and p.parseskip() and p.parseeof()) break :blk_0 true;24 if (try p.parseContainerMembers() and try p.parseskip() and try p.parseeof()) break :blk_0 true;
20 p.i = pos_0;25 p.i = pos_0;
21 break :blk_0 false;26 break :blk_0 false;
22 };27 };
23 }28 }
24 pub fn parseContainerMembers(p: *Parser) bool {29 pub fn parseContainerMembers(p: *Parser) Error!bool {
25 return blk_0: {30 return blk_0: {
26 const pos_0 = p.i;31 const pos_0 = p.i;
27 if ((p.parsecontainer_doc_comment() or true) and blk_1: {32 if ((try p.parsecontainer_doc_comment() or true) and blk_1: {
28 while (p.parseContainerDecl()) {}33 var i_1: usize = 0;
34 while (try p.parseContainerDecl()) {
35 if (i_1 > max_depth) return error.MaxDepth;
36 i_1 += 1;
37 }
29 break :blk_1 true;38 break :blk_1 true;
30 } and blk_1: {39 } and blk_1: {
31 const pos_1 = p.i;40 const pos_1 = p.i;
32 const match_1 = p.parseContainerDeclPrefix();41 const match_1 = try p.parseContainerDeclPrefix();
33 p.i = pos_1;42 p.i = pos_1;
34 break :blk_1 !match_1;43 break :blk_1 !match_1;
35 } and blk_1: {44 } and blk_1: {
45 var i_1: usize = 0;
36 while (blk_3: {46 while (blk_3: {
37 const pos_3 = p.i;47 const pos_3 = p.i;
38 if (blk_4: {48 if (blk_4: {
39 const pos_4 = p.i;49 const pos_4 = p.i;
40 const match_4 = p.parseContainerDeclPrefix();50 const match_4 = try p.parseContainerDeclPrefix();
41 p.i = pos_4;51 p.i = pos_4;
42 break :blk_4 !match_4;52 break :blk_4 !match_4;
43 } and p.parseContainerField() and p.parseCOMMA()) break :blk_3 true;53 } and try p.parseContainerField() and try p.parseCOMMA()) break :blk_3 true;
44 p.i = pos_3;54 p.i = pos_3;
45 break :blk_3 false;55 break :blk_3 false;
46 }) {}56 }) {
57 if (i_1 > max_depth) return error.MaxDepth;
58 i_1 += 1;
59 }
47 break :blk_1 true;60 break :blk_1 true;
48 } and blk_2: {61 } and blk_2: {
49 const pos_2 = p.i;62 const pos_2 = p.i;
50 if (blk_3: {63 if (blk_3: {
51 const pos_3 = p.i;64 const pos_3 = p.i;
52 const match_3 = p.parseContainerDeclPrefix();65 const match_3 = try p.parseContainerDeclPrefix();
53 p.i = pos_3;66 p.i = pos_3;
54 break :blk_3 !match_3;67 break :blk_3 !match_3;
55 } and p.parseContainerField()) break :blk_2 true;68 } and try p.parseContainerField()) break :blk_2 true;
56 p.i = pos_2;69 p.i = pos_2;
57 if (blk_3: {70 if (blk_3: {
58 while (p.parseContainerDecl()) {}71 var i_3: usize = 0;
72 while (try p.parseContainerDecl()) {
73 if (i_3 > max_depth) return error.MaxDepth;
74 i_3 += 1;
75 }
59 break :blk_3 true;76 break :blk_3 true;
60 }) break :blk_2 true;77 }) break :blk_2 true;
61 p.i = pos_2;78 p.i = pos_2;
...@@ -65,116 +82,116 @@ const Parser = struct {...@@ -65,116 +82,116 @@ const Parser = struct {
65 break :blk_0 false;82 break :blk_0 false;
66 };83 };
67 }84 }
68 pub fn parseContainerDecl(p: *Parser) bool {85 pub fn parseContainerDecl(p: *Parser) Error!bool {
69 return blk_0: {86 return blk_0: {
70 const pos_0 = p.i;87 const pos_0 = p.i;
71 if (p.parseTestDecl()) break :blk_0 true;88 if (try p.parseTestDecl()) break :blk_0 true;
72 p.i = pos_0;89 p.i = pos_0;
73 if (p.parseComptimeDecl()) break :blk_0 true;90 if (try p.parseComptimeDecl()) break :blk_0 true;
74 p.i = pos_0;91 p.i = pos_0;
75 if ((p.parsedoc_comment() or true) and (p.parseKEYWORD_pub() or true) and p.parseDecl()) break :blk_0 true;92 if ((try p.parsedoc_comment() or true) and (try p.parseKEYWORD_pub() or true) and try p.parseDecl()) break :blk_0 true;
76 p.i = pos_0;93 p.i = pos_0;
77 break :blk_0 false;94 break :blk_0 false;
78 };95 };
79 }96 }
80 pub fn parseContainerDeclPrefix(p: *Parser) bool {97 pub fn parseContainerDeclPrefix(p: *Parser) Error!bool {
81 return blk_0: {98 return blk_0: {
82 const pos_0 = p.i;99 const pos_0 = p.i;
83 if (p.parseKEYWORD_test()) break :blk_0 true;100 if (try p.parseKEYWORD_test()) break :blk_0 true;
84 p.i = pos_0;101 p.i = pos_0;
85 if (p.parseKEYWORD_comptime() and p.parseLBRACE()) break :blk_0 true;102 if (try p.parseKEYWORD_comptime() and try p.parseLBRACE()) break :blk_0 true;
86 p.i = pos_0;103 p.i = pos_0;
87 if ((p.parsedoc_comment() or true) and (p.parseKEYWORD_pub() or true) and p.parseDeclPrefix()) break :blk_0 true;104 if ((try p.parsedoc_comment() or true) and (try p.parseKEYWORD_pub() or true) and try p.parseDeclPrefix()) break :blk_0 true;
88 p.i = pos_0;105 p.i = pos_0;
89 break :blk_0 false;106 break :blk_0 false;
90 };107 };
91 }108 }
92 pub fn parseTestDecl(p: *Parser) bool {109 pub fn parseTestDecl(p: *Parser) Error!bool {
93 return blk_0: {110 return blk_0: {
94 const pos_0 = p.i;111 const pos_0 = p.i;
95 if (p.parseKEYWORD_test() and (blk_3: {112 if (try p.parseKEYWORD_test() and (blk_3: {
96 const pos_3 = p.i;113 const pos_3 = p.i;
97 if (p.parseSTRINGLITERALSINGLE()) break :blk_3 true;114 if (try p.parseSTRINGLITERALSINGLE()) break :blk_3 true;
98 p.i = pos_3;115 p.i = pos_3;
99 if (p.parseIDENTIFIER()) break :blk_3 true;116 if (try p.parseIDENTIFIER()) break :blk_3 true;
100 p.i = pos_3;117 p.i = pos_3;
101 break :blk_3 false;118 break :blk_3 false;
102 } or true) and p.parseBlock()) break :blk_0 true;119 } or true) and try p.parseBlock()) break :blk_0 true;
103 p.i = pos_0;120 p.i = pos_0;
104 break :blk_0 false;121 break :blk_0 false;
105 };122 };
106 }123 }
107 pub fn parseComptimeDecl(p: *Parser) bool {124 pub fn parseComptimeDecl(p: *Parser) Error!bool {
108 return blk_0: {125 return blk_0: {
109 const pos_0 = p.i;126 const pos_0 = p.i;
110 if (p.parseKEYWORD_comptime() and p.parseBlock()) break :blk_0 true;127 if (try p.parseKEYWORD_comptime() and try p.parseBlock()) break :blk_0 true;
111 p.i = pos_0;128 p.i = pos_0;
112 break :blk_0 false;129 break :blk_0 false;
113 };130 };
114 }131 }
115 pub fn parseDecl(p: *Parser) bool {132 pub fn parseDecl(p: *Parser) Error!bool {
116 return blk_0: {133 return blk_0: {
117 const pos_0 = p.i;134 const pos_0 = p.i;
118 if ((blk_3: {135 if ((blk_3: {
119 const pos_3 = p.i;136 const pos_3 = p.i;
120 if (p.parseKEYWORD_export()) break :blk_3 true;137 if (try p.parseKEYWORD_export()) break :blk_3 true;
121 p.i = pos_3;138 p.i = pos_3;
122 if (p.parseKEYWORD_inline()) break :blk_3 true;139 if (try p.parseKEYWORD_inline()) break :blk_3 true;
123 p.i = pos_3;140 p.i = pos_3;
124 if (p.parseKEYWORD_noinline()) break :blk_3 true;141 if (try p.parseKEYWORD_noinline()) break :blk_3 true;
125 p.i = pos_3;142 p.i = pos_3;
126 break :blk_3 false;143 break :blk_3 false;
127 } or true) and p.parseFnProto() and blk_2: {144 } or true) and try p.parseFnProto() and blk_2: {
128 const pos_2 = p.i;145 const pos_2 = p.i;
129 if (p.parseSEMICOLON()) break :blk_2 true;146 if (try p.parseSEMICOLON()) break :blk_2 true;
130 p.i = pos_2;147 p.i = pos_2;
131 if (p.parseBlock()) break :blk_2 true;148 if (try p.parseBlock()) break :blk_2 true;
132 p.i = pos_2;149 p.i = pos_2;
133 break :blk_2 false;150 break :blk_2 false;
134 }) break :blk_0 true;151 }) break :blk_0 true;
135 p.i = pos_0;152 p.i = pos_0;
136 if (p.parseKEYWORD_extern() and (p.parseSTRINGLITERALSINGLE() or true) and p.parseFnProto() and p.parseSEMICOLON()) break :blk_0 true;153 if (try p.parseKEYWORD_extern() and (try p.parseSTRINGLITERALSINGLE() or true) and try p.parseFnProto() and try p.parseSEMICOLON()) break :blk_0 true;
137 p.i = pos_0;154 p.i = pos_0;
138 if ((blk_3: {155 if ((blk_3: {
139 const pos_3 = p.i;156 const pos_3 = p.i;
140 if (p.parseKEYWORD_export()) break :blk_3 true;157 if (try p.parseKEYWORD_export()) break :blk_3 true;
141 p.i = pos_3;158 p.i = pos_3;
142 if (p.parseKEYWORD_extern() and (p.parseSTRINGLITERALSINGLE() or true)) break :blk_3 true;159 if (try p.parseKEYWORD_extern() and (try p.parseSTRINGLITERALSINGLE() or true)) break :blk_3 true;
143 p.i = pos_3;160 p.i = pos_3;
144 break :blk_3 false;161 break :blk_3 false;
145 } or true) and (p.parseKEYWORD_threadlocal() or true) and p.parseGlobalVarDecl()) break :blk_0 true;162 } or true) and (try p.parseKEYWORD_threadlocal() or true) and try p.parseGlobalVarDecl()) break :blk_0 true;
146 p.i = pos_0;163 p.i = pos_0;
147 break :blk_0 false;164 break :blk_0 false;
148 };165 };
149 }166 }
150 pub fn parseDeclPrefix(p: *Parser) bool {167 pub fn parseDeclPrefix(p: *Parser) Error!bool {
151 return blk_0: {168 return blk_0: {
152 const pos_0 = p.i;169 const pos_0 = p.i;
153 if ((blk_3: {170 if ((blk_3: {
154 const pos_3 = p.i;171 const pos_3 = p.i;
155 if (p.parseKEYWORD_export()) break :blk_3 true;172 if (try p.parseKEYWORD_export()) break :blk_3 true;
156 p.i = pos_3;173 p.i = pos_3;
157 if (p.parseKEYWORD_inline()) break :blk_3 true;174 if (try p.parseKEYWORD_inline()) break :blk_3 true;
158 p.i = pos_3;175 p.i = pos_3;
159 if (p.parseKEYWORD_noinline()) break :blk_3 true;176 if (try p.parseKEYWORD_noinline()) break :blk_3 true;
160 p.i = pos_3;177 p.i = pos_3;
161 break :blk_3 false;178 break :blk_3 false;
162 } or true) and p.parseKEYWORD_fn()) break :blk_0 true;179 } or true) and try p.parseKEYWORD_fn()) break :blk_0 true;
163 p.i = pos_0;180 p.i = pos_0;
164 if (p.parseKEYWORD_extern() and (p.parseSTRINGLITERALSINGLE() or true) and p.parseKEYWORD_fn()) break :blk_0 true;181 if (try p.parseKEYWORD_extern() and (try p.parseSTRINGLITERALSINGLE() or true) and try p.parseKEYWORD_fn()) break :blk_0 true;
165 p.i = pos_0;182 p.i = pos_0;
166 if ((blk_3: {183 if ((blk_3: {
167 const pos_3 = p.i;184 const pos_3 = p.i;
168 if (p.parseKEYWORD_export()) break :blk_3 true;185 if (try p.parseKEYWORD_export()) break :blk_3 true;
169 p.i = pos_3;186 p.i = pos_3;
170 if (p.parseKEYWORD_extern() and (p.parseSTRINGLITERALSINGLE() or true)) break :blk_3 true;187 if (try p.parseKEYWORD_extern() and (try p.parseSTRINGLITERALSINGLE() or true)) break :blk_3 true;
171 p.i = pos_3;188 p.i = pos_3;
172 break :blk_3 false;189 break :blk_3 false;
173 } or true) and (p.parseKEYWORD_threadlocal() or true) and blk_2: {190 } or true) and (try p.parseKEYWORD_threadlocal() or true) and blk_2: {
174 const pos_2 = p.i;191 const pos_2 = p.i;
175 if (p.parseKEYWORD_const()) break :blk_2 true;192 if (try p.parseKEYWORD_const()) break :blk_2 true;
176 p.i = pos_2;193 p.i = pos_2;
177 if (p.parseKEYWORD_var()) break :blk_2 true;194 if (try p.parseKEYWORD_var()) break :blk_2 true;
178 p.i = pos_2;195 p.i = pos_2;
179 break :blk_2 false;196 break :blk_2 false;
180 }) break :blk_0 true;197 }) break :blk_0 true;
...@@ -182,58 +199,58 @@ const Parser = struct {...@@ -182,58 +199,58 @@ const Parser = struct {
182 break :blk_0 false;199 break :blk_0 false;
183 };200 };
184 }201 }
185 pub fn parseFnProto(p: *Parser) bool {202 pub fn parseFnProto(p: *Parser) Error!bool {
186 return blk_0: {203 return blk_0: {
187 const pos_0 = p.i;204 const pos_0 = p.i;
188 if (p.parseKEYWORD_fn() and (p.parseIDENTIFIER() or true) and p.parseLPAREN() and p.parseParamDeclList() and p.parseRPAREN() and (p.parseByteAlign() or true) and (p.parseAddrSpace() or true) and (p.parseLinkSection() or true) and (p.parseCallConv() or true) and (p.parseEXCLAMATIONMARK() or true) and p.parseTypeExpr()) break :blk_0 true;205 if (try p.parseKEYWORD_fn() and (try p.parseIDENTIFIER() or true) and try p.parseLPAREN() and try p.parseParamDeclList() and try p.parseRPAREN() 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;
189 p.i = pos_0;206 p.i = pos_0;
190 break :blk_0 false;207 break :blk_0 false;
191 };208 };
192 }209 }
193 pub fn parseVarDeclProto(p: *Parser) bool {210 pub fn parseVarDeclProto(p: *Parser) Error!bool {
194 return blk_0: {211 return blk_0: {
195 const pos_0 = p.i;212 const pos_0 = p.i;
196 if (blk_2: {213 if (blk_2: {
197 const pos_2 = p.i;214 const pos_2 = p.i;
198 if (p.parseKEYWORD_const()) break :blk_2 true;215 if (try p.parseKEYWORD_const()) break :blk_2 true;
199 p.i = pos_2;216 p.i = pos_2;
200 if (p.parseKEYWORD_var()) break :blk_2 true;217 if (try p.parseKEYWORD_var()) break :blk_2 true;
201 p.i = pos_2;218 p.i = pos_2;
202 break :blk_2 false;219 break :blk_2 false;
203 } and p.parseIDENTIFIER() and (blk_3: {220 } and try p.parseIDENTIFIER() and (blk_3: {
204 const pos_3 = p.i;221 const pos_3 = p.i;
205 if (p.parseCOLON() and p.parseTypeExpr()) break :blk_3 true;222 if (try p.parseCOLON() and try p.parseTypeExpr()) break :blk_3 true;
206 p.i = pos_3;223 p.i = pos_3;
207 break :blk_3 false;224 break :blk_3 false;
208 } or true) and (p.parseByteAlign() or true) and (p.parseAddrSpace() or true) and (p.parseLinkSection() or true)) break :blk_0 true;225 } or true) and (try p.parseByteAlign() or true) and (try p.parseAddrSpace() or true) and (try p.parseLinkSection() or true)) break :blk_0 true;
209 p.i = pos_0;226 p.i = pos_0;
210 break :blk_0 false;227 break :blk_0 false;
211 };228 };
212 }229 }
213 pub fn parseGlobalVarDecl(p: *Parser) bool {230 pub fn parseGlobalVarDecl(p: *Parser) Error!bool {
214 return blk_0: {231 return blk_0: {
215 const pos_0 = p.i;232 const pos_0 = p.i;
216 if (p.parseVarDeclProto() and (blk_3: {233 if (try p.parseVarDeclProto() and (blk_3: {
217 const pos_3 = p.i;234 const pos_3 = p.i;
218 if (p.parseEQUAL() and p.parseExpr()) break :blk_3 true;235 if (try p.parseEQUAL() and try p.parseExpr()) break :blk_3 true;
219 p.i = pos_3;236 p.i = pos_3;
220 break :blk_3 false;237 break :blk_3 false;
221 } or true) and p.parseSEMICOLON()) break :blk_0 true;238 } or true) and try p.parseSEMICOLON()) break :blk_0 true;
222 p.i = pos_0;239 p.i = pos_0;
223 break :blk_0 false;240 break :blk_0 false;
224 };241 };
225 }242 }
226 pub fn parseContainerField(p: *Parser) bool {243 pub fn parseContainerField(p: *Parser) Error!bool {
227 return blk_0: {244 return blk_0: {
228 const pos_0 = p.i;245 const pos_0 = p.i;
229 if ((p.parsedoc_comment() or true) and (p.parseKEYWORD_comptime() or true) and (blk_3: {246 if ((try p.parsedoc_comment() or true) and (try p.parseKEYWORD_comptime() or true) and (blk_3: {
230 const pos_3 = p.i;247 const pos_3 = p.i;
231 if (p.parseIDENTIFIER() and p.parseCOLON()) break :blk_3 true;248 if (try p.parseIDENTIFIER() and try p.parseCOLON()) break :blk_3 true;
232 p.i = pos_3;249 p.i = pos_3;
233 break :blk_3 false;250 break :blk_3 false;
234 } or true) and p.parseTypeExpr() and (p.parseByteAlign() or true) and (blk_3: {251 } or true) and try p.parseTypeExpr() and (try p.parseByteAlign() or true) and (blk_3: {
235 const pos_3 = p.i;252 const pos_3 = p.i;
236 if (p.parseEQUAL() and p.parseExpr()) break :blk_3 true;253 if (try p.parseEQUAL() and try p.parseExpr()) break :blk_3 true;
237 p.i = pos_3;254 p.i = pos_3;
238 break :blk_3 false;255 break :blk_3 false;
239 } or true)) break :blk_0 true;256 } or true)) break :blk_0 true;
...@@ -241,68 +258,68 @@ const Parser = struct {...@@ -241,68 +258,68 @@ const Parser = struct {
241 break :blk_0 false;258 break :blk_0 false;
242 };259 };
243 }260 }
244 pub fn parseBlockStatement(p: *Parser) bool {261 pub fn parseBlockStatement(p: *Parser) Error!bool {
245 return blk_0: {262 return blk_0: {
246 const pos_0 = p.i;263 const pos_0 = p.i;
247 if (p.parseStatement()) break :blk_0 true;264 if (try p.parseStatement()) break :blk_0 true;
248 p.i = pos_0;265 p.i = pos_0;
249 if (p.parseKEYWORD_defer() and p.parseBlockExprStatement()) break :blk_0 true;266 if (try p.parseKEYWORD_defer() and try p.parseBlockExprStatement()) break :blk_0 true;
250 p.i = pos_0;267 p.i = pos_0;
251 if (p.parseKEYWORD_errdefer() and p.parseBlockExprStatement()) break :blk_0 true;268 if (try p.parseKEYWORD_errdefer() and try p.parseBlockExprStatement()) break :blk_0 true;
252 p.i = pos_0;269 p.i = pos_0;
253 if ((blk_3: {270 if ((blk_3: {
254 const pos_3 = p.i;271 const pos_3 = p.i;
255 if (p.parseKEYWORD_comptime() and blk_4: {272 if (try p.parseKEYWORD_comptime() and blk_4: {
256 const pos_4 = p.i;273 const pos_4 = p.i;
257 const match_4 = p.parseBlockExprPrefix();274 const match_4 = try p.parseBlockExprPrefix();
258 p.i = pos_4;275 p.i = pos_4;
259 break :blk_4 !match_4;276 break :blk_4 !match_4;
260 }) break :blk_3 true;277 }) break :blk_3 true;
261 p.i = pos_3;278 p.i = pos_3;
262 break :blk_3 false;279 break :blk_3 false;
263 } or true) and p.parseVarAssignStatement()) break :blk_0 true;280 } or true) and try p.parseVarAssignStatement()) break :blk_0 true;
264 p.i = pos_0;281 p.i = pos_0;
265 break :blk_0 false;282 break :blk_0 false;
266 };283 };
267 }284 }
268 pub fn parseStatement(p: *Parser) bool {285 pub fn parseStatement(p: *Parser) Error!bool {
269 return blk_0: {286 return blk_0: {
270 const pos_0 = p.i;287 const pos_0 = p.i;
271 if (p.parseIfStatement()) break :blk_0 true;288 if (try p.parseIfStatement()) break :blk_0 true;
272 p.i = pos_0;289 p.i = pos_0;
273 if (p.parseLabeledStatement()) break :blk_0 true;290 if (try p.parseLabeledStatement()) break :blk_0 true;
274 p.i = pos_0;291 p.i = pos_0;
275 if (p.parseKEYWORD_nosuspend() and p.parseBlockExprStatement()) break :blk_0 true;292 if (try p.parseKEYWORD_nosuspend() and try p.parseBlockExprStatement()) break :blk_0 true;
276 p.i = pos_0;293 p.i = pos_0;
277 if (p.parseKEYWORD_comptime() and p.parseBlockExpr()) break :blk_0 true;294 if (try p.parseKEYWORD_comptime() and try p.parseBlockExpr()) break :blk_0 true;
278 p.i = pos_0;295 p.i = pos_0;
279 if (p.parseKEYWORD_suspend() and p.parseBlockExprStatement()) break :blk_0 true;296 if (try p.parseKEYWORD_suspend() and try p.parseBlockExprStatement()) break :blk_0 true;
280 p.i = pos_0;297 p.i = pos_0;
281 if ((blk_3: {298 if ((blk_3: {
282 const pos_3 = p.i;299 const pos_3 = p.i;
283 if (p.parseKEYWORD_comptime() and blk_4: {300 if (try p.parseKEYWORD_comptime() and blk_4: {
284 const pos_4 = p.i;301 const pos_4 = p.i;
285 const match_4 = p.parseBlockExprPrefix();302 const match_4 = try p.parseBlockExprPrefix();
286 p.i = pos_4;303 p.i = pos_4;
287 break :blk_4 !match_4;304 break :blk_4 !match_4;
288 }) break :blk_3 true;305 }) break :blk_3 true;
289 p.i = pos_3;306 p.i = pos_3;
290 break :blk_3 false;307 break :blk_3 false;
291 } or true) and p.parseAssignExpr() and p.parseSEMICOLON()) break :blk_0 true;308 } or true) and try p.parseAssignExpr() and try p.parseSEMICOLON()) break :blk_0 true;
292 p.i = pos_0;309 p.i = pos_0;
293 break :blk_0 false;310 break :blk_0 false;
294 };311 };
295 }312 }
296 pub fn parseIfStatement(p: *Parser) bool {313 pub fn parseIfStatement(p: *Parser) Error!bool {
297 return blk_0: {314 return blk_0: {
298 const pos_0 = p.i;315 const pos_0 = p.i;
299 if (p.parseIfPrefix() and p.parseBlockExpr() and blk_2: {316 if (try p.parseIfPrefix() and try p.parseBlockExpr() and blk_2: {
300 const pos_2 = p.i;317 const pos_2 = p.i;
301 if (p.parseKEYWORD_else() and (p.parsePayload() or true) and p.parseStatement()) break :blk_2 true;318 if (try p.parseKEYWORD_else() and (try p.parsePayload() or true) and try p.parseStatement()) break :blk_2 true;
302 p.i = pos_2;319 p.i = pos_2;
303 if (blk_3: {320 if (blk_3: {
304 const pos_3 = p.i;321 const pos_3 = p.i;
305 const match_3 = p.parseKEYWORD_else();322 const match_3 = try p.parseKEYWORD_else();
306 p.i = pos_3;323 p.i = pos_3;
307 break :blk_3 !match_3;324 break :blk_3 !match_3;
308 }) break :blk_2 true;325 }) break :blk_2 true;
...@@ -310,16 +327,16 @@ const Parser = struct {...@@ -310,16 +327,16 @@ const Parser = struct {
310 break :blk_2 false;327 break :blk_2 false;
311 }) break :blk_0 true;328 }) break :blk_0 true;
312 p.i = pos_0;329 p.i = pos_0;
313 if (p.parseIfPrefix() and blk_1: {330 if (try p.parseIfPrefix() and blk_1: {
314 const pos_1 = p.i;331 const pos_1 = p.i;
315 const match_1 = p.parseBlockExprPrefix();332 const match_1 = try p.parseBlockExprPrefix();
316 p.i = pos_1;333 p.i = pos_1;
317 break :blk_1 !match_1;334 break :blk_1 !match_1;
318 } and p.parseAssignExpr() and blk_2: {335 } and try p.parseAssignExpr() and blk_2: {
319 const pos_2 = p.i;336 const pos_2 = p.i;
320 if (p.parseSEMICOLON()) break :blk_2 true;337 if (try p.parseSEMICOLON()) break :blk_2 true;
321 p.i = pos_2;338 p.i = pos_2;
322 if (p.parseKEYWORD_else() and (p.parsePayload() or true) and p.parseStatement()) break :blk_2 true;339 if (try p.parseKEYWORD_else() and (try p.parsePayload() or true) and try p.parseStatement()) break :blk_2 true;
323 p.i = pos_2;340 p.i = pos_2;
324 break :blk_2 false;341 break :blk_2 false;
325 }) break :blk_0 true;342 }) break :blk_0 true;
...@@ -327,16 +344,16 @@ const Parser = struct {...@@ -327,16 +344,16 @@ const Parser = struct {
327 break :blk_0 false;344 break :blk_0 false;
328 };345 };
329 }346 }
330 pub fn parseLabeledStatement(p: *Parser) bool {347 pub fn parseLabeledStatement(p: *Parser) Error!bool {
331 return blk_0: {348 return blk_0: {
332 const pos_0 = p.i;349 const pos_0 = p.i;
333 if ((p.parseBlockLabel() or true) and blk_2: {350 if ((try p.parseBlockLabel() or true) and blk_2: {
334 const pos_2 = p.i;351 const pos_2 = p.i;
335 if (p.parseBlock()) break :blk_2 true;352 if (try p.parseBlock()) break :blk_2 true;
336 p.i = pos_2;353 p.i = pos_2;
337 if (p.parseLoopStatement()) break :blk_2 true;354 if (try p.parseLoopStatement()) break :blk_2 true;
338 p.i = pos_2;355 p.i = pos_2;
339 if (p.parseSwitchExpr()) break :blk_2 true;356 if (try p.parseSwitchExpr()) break :blk_2 true;
340 p.i = pos_2;357 p.i = pos_2;
341 break :blk_2 false;358 break :blk_2 false;
342 }) break :blk_0 true;359 }) break :blk_0 true;
...@@ -344,14 +361,14 @@ const Parser = struct {...@@ -344,14 +361,14 @@ const Parser = struct {
344 break :blk_0 false;361 break :blk_0 false;
345 };362 };
346 }363 }
347 pub fn parseLoopStatement(p: *Parser) bool {364 pub fn parseLoopStatement(p: *Parser) Error!bool {
348 return blk_0: {365 return blk_0: {
349 const pos_0 = p.i;366 const pos_0 = p.i;
350 if ((p.parseKEYWORD_inline() or true) and blk_2: {367 if ((try p.parseKEYWORD_inline() or true) and blk_2: {
351 const pos_2 = p.i;368 const pos_2 = p.i;
352 if (p.parseForStatement()) break :blk_2 true;369 if (try p.parseForStatement()) break :blk_2 true;
353 p.i = pos_2;370 p.i = pos_2;
354 if (p.parseWhileStatement()) break :blk_2 true;371 if (try p.parseWhileStatement()) break :blk_2 true;
355 p.i = pos_2;372 p.i = pos_2;
356 break :blk_2 false;373 break :blk_2 false;
357 }) break :blk_0 true;374 }) break :blk_0 true;
...@@ -359,16 +376,16 @@ const Parser = struct {...@@ -359,16 +376,16 @@ const Parser = struct {
359 break :blk_0 false;376 break :blk_0 false;
360 };377 };
361 }378 }
362 pub fn parseForStatement(p: *Parser) bool {379 pub fn parseForStatement(p: *Parser) Error!bool {
363 return blk_0: {380 return blk_0: {
364 const pos_0 = p.i;381 const pos_0 = p.i;
365 if (p.parseForPrefix() and p.parseBlockExpr() and blk_2: {382 if (try p.parseForPrefix() and try p.parseBlockExpr() and blk_2: {
366 const pos_2 = p.i;383 const pos_2 = p.i;
367 if (p.parseKEYWORD_else() and p.parseStatement()) break :blk_2 true;384 if (try p.parseKEYWORD_else() and try p.parseStatement()) break :blk_2 true;
368 p.i = pos_2;385 p.i = pos_2;
369 if (blk_3: {386 if (blk_3: {
370 const pos_3 = p.i;387 const pos_3 = p.i;
371 const match_3 = p.parseKEYWORD_else();388 const match_3 = try p.parseKEYWORD_else();
372 p.i = pos_3;389 p.i = pos_3;
373 break :blk_3 !match_3;390 break :blk_3 !match_3;
374 }) break :blk_2 true;391 }) break :blk_2 true;
...@@ -376,16 +393,16 @@ const Parser = struct {...@@ -376,16 +393,16 @@ const Parser = struct {
376 break :blk_2 false;393 break :blk_2 false;
377 }) break :blk_0 true;394 }) break :blk_0 true;
378 p.i = pos_0;395 p.i = pos_0;
379 if (p.parseForPrefix() and blk_1: {396 if (try p.parseForPrefix() and blk_1: {
380 const pos_1 = p.i;397 const pos_1 = p.i;
381 const match_1 = p.parseBlockExprPrefix();398 const match_1 = try p.parseBlockExprPrefix();
382 p.i = pos_1;399 p.i = pos_1;
383 break :blk_1 !match_1;400 break :blk_1 !match_1;
384 } and p.parseAssignExpr() and blk_2: {401 } and try p.parseAssignExpr() and blk_2: {
385 const pos_2 = p.i;402 const pos_2 = p.i;
386 if (p.parseSEMICOLON()) break :blk_2 true;403 if (try p.parseSEMICOLON()) break :blk_2 true;
387 p.i = pos_2;404 p.i = pos_2;
388 if (p.parseKEYWORD_else() and p.parseStatement()) break :blk_2 true;405 if (try p.parseKEYWORD_else() and try p.parseStatement()) break :blk_2 true;
389 p.i = pos_2;406 p.i = pos_2;
390 break :blk_2 false;407 break :blk_2 false;
391 }) break :blk_0 true;408 }) break :blk_0 true;
...@@ -393,16 +410,16 @@ const Parser = struct {...@@ -393,16 +410,16 @@ const Parser = struct {
393 break :blk_0 false;410 break :blk_0 false;
394 };411 };
395 }412 }
396 pub fn parseWhileStatement(p: *Parser) bool {413 pub fn parseWhileStatement(p: *Parser) Error!bool {
397 return blk_0: {414 return blk_0: {
398 const pos_0 = p.i;415 const pos_0 = p.i;
399 if (p.parseWhilePrefix() and p.parseBlockExpr() and blk_2: {416 if (try p.parseWhilePrefix() and try p.parseBlockExpr() and blk_2: {
400 const pos_2 = p.i;417 const pos_2 = p.i;
401 if (p.parseKEYWORD_else() and (p.parsePayload() or true) and p.parseStatement()) break :blk_2 true;418 if (try p.parseKEYWORD_else() and (try p.parsePayload() or true) and try p.parseStatement()) break :blk_2 true;
402 p.i = pos_2;419 p.i = pos_2;
403 if (blk_3: {420 if (blk_3: {
404 const pos_3 = p.i;421 const pos_3 = p.i;
405 const match_3 = p.parseKEYWORD_else();422 const match_3 = try p.parseKEYWORD_else();
406 p.i = pos_3;423 p.i = pos_3;
407 break :blk_3 !match_3;424 break :blk_3 !match_3;
408 }) break :blk_2 true;425 }) break :blk_2 true;
...@@ -410,16 +427,16 @@ const Parser = struct {...@@ -410,16 +427,16 @@ const Parser = struct {
410 break :blk_2 false;427 break :blk_2 false;
411 }) break :blk_0 true;428 }) break :blk_0 true;
412 p.i = pos_0;429 p.i = pos_0;
413 if (p.parseWhilePrefix() and blk_1: {430 if (try p.parseWhilePrefix() and blk_1: {
414 const pos_1 = p.i;431 const pos_1 = p.i;
415 const match_1 = p.parseBlockExprPrefix();432 const match_1 = try p.parseBlockExprPrefix();
416 p.i = pos_1;433 p.i = pos_1;
417 break :blk_1 !match_1;434 break :blk_1 !match_1;
418 } and p.parseAssignExpr() and blk_2: {435 } and try p.parseAssignExpr() and blk_2: {
419 const pos_2 = p.i;436 const pos_2 = p.i;
420 if (p.parseSEMICOLON()) break :blk_2 true;437 if (try p.parseSEMICOLON()) break :blk_2 true;
421 p.i = pos_2;438 p.i = pos_2;
422 if (p.parseKEYWORD_else() and (p.parsePayload() or true) and p.parseStatement()) break :blk_2 true;439 if (try p.parseKEYWORD_else() and (try p.parsePayload() or true) and try p.parseStatement()) break :blk_2 true;
423 p.i = pos_2;440 p.i = pos_2;
424 break :blk_2 false;441 break :blk_2 false;
425 }) break :blk_0 true;442 }) break :blk_0 true;
...@@ -427,95 +444,102 @@ const Parser = struct {...@@ -427,95 +444,102 @@ const Parser = struct {
427 break :blk_0 false;444 break :blk_0 false;
428 };445 };
429 }446 }
430 pub fn parseBlockExprStatement(p: *Parser) bool {447 pub fn parseBlockExprStatement(p: *Parser) Error!bool {
431 return blk_0: {448 return blk_0: {
432 const pos_0 = p.i;449 const pos_0 = p.i;
433 if (p.parseBlockExpr()) break :blk_0 true;450 if (try p.parseBlockExpr()) break :blk_0 true;
434 p.i = pos_0;451 p.i = pos_0;
435 if (blk_1: {452 if (blk_1: {
436 const pos_1 = p.i;453 const pos_1 = p.i;
437 const match_1 = p.parseBlockExprPrefix();454 const match_1 = try p.parseBlockExprPrefix();
438 p.i = pos_1;455 p.i = pos_1;
439 break :blk_1 !match_1;456 break :blk_1 !match_1;
440 } and p.parseAssignExpr() and p.parseSEMICOLON()) break :blk_0 true;457 } and try p.parseAssignExpr() and try p.parseSEMICOLON()) break :blk_0 true;
441 p.i = pos_0;458 p.i = pos_0;
442 break :blk_0 false;459 break :blk_0 false;
443 };460 };
444 }461 }
445 pub fn parseBlockExprPrefix(p: *Parser) bool {462 pub fn parseBlockExprPrefix(p: *Parser) Error!bool {
446 return blk_0: {463 return blk_0: {
447 const pos_0 = p.i;464 const pos_0 = p.i;
448 if ((p.parseBlockLabel() or true) and p.parseLBRACE()) break :blk_0 true;465 if ((try p.parseBlockLabel() or true) and try p.parseLBRACE()) break :blk_0 true;
449 p.i = pos_0;466 p.i = pos_0;
450 break :blk_0 false;467 break :blk_0 false;
451 };468 };
452 }469 }
453 pub fn parseBlockExpr(p: *Parser) bool {470 pub fn parseBlockExpr(p: *Parser) Error!bool {
454 return blk_0: {471 return blk_0: {
455 const pos_0 = p.i;472 const pos_0 = p.i;
456 if ((p.parseBlockLabel() or true) and p.parseBlock()) break :blk_0 true;473 if ((try p.parseBlockLabel() or true) and try p.parseBlock()) break :blk_0 true;
457 p.i = pos_0;474 p.i = pos_0;
458 break :blk_0 false;475 break :blk_0 false;
459 };476 };
460 }477 }
461 pub fn parseVarAssignStatement(p: *Parser) bool {478 pub fn parseVarAssignStatement(p: *Parser) Error!bool {
462 return blk_0: {479 return blk_0: {
463 const pos_0 = p.i;480 const pos_0 = p.i;
464 if (blk_2: {481 if (blk_2: {
465 const pos_2 = p.i;482 const pos_2 = p.i;
466 if (p.parseVarDeclProto()) break :blk_2 true;483 if (try p.parseVarDeclProto()) break :blk_2 true;
467 p.i = pos_2;484 p.i = pos_2;
468 if (p.parseExpr()) break :blk_2 true;485 if (try p.parseExpr()) break :blk_2 true;
469 p.i = pos_2;486 p.i = pos_2;
470 break :blk_2 false;487 break :blk_2 false;
471 } and blk_1: {488 } and blk_1: {
489 var i_1: usize = 0;
472 while (blk_3: {490 while (blk_3: {
473 const pos_3 = p.i;491 const pos_3 = p.i;
474 if (p.parseCOMMA() and blk_5: {492 if (try p.parseCOMMA() and blk_5: {
475 const pos_5 = p.i;493 const pos_5 = p.i;
476 if (p.parseVarDeclProto()) break :blk_5 true;494 if (try p.parseVarDeclProto()) break :blk_5 true;
477 p.i = pos_5;495 p.i = pos_5;
478 if (p.parseExpr()) break :blk_5 true;496 if (try p.parseExpr()) break :blk_5 true;
479 p.i = pos_5;497 p.i = pos_5;
480 break :blk_5 false;498 break :blk_5 false;
481 }) break :blk_3 true;499 }) break :blk_3 true;
482 p.i = pos_3;500 p.i = pos_3;
483 break :blk_3 false;501 break :blk_3 false;
484 }) {}502 }) {
503 if (i_1 > max_depth) return error.MaxDepth;
504 i_1 += 1;
505 }
485 break :blk_1 true;506 break :blk_1 true;
486 } and p.parseEQUAL() and p.parseExpr() and p.parseSEMICOLON()) break :blk_0 true;507 } and try p.parseEQUAL() and try p.parseExpr() and try p.parseSEMICOLON()) break :blk_0 true;
487 p.i = pos_0;508 p.i = pos_0;
488 break :blk_0 false;509 break :blk_0 false;
489 };510 };
490 }511 }
491 pub fn parseAssignExpr(p: *Parser) bool {512 pub fn parseAssignExpr(p: *Parser) Error!bool {
492 return blk_0: {513 return blk_0: {
493 const pos_0 = p.i;514 const pos_0 = p.i;
494 if (p.parseExpr() and blk_2: {515 if (try p.parseExpr() and blk_2: {
495 const pos_2 = p.i;516 const pos_2 = p.i;
496 if (p.parseAssignOp() and p.parseExpr()) break :blk_2 true;517 if (try p.parseAssignOp() and try p.parseExpr()) break :blk_2 true;
497 p.i = pos_2;518 p.i = pos_2;
498 if (blk_3: {519 if (blk_3: {
499 var match_3 = false;520 var match_3 = false;
521 var i_3: usize = 0;
500 while (blk_5: {522 while (blk_5: {
501 const pos_5 = p.i;523 const pos_5 = p.i;
502 if (p.parseCOMMA() and p.parseExpr()) break :blk_5 true;524 if (try p.parseCOMMA() and try p.parseExpr()) break :blk_5 true;
503 p.i = pos_5;525 p.i = pos_5;
504 break :blk_5 false;526 break :blk_5 false;
505 }) {527 }) {
506 match_3 = true;528 match_3 = true;
529 if (i_3 > max_depth) return error.MaxDepth;
530 i_3 += 1;
507 }531 }
508 break :blk_3 match_3;532 break :blk_3 match_3;
509 } and p.parseEQUAL() and p.parseExpr()) break :blk_2 true;533 } and try p.parseEQUAL() and try p.parseExpr()) break :blk_2 true;
510 p.i = pos_2;534 p.i = pos_2;
511 if (blk_3: {535 if (blk_3: {
512 const pos_3 = p.i;536 const pos_3 = p.i;
513 const match_3 = p.parseAssignOp();537 const match_3 = try p.parseAssignOp();
514 p.i = pos_3;538 p.i = pos_3;
515 break :blk_3 !match_3;539 break :blk_3 !match_3;
516 } and blk_3: {540 } and blk_3: {
517 const pos_3 = p.i;541 const pos_3 = p.i;
518 const match_3 = p.parseCOMMA();542 const match_3 = try p.parseCOMMA();
519 p.i = pos_3;543 p.i = pos_3;
520 break :blk_3 !match_3;544 break :blk_3 !match_3;
521 }) break :blk_2 true;545 }) break :blk_2 true;
...@@ -526,16 +550,16 @@ const Parser = struct {...@@ -526,16 +550,16 @@ const Parser = struct {
526 break :blk_0 false;550 break :blk_0 false;
527 };551 };
528 }552 }
529 pub fn parseSingleAssignExpr(p: *Parser) bool {553 pub fn parseSingleAssignExpr(p: *Parser) Error!bool {
530 return blk_0: {554 return blk_0: {
531 const pos_0 = p.i;555 const pos_0 = p.i;
532 if (p.parseExpr() and blk_2: {556 if (try p.parseExpr() and blk_2: {
533 const pos_2 = p.i;557 const pos_2 = p.i;
534 if (p.parseAssignOp() and p.parseExpr()) break :blk_2 true;558 if (try p.parseAssignOp() and try p.parseExpr()) break :blk_2 true;
535 p.i = pos_2;559 p.i = pos_2;
536 if (blk_3: {560 if (blk_3: {
537 const pos_3 = p.i;561 const pos_3 = p.i;
538 const match_3 = p.parseAssignOp();562 const match_3 = try p.parseAssignOp();
539 p.i = pos_3;563 p.i = pos_3;
540 break :blk_3 !match_3;564 break :blk_3 !match_3;
541 }) break :blk_2 true;565 }) break :blk_2 true;
...@@ -546,28 +570,35 @@ const Parser = struct {...@@ -546,28 +570,35 @@ const Parser = struct {
546 break :blk_0 false;570 break :blk_0 false;
547 };571 };
548 }572 }
549 pub fn parseExpr(p: *Parser) bool {573 pub fn parseExpr(p: *Parser) Error!bool {
574 if (p.expr_depth >= max_depth) return error.MaxDepth;
575 p.expr_depth += 1;
576 defer p.expr_depth -= 1;
550 return blk_0: {577 return blk_0: {
551 const pos_0 = p.i;578 const pos_0 = p.i;
552 if (p.parseBoolOrExpr()) break :blk_0 true;579 if (try p.parseBoolOrExpr()) break :blk_0 true;
553 p.i = pos_0;580 p.i = pos_0;
554 break :blk_0 false;581 break :blk_0 false;
555 };582 };
556 }583 }
557 pub fn parseBoolOrExpr(p: *Parser) bool {584 pub fn parseBoolOrExpr(p: *Parser) Error!bool {
558 return blk_0: {585 return blk_0: {
559 const pos_0 = p.i;586 const pos_0 = p.i;
560 if (p.parseBoolAndExpr() and blk_1: {587 if (try p.parseBoolAndExpr() and blk_1: {
588 var i_1: usize = 0;
561 while (blk_3: {589 while (blk_3: {
562 const pos_3 = p.i;590 const pos_3 = p.i;
563 if (p.parseOrOp() and p.parseBoolAndExpr()) break :blk_3 true;591 if (try p.parseOrOp() and try p.parseBoolAndExpr()) break :blk_3 true;
564 p.i = pos_3;592 p.i = pos_3;
565 break :blk_3 false;593 break :blk_3 false;
566 }) {}594 }) {
595 if (i_1 > max_depth) return error.MaxDepth;
596 i_1 += 1;
597 }
567 break :blk_1 true;598 break :blk_1 true;
568 } and blk_1: {599 } and blk_1: {
569 const pos_1 = p.i;600 const pos_1 = p.i;
570 const match_1 = p.parseOrOp();601 const match_1 = try p.parseOrOp();
571 p.i = pos_1;602 p.i = pos_1;
572 break :blk_1 !match_1;603 break :blk_1 !match_1;
573 }) break :blk_0 true;604 }) break :blk_0 true;
...@@ -575,20 +606,24 @@ const Parser = struct {...@@ -575,20 +606,24 @@ const Parser = struct {
575 break :blk_0 false;606 break :blk_0 false;
576 };607 };
577 }608 }
578 pub fn parseBoolAndExpr(p: *Parser) bool {609 pub fn parseBoolAndExpr(p: *Parser) Error!bool {
579 return blk_0: {610 return blk_0: {
580 const pos_0 = p.i;611 const pos_0 = p.i;
581 if (p.parseCompareExpr() and blk_1: {612 if (try p.parseCompareExpr() and blk_1: {
613 var i_1: usize = 0;
582 while (blk_3: {614 while (blk_3: {
583 const pos_3 = p.i;615 const pos_3 = p.i;
584 if (p.parseAndOp() and p.parseCompareExpr()) break :blk_3 true;616 if (try p.parseAndOp() and try p.parseCompareExpr()) break :blk_3 true;
585 p.i = pos_3;617 p.i = pos_3;
586 break :blk_3 false;618 break :blk_3 false;
587 }) {}619 }) {
620 if (i_1 > max_depth) return error.MaxDepth;
621 i_1 += 1;
622 }
588 break :blk_1 true;623 break :blk_1 true;
589 } and blk_1: {624 } and blk_1: {
590 const pos_1 = p.i;625 const pos_1 = p.i;
591 const match_1 = p.parseAndOp();626 const match_1 = try p.parseAndOp();
592 p.i = pos_1;627 p.i = pos_1;
593 break :blk_1 !match_1;628 break :blk_1 !match_1;
594 }) break :blk_0 true;629 }) break :blk_0 true;
...@@ -596,16 +631,16 @@ const Parser = struct {...@@ -596,16 +631,16 @@ const Parser = struct {
596 break :blk_0 false;631 break :blk_0 false;
597 };632 };
598 }633 }
599 pub fn parseCompareExpr(p: *Parser) bool {634 pub fn parseCompareExpr(p: *Parser) Error!bool {
600 return blk_0: {635 return blk_0: {
601 const pos_0 = p.i;636 const pos_0 = p.i;
602 if (p.parseBitwiseExpr() and blk_2: {637 if (try p.parseBitwiseExpr() and blk_2: {
603 const pos_2 = p.i;638 const pos_2 = p.i;
604 if (p.parseCompareOp() and p.parseBitwiseExpr()) break :blk_2 true;639 if (try p.parseCompareOp() and try p.parseBitwiseExpr()) break :blk_2 true;
605 p.i = pos_2;640 p.i = pos_2;
606 if (blk_3: {641 if (blk_3: {
607 const pos_3 = p.i;642 const pos_3 = p.i;
608 const match_3 = p.parseCompareOp();643 const match_3 = try p.parseCompareOp();
609 p.i = pos_3;644 p.i = pos_3;
610 break :blk_3 !match_3;645 break :blk_3 !match_3;
611 }) break :blk_2 true;646 }) break :blk_2 true;
...@@ -616,20 +651,24 @@ const Parser = struct {...@@ -616,20 +651,24 @@ const Parser = struct {
616 break :blk_0 false;651 break :blk_0 false;
617 };652 };
618 }653 }
619 pub fn parseBitwiseExpr(p: *Parser) bool {654 pub fn parseBitwiseExpr(p: *Parser) Error!bool {
620 return blk_0: {655 return blk_0: {
621 const pos_0 = p.i;656 const pos_0 = p.i;
622 if (p.parseBitShiftExpr() and blk_1: {657 if (try p.parseBitShiftExpr() and blk_1: {
658 var i_1: usize = 0;
623 while (blk_3: {659 while (blk_3: {
624 const pos_3 = p.i;660 const pos_3 = p.i;
625 if (p.parseBitwiseOp() and p.parseBitShiftExpr()) break :blk_3 true;661 if (try p.parseBitwiseOp() and try p.parseBitShiftExpr()) break :blk_3 true;
626 p.i = pos_3;662 p.i = pos_3;
627 break :blk_3 false;663 break :blk_3 false;
628 }) {}664 }) {
665 if (i_1 > max_depth) return error.MaxDepth;
666 i_1 += 1;
667 }
629 break :blk_1 true;668 break :blk_1 true;
630 } and blk_1: {669 } and blk_1: {
631 const pos_1 = p.i;670 const pos_1 = p.i;
632 const match_1 = p.parseBitwiseOp();671 const match_1 = try p.parseBitwiseOp();
633 p.i = pos_1;672 p.i = pos_1;
634 break :blk_1 !match_1;673 break :blk_1 !match_1;
635 }) break :blk_0 true;674 }) break :blk_0 true;
...@@ -637,20 +676,24 @@ const Parser = struct {...@@ -637,20 +676,24 @@ const Parser = struct {
637 break :blk_0 false;676 break :blk_0 false;
638 };677 };
639 }678 }
640 pub fn parseBitShiftExpr(p: *Parser) bool {679 pub fn parseBitShiftExpr(p: *Parser) Error!bool {
641 return blk_0: {680 return blk_0: {
642 const pos_0 = p.i;681 const pos_0 = p.i;
643 if (p.parseAdditionExpr() and blk_1: {682 if (try p.parseAdditionExpr() and blk_1: {
683 var i_1: usize = 0;
644 while (blk_3: {684 while (blk_3: {
645 const pos_3 = p.i;685 const pos_3 = p.i;
646 if (p.parseBitShiftOp() and p.parseAdditionExpr()) break :blk_3 true;686 if (try p.parseBitShiftOp() and try p.parseAdditionExpr()) break :blk_3 true;
647 p.i = pos_3;687 p.i = pos_3;
648 break :blk_3 false;688 break :blk_3 false;
649 }) {}689 }) {
690 if (i_1 > max_depth) return error.MaxDepth;
691 i_1 += 1;
692 }
650 break :blk_1 true;693 break :blk_1 true;
651 } and blk_1: {694 } and blk_1: {
652 const pos_1 = p.i;695 const pos_1 = p.i;
653 const match_1 = p.parseBitShiftOp();696 const match_1 = try p.parseBitShiftOp();
654 p.i = pos_1;697 p.i = pos_1;
655 break :blk_1 !match_1;698 break :blk_1 !match_1;
656 }) break :blk_0 true;699 }) break :blk_0 true;
...@@ -658,20 +701,24 @@ const Parser = struct {...@@ -658,20 +701,24 @@ const Parser = struct {
658 break :blk_0 false;701 break :blk_0 false;
659 };702 };
660 }703 }
661 pub fn parseAdditionExpr(p: *Parser) bool {704 pub fn parseAdditionExpr(p: *Parser) Error!bool {
662 return blk_0: {705 return blk_0: {
663 const pos_0 = p.i;706 const pos_0 = p.i;
664 if (p.parseMultiplyExpr() and blk_1: {707 if (try p.parseMultiplyExpr() and blk_1: {
708 var i_1: usize = 0;
665 while (blk_3: {709 while (blk_3: {
666 const pos_3 = p.i;710 const pos_3 = p.i;
667 if (p.parseAdditionOp() and p.parseMultiplyExpr()) break :blk_3 true;711 if (try p.parseAdditionOp() and try p.parseMultiplyExpr()) break :blk_3 true;
668 p.i = pos_3;712 p.i = pos_3;
669 break :blk_3 false;713 break :blk_3 false;
670 }) {}714 }) {
715 if (i_1 > max_depth) return error.MaxDepth;
716 i_1 += 1;
717 }
671 break :blk_1 true;718 break :blk_1 true;
672 } and blk_1: {719 } and blk_1: {
673 const pos_1 = p.i;720 const pos_1 = p.i;
674 const match_1 = p.parseAdditionOp();721 const match_1 = try p.parseAdditionOp();
675 p.i = pos_1;722 p.i = pos_1;
676 break :blk_1 !match_1;723 break :blk_1 !match_1;
677 }) break :blk_0 true;724 }) break :blk_0 true;
...@@ -679,20 +726,24 @@ const Parser = struct {...@@ -679,20 +726,24 @@ const Parser = struct {
679 break :blk_0 false;726 break :blk_0 false;
680 };727 };
681 }728 }
682 pub fn parseMultiplyExpr(p: *Parser) bool {729 pub fn parseMultiplyExpr(p: *Parser) Error!bool {
683 return blk_0: {730 return blk_0: {
684 const pos_0 = p.i;731 const pos_0 = p.i;
685 if (p.parsePrefixExpr() and blk_1: {732 if (try p.parsePrefixExpr() and blk_1: {
733 var i_1: usize = 0;
686 while (blk_3: {734 while (blk_3: {
687 const pos_3 = p.i;735 const pos_3 = p.i;
688 if (p.parseMultiplyOp() and p.parsePrefixExpr()) break :blk_3 true;736 if (try p.parseMultiplyOp() and try p.parsePrefixExpr()) break :blk_3 true;
689 p.i = pos_3;737 p.i = pos_3;
690 break :blk_3 false;738 break :blk_3 false;
691 }) {}739 }) {
740 if (i_1 > max_depth) return error.MaxDepth;
741 i_1 += 1;
742 }
692 break :blk_1 true;743 break :blk_1 true;
693 } and blk_1: {744 } and blk_1: {
694 const pos_1 = p.i;745 const pos_1 = p.i;
695 const match_1 = p.parseMultiplyOp();746 const match_1 = try p.parseMultiplyOp();
696 p.i = pos_1;747 p.i = pos_1;
697 break :blk_1 !match_1;748 break :blk_1 !match_1;
698 }) break :blk_0 true;749 }) break :blk_0 true;
...@@ -700,36 +751,40 @@ const Parser = struct {...@@ -700,36 +751,40 @@ const Parser = struct {
700 break :blk_0 false;751 break :blk_0 false;
701 };752 };
702 }753 }
703 pub fn parsePrefixExpr(p: *Parser) bool {754 pub fn parsePrefixExpr(p: *Parser) Error!bool {
704 return blk_0: {755 return blk_0: {
705 const pos_0 = p.i;756 const pos_0 = p.i;
706 if (blk_1: {757 if (blk_1: {
707 while (p.parsePrefixOp()) {}758 var i_1: usize = 0;
759 while (try p.parsePrefixOp()) {
760 if (i_1 > max_depth) return error.MaxDepth;
761 i_1 += 1;
762 }
708 break :blk_1 true;763 break :blk_1 true;
709 } and blk_1: {764 } and blk_1: {
710 const pos_1 = p.i;765 const pos_1 = p.i;
711 const match_1 = p.parsePrefixOp();766 const match_1 = try p.parsePrefixOp();
712 p.i = pos_1;767 p.i = pos_1;
713 break :blk_1 !match_1;768 break :blk_1 !match_1;
714 } and p.parsePrimaryExpr()) break :blk_0 true;769 } and try p.parsePrimaryExpr()) break :blk_0 true;
715 p.i = pos_0;770 p.i = pos_0;
716 break :blk_0 false;771 break :blk_0 false;
717 };772 };
718 }773 }
719 pub fn parsePrimaryExpr(p: *Parser) bool {774 pub fn parsePrimaryExpr(p: *Parser) Error!bool {
720 return blk_0: {775 return blk_0: {
721 const pos_0 = p.i;776 const pos_0 = p.i;
722 if (p.parseAsmExpr()) break :blk_0 true;777 if (try p.parseAsmExpr()) break :blk_0 true;
723 p.i = pos_0;778 p.i = pos_0;
724 if (p.parseIfExpr()) break :blk_0 true;779 if (try p.parseIfExpr()) break :blk_0 true;
725 p.i = pos_0;780 p.i = pos_0;
726 if (p.parseKEYWORD_break() and (p.parseBreakLabel() or true) and blk_2: {781 if (try p.parseKEYWORD_break() and (try p.parseBreakLabel() or true) and blk_2: {
727 const pos_2 = p.i;782 const pos_2 = p.i;
728 if (p.parseExpr()) break :blk_2 true;783 if (try p.parseExpr()) break :blk_2 true;
729 p.i = pos_2;784 p.i = pos_2;
730 if (blk_3: {785 if (blk_3: {
731 const pos_3 = p.i;786 const pos_3 = p.i;
732 const match_3 = p.parseExprPrefix();787 const match_3 = try p.parseExprPrefix();
733 p.i = pos_3;788 p.i = pos_3;
734 break :blk_3 !match_3;789 break :blk_3 !match_3;
735 }) break :blk_2 true;790 }) break :blk_2 true;
...@@ -737,17 +792,17 @@ const Parser = struct {...@@ -737,17 +792,17 @@ const Parser = struct {
737 break :blk_2 false;792 break :blk_2 false;
738 }) break :blk_0 true;793 }) break :blk_0 true;
739 p.i = pos_0;794 p.i = pos_0;
740 if (p.parseKEYWORD_comptime() and p.parseExpr()) break :blk_0 true;795 if (try p.parseKEYWORD_comptime() and try p.parseExpr()) break :blk_0 true;
741 p.i = pos_0;796 p.i = pos_0;
742 if (p.parseKEYWORD_nosuspend() and p.parseExpr()) break :blk_0 true;797 if (try p.parseKEYWORD_nosuspend() and try p.parseExpr()) break :blk_0 true;
743 p.i = pos_0;798 p.i = pos_0;
744 if (p.parseKEYWORD_continue() and (p.parseBreakLabel() or true) and blk_2: {799 if (try p.parseKEYWORD_continue() and (try p.parseBreakLabel() or true) and blk_2: {
745 const pos_2 = p.i;800 const pos_2 = p.i;
746 if (p.parseExpr()) break :blk_2 true;801 if (try p.parseExpr()) break :blk_2 true;
747 p.i = pos_2;802 p.i = pos_2;
748 if (blk_3: {803 if (blk_3: {
749 const pos_3 = p.i;804 const pos_3 = p.i;
750 const match_3 = p.parseExprPrefix();805 const match_3 = try p.parseExprPrefix();
751 p.i = pos_3;806 p.i = pos_3;
752 break :blk_3 !match_3;807 break :blk_3 !match_3;
753 }) break :blk_2 true;808 }) break :blk_2 true;
...@@ -755,15 +810,15 @@ const Parser = struct {...@@ -755,15 +810,15 @@ const Parser = struct {
755 break :blk_2 false;810 break :blk_2 false;
756 }) break :blk_0 true;811 }) break :blk_0 true;
757 p.i = pos_0;812 p.i = pos_0;
758 if (p.parseKEYWORD_resume() and p.parseExpr()) break :blk_0 true;813 if (try p.parseKEYWORD_resume() and try p.parseExpr()) break :blk_0 true;
759 p.i = pos_0;814 p.i = pos_0;
760 if (p.parseKEYWORD_return() and blk_2: {815 if (try p.parseKEYWORD_return() and blk_2: {
761 const pos_2 = p.i;816 const pos_2 = p.i;
762 if (p.parseExpr()) break :blk_2 true;817 if (try p.parseExpr()) break :blk_2 true;
763 p.i = pos_2;818 p.i = pos_2;
764 if (blk_3: {819 if (blk_3: {
765 const pos_3 = p.i;820 const pos_3 = p.i;
766 const match_3 = p.parseExprPrefix();821 const match_3 = try p.parseExprPrefix();
767 p.i = pos_3;822 p.i = pos_3;
768 break :blk_3 !match_3;823 break :blk_3 !match_3;
769 }) break :blk_2 true;824 }) break :blk_2 true;
...@@ -771,25 +826,25 @@ const Parser = struct {...@@ -771,25 +826,25 @@ const Parser = struct {
771 break :blk_2 false;826 break :blk_2 false;
772 }) break :blk_0 true;827 }) break :blk_0 true;
773 p.i = pos_0;828 p.i = pos_0;
774 if ((p.parseBlockLabel() or true) and p.parseLoopExpr()) break :blk_0 true;829 if ((try p.parseBlockLabel() or true) and try p.parseLoopExpr()) break :blk_0 true;
775 p.i = pos_0;830 p.i = pos_0;
776 if (p.parseBlock()) break :blk_0 true;831 if (try p.parseBlock()) break :blk_0 true;
777 p.i = pos_0;832 p.i = pos_0;
778 if (p.parseCurlySuffixExpr()) break :blk_0 true;833 if (try p.parseCurlySuffixExpr()) break :blk_0 true;
779 p.i = pos_0;834 p.i = pos_0;
780 break :blk_0 false;835 break :blk_0 false;
781 };836 };
782 }837 }
783 pub fn parseIfExpr(p: *Parser) bool {838 pub fn parseIfExpr(p: *Parser) Error!bool {
784 return blk_0: {839 return blk_0: {
785 const pos_0 = p.i;840 const pos_0 = p.i;
786 if (p.parseIfPrefix() and p.parseExpr() and blk_2: {841 if (try p.parseIfPrefix() and try p.parseExpr() and blk_2: {
787 const pos_2 = p.i;842 const pos_2 = p.i;
788 if (p.parseKEYWORD_else() and (p.parsePayload() or true) and p.parseExpr()) break :blk_2 true;843 if (try p.parseKEYWORD_else() and (try p.parsePayload() or true) and try p.parseExpr()) break :blk_2 true;
789 p.i = pos_2;844 p.i = pos_2;
790 if (blk_3: {845 if (blk_3: {
791 const pos_3 = p.i;846 const pos_3 = p.i;
792 const match_3 = p.parseKEYWORD_else();847 const match_3 = try p.parseKEYWORD_else();
793 p.i = pos_3;848 p.i = pos_3;
794 break :blk_3 !match_3;849 break :blk_3 !match_3;
795 }) break :blk_2 true;850 }) break :blk_2 true;
...@@ -800,25 +855,29 @@ const Parser = struct {...@@ -800,25 +855,29 @@ const Parser = struct {
800 break :blk_0 false;855 break :blk_0 false;
801 };856 };
802 }857 }
803 pub fn parseBlock(p: *Parser) bool {858 pub fn parseBlock(p: *Parser) Error!bool {
804 return blk_0: {859 return blk_0: {
805 const pos_0 = p.i;860 const pos_0 = p.i;
806 if (p.parseLBRACE() and blk_1: {861 if (try p.parseLBRACE() and blk_1: {
807 while (p.parseBlockStatement()) {}862 var i_1: usize = 0;
863 while (try p.parseBlockStatement()) {
864 if (i_1 > max_depth) return error.MaxDepth;
865 i_1 += 1;
866 }
808 break :blk_1 true;867 break :blk_1 true;
809 } and p.parseRBRACE()) break :blk_0 true;868 } and try p.parseRBRACE()) break :blk_0 true;
810 p.i = pos_0;869 p.i = pos_0;
811 break :blk_0 false;870 break :blk_0 false;
812 };871 };
813 }872 }
814 pub fn parseLoopExpr(p: *Parser) bool {873 pub fn parseLoopExpr(p: *Parser) Error!bool {
815 return blk_0: {874 return blk_0: {
816 const pos_0 = p.i;875 const pos_0 = p.i;
817 if ((p.parseKEYWORD_inline() or true) and blk_2: {876 if ((try p.parseKEYWORD_inline() or true) and blk_2: {
818 const pos_2 = p.i;877 const pos_2 = p.i;
819 if (p.parseForExpr()) break :blk_2 true;878 if (try p.parseForExpr()) break :blk_2 true;
820 p.i = pos_2;879 p.i = pos_2;
821 if (p.parseWhileExpr()) break :blk_2 true;880 if (try p.parseWhileExpr()) break :blk_2 true;
822 p.i = pos_2;881 p.i = pos_2;
823 break :blk_2 false;882 break :blk_2 false;
824 }) break :blk_0 true;883 }) break :blk_0 true;
...@@ -826,16 +885,16 @@ const Parser = struct {...@@ -826,16 +885,16 @@ const Parser = struct {
826 break :blk_0 false;885 break :blk_0 false;
827 };886 };
828 }887 }
829 pub fn parseForExpr(p: *Parser) bool {888 pub fn parseForExpr(p: *Parser) Error!bool {
830 return blk_0: {889 return blk_0: {
831 const pos_0 = p.i;890 const pos_0 = p.i;
832 if (p.parseForPrefix() and p.parseExpr() and blk_2: {891 if (try p.parseForPrefix() and try p.parseExpr() and blk_2: {
833 const pos_2 = p.i;892 const pos_2 = p.i;
834 if (p.parseKEYWORD_else() and p.parseExpr()) break :blk_2 true;893 if (try p.parseKEYWORD_else() and try p.parseExpr()) break :blk_2 true;
835 p.i = pos_2;894 p.i = pos_2;
836 if (blk_3: {895 if (blk_3: {
837 const pos_3 = p.i;896 const pos_3 = p.i;
838 const match_3 = p.parseKEYWORD_else();897 const match_3 = try p.parseKEYWORD_else();
839 p.i = pos_3;898 p.i = pos_3;
840 break :blk_3 !match_3;899 break :blk_3 !match_3;
841 }) break :blk_2 true;900 }) break :blk_2 true;
...@@ -846,12 +905,12 @@ const Parser = struct {...@@ -846,12 +905,12 @@ const Parser = struct {
846 break :blk_0 false;905 break :blk_0 false;
847 };906 };
848 }907 }
849 pub fn parseWhileExpr(p: *Parser) bool {908 pub fn parseWhileExpr(p: *Parser) Error!bool {
850 return blk_0: {909 return blk_0: {
851 const pos_0 = p.i;910 const pos_0 = p.i;
852 if (p.parseWhilePrefix() and p.parseExpr() and (blk_3: {911 if (try p.parseWhilePrefix() and try p.parseExpr() and (blk_3: {
853 const pos_3 = p.i;912 const pos_3 = p.i;
854 if (p.parseKEYWORD_else() and (p.parsePayload() or true) and p.parseExpr()) break :blk_3 true;913 if (try p.parseKEYWORD_else() and (try p.parsePayload() or true) and try p.parseExpr()) break :blk_3 true;
855 p.i = pos_3;914 p.i = pos_3;
856 break :blk_3 false;915 break :blk_3 false;
857 } or true)) break :blk_0 true;916 } or true)) break :blk_0 true;
...@@ -859,16 +918,16 @@ const Parser = struct {...@@ -859,16 +918,16 @@ const Parser = struct {
859 break :blk_0 false;918 break :blk_0 false;
860 };919 };
861 }920 }
862 pub fn parseCurlySuffixExpr(p: *Parser) bool {921 pub fn parseCurlySuffixExpr(p: *Parser) Error!bool {
863 return blk_0: {922 return blk_0: {
864 const pos_0 = p.i;923 const pos_0 = p.i;
865 if (p.parseTypeExpr() and blk_2: {924 if (try p.parseTypeExpr() and blk_2: {
866 const pos_2 = p.i;925 const pos_2 = p.i;
867 if (p.parseInitList()) break :blk_2 true;926 if (try p.parseInitList()) break :blk_2 true;
868 p.i = pos_2;927 p.i = pos_2;
869 if (blk_3: {928 if (blk_3: {
870 const pos_3 = p.i;929 const pos_3 = p.i;
871 const match_3 = p.parseLBRACE();930 const match_3 = try p.parseLBRACE();
872 p.i = pos_3;931 p.i = pos_3;
873 break :blk_3 !match_3;932 break :blk_3 !match_3;
874 }) break :blk_2 true;933 }) break :blk_2 true;
...@@ -879,60 +938,72 @@ const Parser = struct {...@@ -879,60 +938,72 @@ const Parser = struct {
879 break :blk_0 false;938 break :blk_0 false;
880 };939 };
881 }940 }
882 pub fn parseInitList(p: *Parser) bool {941 pub fn parseInitList(p: *Parser) Error!bool {
883 return blk_0: {942 return blk_0: {
884 const pos_0 = p.i;943 const pos_0 = p.i;
885 if (p.parseLBRACE() and p.parseFieldInit() and blk_1: {944 if (try p.parseLBRACE() and try p.parseFieldInit() and blk_1: {
945 var i_1: usize = 0;
886 while (blk_3: {946 while (blk_3: {
887 const pos_3 = p.i;947 const pos_3 = p.i;
888 if (p.parseCOMMA() and p.parseFieldInit()) break :blk_3 true;948 if (try p.parseCOMMA() and try p.parseFieldInit()) break :blk_3 true;
889 p.i = pos_3;949 p.i = pos_3;
890 break :blk_3 false;950 break :blk_3 false;
891 }) {}951 }) {
952 if (i_1 > max_depth) return error.MaxDepth;
953 i_1 += 1;
954 }
892 break :blk_1 true;955 break :blk_1 true;
893 } and (p.parseCOMMA() or true) and p.parseRBRACE()) break :blk_0 true;956 } and (try p.parseCOMMA() or true) and try p.parseRBRACE()) break :blk_0 true;
894 p.i = pos_0;957 p.i = pos_0;
895 if (p.parseLBRACE() and p.parseExpr() and blk_1: {958 if (try p.parseLBRACE() and try p.parseExpr() and blk_1: {
959 var i_1: usize = 0;
896 while (blk_3: {960 while (blk_3: {
897 const pos_3 = p.i;961 const pos_3 = p.i;
898 if (p.parseCOMMA() and p.parseExpr()) break :blk_3 true;962 if (try p.parseCOMMA() and try p.parseExpr()) break :blk_3 true;
899 p.i = pos_3;963 p.i = pos_3;
900 break :blk_3 false;964 break :blk_3 false;
901 }) {}965 }) {
966 if (i_1 > max_depth) return error.MaxDepth;
967 i_1 += 1;
968 }
902 break :blk_1 true;969 break :blk_1 true;
903 } and (p.parseCOMMA() or true) and p.parseRBRACE()) break :blk_0 true;970 } and (try p.parseCOMMA() or true) and try p.parseRBRACE()) break :blk_0 true;
904 p.i = pos_0;971 p.i = pos_0;
905 if (p.parseLBRACE() and p.parseRBRACE()) break :blk_0 true;972 if (try p.parseLBRACE() and try p.parseRBRACE()) break :blk_0 true;
906 p.i = pos_0;973 p.i = pos_0;
907 break :blk_0 false;974 break :blk_0 false;
908 };975 };
909 }976 }
910 pub fn parseTypeExpr(p: *Parser) bool {977 pub fn parseTypeExpr(p: *Parser) Error!bool {
911 return blk_0: {978 return blk_0: {
912 const pos_0 = p.i;979 const pos_0 = p.i;
913 if (blk_1: {980 if (blk_1: {
914 while (p.parsePrefixTypeOp()) {}981 var i_1: usize = 0;
982 while (try p.parsePrefixTypeOp()) {
983 if (i_1 > max_depth) return error.MaxDepth;
984 i_1 += 1;
985 }
915 break :blk_1 true;986 break :blk_1 true;
916 } and blk_1: {987 } and blk_1: {
917 const pos_1 = p.i;988 const pos_1 = p.i;
918 const match_1 = p.parsePrefixTypeOpPrefix();989 const match_1 = try p.parsePrefixTypeOpPrefix();
919 p.i = pos_1;990 p.i = pos_1;
920 break :blk_1 !match_1;991 break :blk_1 !match_1;
921 } and p.parseErrorUnionExpr()) break :blk_0 true;992 } and try p.parseErrorUnionExpr()) break :blk_0 true;
922 p.i = pos_0;993 p.i = pos_0;
923 break :blk_0 false;994 break :blk_0 false;
924 };995 };
925 }996 }
926 pub fn parseErrorUnionExpr(p: *Parser) bool {997 pub fn parseErrorUnionExpr(p: *Parser) Error!bool {
927 return blk_0: {998 return blk_0: {
928 const pos_0 = p.i;999 const pos_0 = p.i;
929 if (p.parseSuffixExpr() and blk_2: {1000 if (try p.parseSuffixExpr() and blk_2: {
930 const pos_2 = p.i;1001 const pos_2 = p.i;
931 if (p.parseEXCLAMATIONMARK() and p.parseTypeExpr()) break :blk_2 true;1002 if (try p.parseEXCLAMATIONMARK() and try p.parseTypeExpr()) break :blk_2 true;
932 p.i = pos_2;1003 p.i = pos_2;
933 if (blk_3: {1004 if (blk_3: {
934 const pos_3 = p.i;1005 const pos_3 = p.i;
935 const match_3 = p.parseEXCLAMATIONMARK();1006 const match_3 = try p.parseEXCLAMATIONMARK();
936 p.i = pos_3;1007 p.i = pos_3;
937 break :blk_3 !match_3;1008 break :blk_3 !match_3;
938 }) break :blk_2 true;1009 }) break :blk_2 true;
...@@ -943,15 +1014,19 @@ const Parser = struct {...@@ -943,15 +1014,19 @@ const Parser = struct {
943 break :blk_0 false;1014 break :blk_0 false;
944 };1015 };
945 }1016 }
946 pub fn parseSuffixExpr(p: *Parser) bool {1017 pub fn parseSuffixExpr(p: *Parser) Error!bool {
947 return blk_0: {1018 return blk_0: {
948 const pos_0 = p.i;1019 const pos_0 = p.i;
949 if (p.parsePrimaryTypeExpr() and blk_1: {1020 if (try p.parsePrimaryTypeExpr() and blk_1: {
950 while (p.parseSuffixOp()) {}1021 var i_1: usize = 0;
1022 while (try p.parseSuffixOp()) {
1023 if (i_1 > max_depth) return error.MaxDepth;
1024 i_1 += 1;
1025 }
951 break :blk_1 true;1026 break :blk_1 true;
952 } and blk_1: {1027 } and blk_1: {
953 const pos_1 = p.i;1028 const pos_1 = p.i;
954 const match_1 = p.parseSuffixOpPrefix();1029 const match_1 = try p.parseSuffixOpPrefix();
955 p.i = pos_1;1030 p.i = pos_1;
956 break :blk_1 !match_1;1031 break :blk_1 !match_1;
957 }) break :blk_0 true;1032 }) break :blk_0 true;
...@@ -959,87 +1034,87 @@ const Parser = struct {...@@ -959,87 +1034,87 @@ const Parser = struct {
959 break :blk_0 false;1034 break :blk_0 false;
960 };1035 };
961 }1036 }
962 pub fn parsePrimaryTypeExpr(p: *Parser) bool {1037 pub fn parsePrimaryTypeExpr(p: *Parser) Error!bool {
963 return blk_0: {1038 return blk_0: {
964 const pos_0 = p.i;1039 const pos_0 = p.i;
965 if (p.parseBUILTINIDENTIFIER() and p.parseFnCallArguments()) break :blk_0 true;1040 if (try p.parseBUILTINIDENTIFIER() and try p.parseFnCallArguments()) break :blk_0 true;
966 p.i = pos_0;1041 p.i = pos_0;
967 if (p.parseCHAR_LITERAL()) break :blk_0 true;1042 if (try p.parseCHAR_LITERAL()) break :blk_0 true;
968 p.i = pos_0;1043 p.i = pos_0;
969 if (p.parseContainerType()) break :blk_0 true;1044 if (try p.parseContainerType()) break :blk_0 true;
970 p.i = pos_0;1045 p.i = pos_0;
971 if (p.parseDOT() and p.parseIDENTIFIER()) break :blk_0 true;1046 if (try p.parseDOT() and try p.parseIDENTIFIER()) break :blk_0 true;
972 p.i = pos_0;1047 p.i = pos_0;
973 if (p.parseDOT() and p.parseInitList()) break :blk_0 true;1048 if (try p.parseDOT() and try p.parseInitList()) break :blk_0 true;
974 p.i = pos_0;1049 p.i = pos_0;
975 if (p.parseErrorSetDecl()) break :blk_0 true;1050 if (try p.parseErrorSetDecl()) break :blk_0 true;
976 p.i = pos_0;1051 p.i = pos_0;
977 if (p.parseFnProto()) break :blk_0 true;1052 if (try p.parseFnProto()) break :blk_0 true;
978 p.i = pos_0;1053 p.i = pos_0;
979 if (p.parseGroupedExpr()) break :blk_0 true;1054 if (try p.parseGroupedExpr()) break :blk_0 true;
980 p.i = pos_0;1055 p.i = pos_0;
981 if (p.parseLabeledTypeExpr()) break :blk_0 true;1056 if (try p.parseLabeledTypeExpr()) break :blk_0 true;
982 p.i = pos_0;1057 p.i = pos_0;
983 if (p.parseIDENTIFIER()) break :blk_0 true;1058 if (try p.parseIDENTIFIER()) break :blk_0 true;
984 p.i = pos_0;1059 p.i = pos_0;
985 if (p.parseIfTypeExpr()) break :blk_0 true;1060 if (try p.parseIfTypeExpr()) break :blk_0 true;
986 p.i = pos_0;1061 p.i = pos_0;
987 if (p.parseKEYWORD_comptime() and p.parseTypeExpr()) break :blk_0 true;1062 if (try p.parseKEYWORD_comptime() and try p.parseTypeExpr()) break :blk_0 true;
988 p.i = pos_0;1063 p.i = pos_0;
989 if (p.parseKEYWORD_error() and p.parseDOT() and p.parseIDENTIFIER()) break :blk_0 true;1064 if (try p.parseKEYWORD_error() and try p.parseDOT() and try p.parseIDENTIFIER()) break :blk_0 true;
990 p.i = pos_0;1065 p.i = pos_0;
991 if (p.parseKEYWORD_anyframe()) break :blk_0 true;1066 if (try p.parseKEYWORD_anyframe()) break :blk_0 true;
992 p.i = pos_0;1067 p.i = pos_0;
993 if (p.parseKEYWORD_unreachable()) break :blk_0 true;1068 if (try p.parseKEYWORD_unreachable()) break :blk_0 true;
994 p.i = pos_0;1069 p.i = pos_0;
995 if (p.parseNUMBERLITERAL()) break :blk_0 true;1070 if (try p.parseNUMBERLITERAL()) break :blk_0 true;
996 p.i = pos_0;1071 p.i = pos_0;
997 if (p.parseSTRINGLITERAL()) break :blk_0 true;1072 if (try p.parseSTRINGLITERAL()) break :blk_0 true;
998 p.i = pos_0;1073 p.i = pos_0;
999 break :blk_0 false;1074 break :blk_0 false;
1000 };1075 };
1001 }1076 }
1002 pub fn parseContainerType(p: *Parser) bool {1077 pub fn parseContainerType(p: *Parser) Error!bool {
1003 return blk_0: {1078 return blk_0: {
1004 const pos_0 = p.i;1079 const pos_0 = p.i;
1005 if ((blk_3: {1080 if ((blk_3: {
1006 const pos_3 = p.i;1081 const pos_3 = p.i;
1007 if (p.parseKEYWORD_extern()) break :blk_3 true;1082 if (try p.parseKEYWORD_extern()) break :blk_3 true;
1008 p.i = pos_3;1083 p.i = pos_3;
1009 if (p.parseKEYWORD_packed()) break :blk_3 true;1084 if (try p.parseKEYWORD_packed()) break :blk_3 true;
1010 p.i = pos_3;1085 p.i = pos_3;
1011 break :blk_3 false;1086 break :blk_3 false;
1012 } or true) and p.parseContainerTypeAuto()) break :blk_0 true;1087 } or true) and try p.parseContainerTypeAuto()) break :blk_0 true;
1013 p.i = pos_0;1088 p.i = pos_0;
1014 break :blk_0 false;1089 break :blk_0 false;
1015 };1090 };
1016 }1091 }
1017 pub fn parseErrorSetDecl(p: *Parser) bool {1092 pub fn parseErrorSetDecl(p: *Parser) Error!bool {
1018 return blk_0: {1093 return blk_0: {
1019 const pos_0 = p.i;1094 const pos_0 = p.i;
1020 if (p.parseKEYWORD_error() and p.parseLBRACE() and p.parseIdentifierList() and p.parseRBRACE()) break :blk_0 true;1095 if (try p.parseKEYWORD_error() and try p.parseLBRACE() and try p.parseIdentifierList() and try p.parseRBRACE()) break :blk_0 true;
1021 p.i = pos_0;1096 p.i = pos_0;
1022 break :blk_0 false;1097 break :blk_0 false;
1023 };1098 };
1024 }1099 }
1025 pub fn parseGroupedExpr(p: *Parser) bool {1100 pub fn parseGroupedExpr(p: *Parser) Error!bool {
1026 return blk_0: {1101 return blk_0: {
1027 const pos_0 = p.i;1102 const pos_0 = p.i;
1028 if (p.parseLPAREN() and p.parseExpr() and p.parseRPAREN()) break :blk_0 true;1103 if (try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_0 true;
1029 p.i = pos_0;1104 p.i = pos_0;
1030 break :blk_0 false;1105 break :blk_0 false;
1031 };1106 };
1032 }1107 }
1033 pub fn parseIfTypeExpr(p: *Parser) bool {1108 pub fn parseIfTypeExpr(p: *Parser) Error!bool {
1034 return blk_0: {1109 return blk_0: {
1035 const pos_0 = p.i;1110 const pos_0 = p.i;
1036 if (p.parseIfPrefix() and p.parseTypeExpr() and blk_2: {1111 if (try p.parseIfPrefix() and try p.parseTypeExpr() and blk_2: {
1037 const pos_2 = p.i;1112 const pos_2 = p.i;
1038 if (p.parseKEYWORD_else() and (p.parsePayload() or true) and p.parseTypeExpr()) break :blk_2 true;1113 if (try p.parseKEYWORD_else() and (try p.parsePayload() or true) and try p.parseTypeExpr()) break :blk_2 true;
1039 p.i = pos_2;1114 p.i = pos_2;
1040 if (blk_3: {1115 if (blk_3: {
1041 const pos_3 = p.i;1116 const pos_3 = p.i;
1042 const match_3 = p.parseKEYWORD_else();1117 const match_3 = try p.parseKEYWORD_else();
1043 p.i = pos_3;1118 p.i = pos_3;
1044 break :blk_3 !match_3;1119 break :blk_3 !match_3;
1045 }) break :blk_2 true;1120 }) break :blk_2 true;
...@@ -1050,26 +1125,26 @@ const Parser = struct {...@@ -1050,26 +1125,26 @@ const Parser = struct {
1050 break :blk_0 false;1125 break :blk_0 false;
1051 };1126 };
1052 }1127 }
1053 pub fn parseLabeledTypeExpr(p: *Parser) bool {1128 pub fn parseLabeledTypeExpr(p: *Parser) Error!bool {
1054 return blk_0: {1129 return blk_0: {
1055 const pos_0 = p.i;1130 const pos_0 = p.i;
1056 if (p.parseBlockLabel() and p.parseBlock()) break :blk_0 true;1131 if (try p.parseBlockLabel() and try p.parseBlock()) break :blk_0 true;
1057 p.i = pos_0;1132 p.i = pos_0;
1058 if ((p.parseBlockLabel() or true) and p.parseLoopTypeExpr()) break :blk_0 true;1133 if ((try p.parseBlockLabel() or true) and try p.parseLoopTypeExpr()) break :blk_0 true;
1059 p.i = pos_0;1134 p.i = pos_0;
1060 if ((p.parseBlockLabel() or true) and p.parseSwitchExpr()) break :blk_0 true;1135 if ((try p.parseBlockLabel() or true) and try p.parseSwitchExpr()) break :blk_0 true;
1061 p.i = pos_0;1136 p.i = pos_0;
1062 break :blk_0 false;1137 break :blk_0 false;
1063 };1138 };
1064 }1139 }
1065 pub fn parseLoopTypeExpr(p: *Parser) bool {1140 pub fn parseLoopTypeExpr(p: *Parser) Error!bool {
1066 return blk_0: {1141 return blk_0: {
1067 const pos_0 = p.i;1142 const pos_0 = p.i;
1068 if ((p.parseKEYWORD_inline() or true) and blk_2: {1143 if ((try p.parseKEYWORD_inline() or true) and blk_2: {
1069 const pos_2 = p.i;1144 const pos_2 = p.i;
1070 if (p.parseForTypeExpr()) break :blk_2 true;1145 if (try p.parseForTypeExpr()) break :blk_2 true;
1071 p.i = pos_2;1146 p.i = pos_2;
1072 if (p.parseWhileTypeExpr()) break :blk_2 true;1147 if (try p.parseWhileTypeExpr()) break :blk_2 true;
1073 p.i = pos_2;1148 p.i = pos_2;
1074 break :blk_2 false;1149 break :blk_2 false;
1075 }) break :blk_0 true;1150 }) break :blk_0 true;
...@@ -1077,16 +1152,16 @@ const Parser = struct {...@@ -1077,16 +1152,16 @@ const Parser = struct {
1077 break :blk_0 false;1152 break :blk_0 false;
1078 };1153 };
1079 }1154 }
1080 pub fn parseForTypeExpr(p: *Parser) bool {1155 pub fn parseForTypeExpr(p: *Parser) Error!bool {
1081 return blk_0: {1156 return blk_0: {
1082 const pos_0 = p.i;1157 const pos_0 = p.i;
1083 if (p.parseForPrefix() and p.parseTypeExpr() and blk_2: {1158 if (try p.parseForPrefix() and try p.parseTypeExpr() and blk_2: {
1084 const pos_2 = p.i;1159 const pos_2 = p.i;
1085 if (p.parseKEYWORD_else() and p.parseTypeExpr()) break :blk_2 true;1160 if (try p.parseKEYWORD_else() and try p.parseTypeExpr()) break :blk_2 true;
1086 p.i = pos_2;1161 p.i = pos_2;
1087 if (blk_3: {1162 if (blk_3: {
1088 const pos_3 = p.i;1163 const pos_3 = p.i;
1089 const match_3 = p.parseKEYWORD_else();1164 const match_3 = try p.parseKEYWORD_else();
1090 p.i = pos_3;1165 p.i = pos_3;
1091 break :blk_3 !match_3;1166 break :blk_3 !match_3;
1092 }) break :blk_2 true;1167 }) break :blk_2 true;
...@@ -1097,16 +1172,16 @@ const Parser = struct {...@@ -1097,16 +1172,16 @@ const Parser = struct {
1097 break :blk_0 false;1172 break :blk_0 false;
1098 };1173 };
1099 }1174 }
1100 pub fn parseWhileTypeExpr(p: *Parser) bool {1175 pub fn parseWhileTypeExpr(p: *Parser) Error!bool {
1101 return blk_0: {1176 return blk_0: {
1102 const pos_0 = p.i;1177 const pos_0 = p.i;
1103 if (p.parseWhilePrefix() and p.parseTypeExpr() and blk_2: {1178 if (try p.parseWhilePrefix() and try p.parseTypeExpr() and blk_2: {
1104 const pos_2 = p.i;1179 const pos_2 = p.i;
1105 if (p.parseKEYWORD_else() and (p.parsePayload() or true) and p.parseTypeExpr()) break :blk_2 true;1180 if (try p.parseKEYWORD_else() and (try p.parsePayload() or true) and try p.parseTypeExpr()) break :blk_2 true;
1106 p.i = pos_2;1181 p.i = pos_2;
1107 if (blk_3: {1182 if (blk_3: {
1108 const pos_3 = p.i;1183 const pos_3 = p.i;
1109 const match_3 = p.parseKEYWORD_else();1184 const match_3 = try p.parseKEYWORD_else();
1110 p.i = pos_3;1185 p.i = pos_3;
1111 break :blk_3 !match_3;1186 break :blk_3 !match_3;
1112 }) break :blk_2 true;1187 }) break :blk_2 true;
...@@ -1117,137 +1192,137 @@ const Parser = struct {...@@ -1117,137 +1192,137 @@ const Parser = struct {
1117 break :blk_0 false;1192 break :blk_0 false;
1118 };1193 };
1119 }1194 }
1120 pub fn parseSwitchExpr(p: *Parser) bool {1195 pub fn parseSwitchExpr(p: *Parser) Error!bool {
1121 return blk_0: {1196 return blk_0: {
1122 const pos_0 = p.i;1197 const pos_0 = p.i;
1123 if (p.parseKEYWORD_switch() and p.parseLPAREN() and p.parseExpr() and p.parseRPAREN() and p.parseLBRACE() and p.parseSwitchProngList() and p.parseRBRACE()) break :blk_0 true;1198 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;
1124 p.i = pos_0;1199 p.i = pos_0;
1125 break :blk_0 false;1200 break :blk_0 false;
1126 };1201 };
1127 }1202 }
1128 pub fn parseAsmExpr(p: *Parser) bool {1203 pub fn parseAsmExpr(p: *Parser) Error!bool {
1129 return blk_0: {1204 return blk_0: {
1130 const pos_0 = p.i;1205 const pos_0 = p.i;
1131 if (p.parseKEYWORD_asm() and (p.parseKEYWORD_volatile() or true) and p.parseLPAREN() and p.parseExpr() and (p.parseAsmOutput() or true) and p.parseRPAREN()) break :blk_0 true;1206 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;
1132 p.i = pos_0;1207 p.i = pos_0;
1133 break :blk_0 false;1208 break :blk_0 false;
1134 };1209 };
1135 }1210 }
1136 pub fn parseAsmOutput(p: *Parser) bool {1211 pub fn parseAsmOutput(p: *Parser) Error!bool {
1137 return blk_0: {1212 return blk_0: {
1138 const pos_0 = p.i;1213 const pos_0 = p.i;
1139 if (p.parseCOLON() and p.parseAsmOutputList() and (p.parseAsmInput() or true)) break :blk_0 true;1214 if (try p.parseCOLON() and try p.parseAsmOutputList() and (try p.parseAsmInput() or true)) break :blk_0 true;
1140 p.i = pos_0;1215 p.i = pos_0;
1141 break :blk_0 false;1216 break :blk_0 false;
1142 };1217 };
1143 }1218 }
1144 pub fn parseAsmOutputItem(p: *Parser) bool {1219 pub fn parseAsmOutputItem(p: *Parser) Error!bool {
1145 return blk_0: {1220 return blk_0: {
1146 const pos_0 = p.i;1221 const pos_0 = p.i;
1147 if (p.parseLBRACKET() and p.parseIDENTIFIER() and p.parseRBRACKET() and p.parseSTRINGLITERALSINGLE() and p.parseLPAREN() and blk_2: {1222 if (try p.parseLBRACKET() and try p.parseIDENTIFIER() and try p.parseRBRACKET() and try p.parseSTRINGLITERALSINGLE() and try p.parseLPAREN() and blk_2: {
1148 const pos_2 = p.i;1223 const pos_2 = p.i;
1149 if (p.parseMINUSRARROW() and p.parseTypeExpr()) break :blk_2 true;1224 if (try p.parseMINUSRARROW() and try p.parseTypeExpr()) break :blk_2 true;
1150 p.i = pos_2;1225 p.i = pos_2;
1151 if (p.parseIDENTIFIER()) break :blk_2 true;1226 if (try p.parseIDENTIFIER()) break :blk_2 true;
1152 p.i = pos_2;1227 p.i = pos_2;
1153 break :blk_2 false;1228 break :blk_2 false;
1154 } and p.parseRPAREN()) break :blk_0 true;1229 } and try p.parseRPAREN()) break :blk_0 true;
1155 p.i = pos_0;1230 p.i = pos_0;
1156 break :blk_0 false;1231 break :blk_0 false;
1157 };1232 };
1158 }1233 }
1159 pub fn parseAsmInput(p: *Parser) bool {1234 pub fn parseAsmInput(p: *Parser) Error!bool {
1160 return blk_0: {1235 return blk_0: {
1161 const pos_0 = p.i;1236 const pos_0 = p.i;
1162 if (p.parseCOLON() and p.parseAsmInputList() and (p.parseAsmClobbers() or true)) break :blk_0 true;1237 if (try p.parseCOLON() and try p.parseAsmInputList() and (try p.parseAsmClobbers() or true)) break :blk_0 true;
1163 p.i = pos_0;1238 p.i = pos_0;
1164 break :blk_0 false;1239 break :blk_0 false;
1165 };1240 };
1166 }1241 }
1167 pub fn parseAsmInputItem(p: *Parser) bool {1242 pub fn parseAsmInputItem(p: *Parser) Error!bool {
1168 return blk_0: {1243 return blk_0: {
1169 const pos_0 = p.i;1244 const pos_0 = p.i;
1170 if (p.parseLBRACKET() and p.parseIDENTIFIER() and p.parseRBRACKET() and p.parseSTRINGLITERALSINGLE() and p.parseLPAREN() and p.parseExpr() and p.parseRPAREN()) break :blk_0 true;1245 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;
1171 p.i = pos_0;1246 p.i = pos_0;
1172 break :blk_0 false;1247 break :blk_0 false;
1173 };1248 };
1174 }1249 }
1175 pub fn parseAsmClobbers(p: *Parser) bool {1250 pub fn parseAsmClobbers(p: *Parser) Error!bool {
1176 return blk_0: {1251 return blk_0: {
1177 const pos_0 = p.i;1252 const pos_0 = p.i;
1178 if (p.parseCOLON() and p.parseExpr()) break :blk_0 true;1253 if (try p.parseCOLON() and try p.parseExpr()) break :blk_0 true;
1179 p.i = pos_0;1254 p.i = pos_0;
1180 break :blk_0 false;1255 break :blk_0 false;
1181 };1256 };
1182 }1257 }
1183 pub fn parseBreakLabel(p: *Parser) bool {1258 pub fn parseBreakLabel(p: *Parser) Error!bool {
1184 return blk_0: {1259 return blk_0: {
1185 const pos_0 = p.i;1260 const pos_0 = p.i;
1186 if (p.parseCOLON() and p.parseIDENTIFIER()) break :blk_0 true;1261 if (try p.parseCOLON() and try p.parseIDENTIFIER()) break :blk_0 true;
1187 p.i = pos_0;1262 p.i = pos_0;
1188 break :blk_0 false;1263 break :blk_0 false;
1189 };1264 };
1190 }1265 }
1191 pub fn parseBlockLabel(p: *Parser) bool {1266 pub fn parseBlockLabel(p: *Parser) Error!bool {
1192 return blk_0: {1267 return blk_0: {
1193 const pos_0 = p.i;1268 const pos_0 = p.i;
1194 if (p.parseIDENTIFIER() and p.parseCOLON()) break :blk_0 true;1269 if (try p.parseIDENTIFIER() and try p.parseCOLON()) break :blk_0 true;
1195 p.i = pos_0;1270 p.i = pos_0;
1196 break :blk_0 false;1271 break :blk_0 false;
1197 };1272 };
1198 }1273 }
1199 pub fn parseFieldInit(p: *Parser) bool {1274 pub fn parseFieldInit(p: *Parser) Error!bool {
1200 return blk_0: {1275 return blk_0: {
1201 const pos_0 = p.i;1276 const pos_0 = p.i;
1202 if (p.parseDOT() and p.parseIDENTIFIER() and p.parseEQUAL() and p.parseExpr()) break :blk_0 true;1277 if (try p.parseDOT() and try p.parseIDENTIFIER() and try p.parseEQUAL() and try p.parseExpr()) break :blk_0 true;
1203 p.i = pos_0;1278 p.i = pos_0;
1204 break :blk_0 false;1279 break :blk_0 false;
1205 };1280 };
1206 }1281 }
1207 pub fn parseWhileContinueExpr(p: *Parser) bool {1282 pub fn parseWhileContinueExpr(p: *Parser) Error!bool {
1208 return blk_0: {1283 return blk_0: {
1209 const pos_0 = p.i;1284 const pos_0 = p.i;
1210 if (p.parseCOLON() and p.parseLPAREN() and p.parseAssignExpr() and p.parseRPAREN()) break :blk_0 true;1285 if (try p.parseCOLON() and try p.parseLPAREN() and try p.parseAssignExpr() and try p.parseRPAREN()) break :blk_0 true;
1211 p.i = pos_0;1286 p.i = pos_0;
1212 break :blk_0 false;1287 break :blk_0 false;
1213 };1288 };
1214 }1289 }
1215 pub fn parseLinkSection(p: *Parser) bool {1290 pub fn parseLinkSection(p: *Parser) Error!bool {
1216 return blk_0: {1291 return blk_0: {
1217 const pos_0 = p.i;1292 const pos_0 = p.i;
1218 if (p.parseKEYWORD_linksection() and p.parseLPAREN() and p.parseExpr() and p.parseRPAREN()) break :blk_0 true;1293 if (try p.parseKEYWORD_linksection() and try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_0 true;
1219 p.i = pos_0;1294 p.i = pos_0;
1220 break :blk_0 false;1295 break :blk_0 false;
1221 };1296 };
1222 }1297 }
1223 pub fn parseAddrSpace(p: *Parser) bool {1298 pub fn parseAddrSpace(p: *Parser) Error!bool {
1224 return blk_0: {1299 return blk_0: {
1225 const pos_0 = p.i;1300 const pos_0 = p.i;
1226 if (p.parseKEYWORD_addrspace() and p.parseLPAREN() and p.parseExpr() and p.parseRPAREN()) break :blk_0 true;1301 if (try p.parseKEYWORD_addrspace() and try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_0 true;
1227 p.i = pos_0;1302 p.i = pos_0;
1228 break :blk_0 false;1303 break :blk_0 false;
1229 };1304 };
1230 }1305 }
1231 pub fn parseCallConv(p: *Parser) bool {1306 pub fn parseCallConv(p: *Parser) Error!bool {
1232 return blk_0: {1307 return blk_0: {
1233 const pos_0 = p.i;1308 const pos_0 = p.i;
1234 if (p.parseKEYWORD_callconv() and p.parseLPAREN() and p.parseExpr() and p.parseRPAREN()) break :blk_0 true;1309 if (try p.parseKEYWORD_callconv() and try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_0 true;
1235 p.i = pos_0;1310 p.i = pos_0;
1236 break :blk_0 false;1311 break :blk_0 false;
1237 };1312 };
1238 }1313 }
1239 pub fn parseParamDecl(p: *Parser) bool {1314 pub fn parseParamDecl(p: *Parser) Error!bool {
1240 return blk_0: {1315 return blk_0: {
1241 const pos_0 = p.i;1316 const pos_0 = p.i;
1242 if ((p.parsedoc_comment() or true) and blk_2: {1317 if ((try p.parsedoc_comment() or true) and blk_2: {
1243 const pos_2 = p.i;1318 const pos_2 = p.i;
1244 if (p.parseKEYWORD_noalias()) break :blk_2 true;1319 if (try p.parseKEYWORD_noalias()) break :blk_2 true;
1245 p.i = pos_2;1320 p.i = pos_2;
1246 if (p.parseKEYWORD_comptime()) break :blk_2 true;1321 if (try p.parseKEYWORD_comptime()) break :blk_2 true;
1247 p.i = pos_2;1322 p.i = pos_2;
1248 if (blk_3: {1323 if (blk_3: {
1249 const pos_3 = p.i;1324 const pos_3 = p.i;
1250 const match_3 = p.parseKEYWORD_comptime();1325 const match_3 = try p.parseKEYWORD_comptime();
1251 p.i = pos_3;1326 p.i = pos_3;
1252 break :blk_3 !match_3;1327 break :blk_3 !match_3;
1253 }) break :blk_2 true;1328 }) break :blk_2 true;
...@@ -1255,13 +1330,13 @@ const Parser = struct {...@@ -1255,13 +1330,13 @@ const Parser = struct {
1255 break :blk_2 false;1330 break :blk_2 false;
1256 } and blk_2: {1331 } and blk_2: {
1257 const pos_2 = p.i;1332 const pos_2 = p.i;
1258 if (p.parseIDENTIFIER() and p.parseCOLON()) break :blk_2 true;1333 if (try p.parseIDENTIFIER() and try p.parseCOLON()) break :blk_2 true;
1259 p.i = pos_2;1334 p.i = pos_2;
1260 if (blk_3: {1335 if (blk_3: {
1261 const pos_3 = p.i;1336 const pos_3 = p.i;
1262 const match_3 = blk_5: {1337 const match_3 = blk_5: {
1263 const pos_5 = p.i;1338 const pos_5 = p.i;
1264 if (p.parseIDENTIFIER() and p.parseCOLON()) break :blk_5 true;1339 if (try p.parseIDENTIFIER() and try p.parseCOLON()) break :blk_5 true;
1265 p.i = pos_5;1340 p.i = pos_5;
1266 break :blk_5 false;1341 break :blk_5 false;
1267 };1342 };
...@@ -1270,122 +1345,130 @@ const Parser = struct {...@@ -1270,122 +1345,130 @@ const Parser = struct {
1270 }) break :blk_2 true;1345 }) break :blk_2 true;
1271 p.i = pos_2;1346 p.i = pos_2;
1272 break :blk_2 false;1347 break :blk_2 false;
1273 } and p.parseParamType()) break :blk_0 true;1348 } and try p.parseParamType()) break :blk_0 true;
1274 p.i = pos_0;1349 p.i = pos_0;
1275 break :blk_0 false;1350 break :blk_0 false;
1276 };1351 };
1277 }1352 }
1278 pub fn parseParamType(p: *Parser) bool {1353 pub fn parseParamType(p: *Parser) Error!bool {
1279 return blk_0: {1354 return blk_0: {
1280 const pos_0 = p.i;1355 const pos_0 = p.i;
1281 if (p.parseKEYWORD_anytype()) break :blk_0 true;1356 if (try p.parseKEYWORD_anytype()) break :blk_0 true;
1282 p.i = pos_0;1357 p.i = pos_0;
1283 if (p.parseTypeExpr()) break :blk_0 true;1358 if (try p.parseTypeExpr()) break :blk_0 true;
1284 p.i = pos_0;1359 p.i = pos_0;
1285 break :blk_0 false;1360 break :blk_0 false;
1286 };1361 };
1287 }1362 }
1288 pub fn parseIfPrefix(p: *Parser) bool {1363 pub fn parseIfPrefix(p: *Parser) Error!bool {
1289 return blk_0: {1364 return blk_0: {
1290 const pos_0 = p.i;1365 const pos_0 = p.i;
1291 if (p.parseKEYWORD_if() and p.parseLPAREN() and p.parseExpr() and p.parseRPAREN() and (p.parsePtrPayload() or true)) break :blk_0 true;1366 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;
1292 p.i = pos_0;1367 p.i = pos_0;
1293 break :blk_0 false;1368 break :blk_0 false;
1294 };1369 };
1295 }1370 }
1296 pub fn parseWhilePrefix(p: *Parser) bool {1371 pub fn parseWhilePrefix(p: *Parser) Error!bool {
1297 return blk_0: {1372 return blk_0: {
1298 const pos_0 = p.i;1373 const pos_0 = p.i;
1299 if (p.parseKEYWORD_while() and p.parseLPAREN() and p.parseExpr() and p.parseRPAREN() and (p.parsePtrPayload() or true) and (p.parseWhileContinueExpr() or true)) break :blk_0 true;1374 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;
1300 p.i = pos_0;1375 p.i = pos_0;
1301 break :blk_0 false;1376 break :blk_0 false;
1302 };1377 };
1303 }1378 }
1304 pub fn parseForPrefix(p: *Parser) bool {1379 pub fn parseForPrefix(p: *Parser) Error!bool {
1305 return blk_0: {1380 return blk_0: {
1306 const pos_0 = p.i;1381 const pos_0 = p.i;
1307 if (p.parseKEYWORD_for() and p.parseLPAREN() and p.parseForArgumentsList() and p.parseRPAREN() and p.parsePtrListPayload()) break :blk_0 true;1382 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;
1308 p.i = pos_0;1383 p.i = pos_0;
1309 break :blk_0 false;1384 break :blk_0 false;
1310 };1385 };
1311 }1386 }
1312 pub fn parsePayload(p: *Parser) bool {1387 pub fn parsePayload(p: *Parser) Error!bool {
1313 return blk_0: {1388 return blk_0: {
1314 const pos_0 = p.i;1389 const pos_0 = p.i;
1315 if (p.parsePIPE() and p.parseIDENTIFIER() and p.parsePIPE()) break :blk_0 true;1390 if (try p.parsePIPE() and try p.parseIDENTIFIER() and try p.parsePIPE()) break :blk_0 true;
1316 p.i = pos_0;1391 p.i = pos_0;
1317 break :blk_0 false;1392 break :blk_0 false;
1318 };1393 };
1319 }1394 }
1320 pub fn parsePtrPayload(p: *Parser) bool {1395 pub fn parsePtrPayload(p: *Parser) Error!bool {
1321 return blk_0: {1396 return blk_0: {
1322 const pos_0 = p.i;1397 const pos_0 = p.i;
1323 if (p.parsePIPE() and (p.parseASTERISK() or true) and p.parseIDENTIFIER() and p.parsePIPE()) break :blk_0 true;1398 if (try p.parsePIPE() and (try p.parseASTERISK() or true) and try p.parseIDENTIFIER() and try p.parsePIPE()) break :blk_0 true;
1324 p.i = pos_0;1399 p.i = pos_0;
1325 break :blk_0 false;1400 break :blk_0 false;
1326 };1401 };
1327 }1402 }
1328 pub fn parsePtrIndexPayload(p: *Parser) bool {1403 pub fn parsePtrIndexPayload(p: *Parser) Error!bool {
1329 return blk_0: {1404 return blk_0: {
1330 const pos_0 = p.i;1405 const pos_0 = p.i;
1331 if (p.parsePIPE() and (p.parseASTERISK() or true) and p.parseIDENTIFIER() and (blk_3: {1406 if (try p.parsePIPE() and (try p.parseASTERISK() or true) and try p.parseIDENTIFIER() and (blk_3: {
1332 const pos_3 = p.i;1407 const pos_3 = p.i;
1333 if (p.parseCOMMA() and p.parseIDENTIFIER()) break :blk_3 true;1408 if (try p.parseCOMMA() and try p.parseIDENTIFIER()) break :blk_3 true;
1334 p.i = pos_3;1409 p.i = pos_3;
1335 break :blk_3 false;1410 break :blk_3 false;
1336 } or true) and p.parsePIPE()) break :blk_0 true;1411 } or true) and try p.parsePIPE()) break :blk_0 true;
1337 p.i = pos_0;1412 p.i = pos_0;
1338 break :blk_0 false;1413 break :blk_0 false;
1339 };1414 };
1340 }1415 }
1341 pub fn parsePtrListPayload(p: *Parser) bool {1416 pub fn parsePtrListPayload(p: *Parser) Error!bool {
1342 return blk_0: {1417 return blk_0: {
1343 const pos_0 = p.i;1418 const pos_0 = p.i;
1344 if (p.parsePIPE() and (p.parseASTERISK() or true) and p.parseIDENTIFIER() and blk_1: {1419 if (try p.parsePIPE() and (try p.parseASTERISK() or true) and try p.parseIDENTIFIER() and blk_1: {
1420 var i_1: usize = 0;
1345 while (blk_3: {1421 while (blk_3: {
1346 const pos_3 = p.i;1422 const pos_3 = p.i;
1347 if (p.parseCOMMA() and (p.parseASTERISK() or true) and p.parseIDENTIFIER()) break :blk_3 true;1423 if (try p.parseCOMMA() and (try p.parseASTERISK() or true) and try p.parseIDENTIFIER()) break :blk_3 true;
1348 p.i = pos_3;1424 p.i = pos_3;
1349 break :blk_3 false;1425 break :blk_3 false;
1350 }) {}1426 }) {
1427 if (i_1 > max_depth) return error.MaxDepth;
1428 i_1 += 1;
1429 }
1351 break :blk_1 true;1430 break :blk_1 true;
1352 } and (p.parseCOMMA() or true) and p.parsePIPE()) break :blk_0 true;1431 } and (try p.parseCOMMA() or true) and try p.parsePIPE()) break :blk_0 true;
1353 p.i = pos_0;1432 p.i = pos_0;
1354 break :blk_0 false;1433 break :blk_0 false;
1355 };1434 };
1356 }1435 }
1357 pub fn parseSwitchProng(p: *Parser) bool {1436 pub fn parseSwitchProng(p: *Parser) Error!bool {
1358 return blk_0: {1437 return blk_0: {
1359 const pos_0 = p.i;1438 const pos_0 = p.i;
1360 if ((p.parseKEYWORD_inline() or true) and p.parseSwitchCase() and p.parseEQUALRARROW() and (p.parsePtrIndexPayload() or true) and p.parseSingleAssignExpr()) break :blk_0 true;1439 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;
1361 p.i = pos_0;1440 p.i = pos_0;
1362 break :blk_0 false;1441 break :blk_0 false;
1363 };1442 };
1364 }1443 }
1365 pub fn parseSwitchCase(p: *Parser) bool {1444 pub fn parseSwitchCase(p: *Parser) Error!bool {
1366 return blk_0: {1445 return blk_0: {
1367 const pos_0 = p.i;1446 const pos_0 = p.i;
1368 if (p.parseSwitchItem() and blk_1: {1447 if (try p.parseSwitchItem() and blk_1: {
1448 var i_1: usize = 0;
1369 while (blk_3: {1449 while (blk_3: {
1370 const pos_3 = p.i;1450 const pos_3 = p.i;
1371 if (p.parseCOMMA() and p.parseSwitchItem()) break :blk_3 true;1451 if (try p.parseCOMMA() and try p.parseSwitchItem()) break :blk_3 true;
1372 p.i = pos_3;1452 p.i = pos_3;
1373 break :blk_3 false;1453 break :blk_3 false;
1374 }) {}1454 }) {
1455 if (i_1 > max_depth) return error.MaxDepth;
1456 i_1 += 1;
1457 }
1375 break :blk_1 true;1458 break :blk_1 true;
1376 } and (p.parseCOMMA() or true)) break :blk_0 true;1459 } and (try p.parseCOMMA() or true)) break :blk_0 true;
1377 p.i = pos_0;1460 p.i = pos_0;
1378 if (p.parseKEYWORD_else()) break :blk_0 true;1461 if (try p.parseKEYWORD_else()) break :blk_0 true;
1379 p.i = pos_0;1462 p.i = pos_0;
1380 break :blk_0 false;1463 break :blk_0 false;
1381 };1464 };
1382 }1465 }
1383 pub fn parseSwitchItem(p: *Parser) bool {1466 pub fn parseSwitchItem(p: *Parser) Error!bool {
1384 return blk_0: {1467 return blk_0: {
1385 const pos_0 = p.i;1468 const pos_0 = p.i;
1386 if (p.parseExpr() and (blk_3: {1469 if (try p.parseExpr() and (blk_3: {
1387 const pos_3 = p.i;1470 const pos_3 = p.i;
1388 if (p.parseDOT3() and p.parseExpr()) break :blk_3 true;1471 if (try p.parseDOT3() and try p.parseExpr()) break :blk_3 true;
1389 p.i = pos_3;1472 p.i = pos_3;
1390 break :blk_3 false;1473 break :blk_3 false;
1391 } or true)) break :blk_0 true;1474 } or true)) break :blk_0 true;
...@@ -1393,34 +1476,38 @@ const Parser = struct {...@@ -1393,34 +1476,38 @@ const Parser = struct {
1393 break :blk_0 false;1476 break :blk_0 false;
1394 };1477 };
1395 }1478 }
1396 pub fn parseForArgumentsList(p: *Parser) bool {1479 pub fn parseForArgumentsList(p: *Parser) Error!bool {
1397 return blk_0: {1480 return blk_0: {
1398 const pos_0 = p.i;1481 const pos_0 = p.i;
1399 if (p.parseForItem() and blk_1: {1482 if (try p.parseForItem() and blk_1: {
1483 var i_1: usize = 0;
1400 while (blk_3: {1484 while (blk_3: {
1401 const pos_3 = p.i;1485 const pos_3 = p.i;
1402 if (p.parseCOMMA() and p.parseForItem()) break :blk_3 true;1486 if (try p.parseCOMMA() and try p.parseForItem()) break :blk_3 true;
1403 p.i = pos_3;1487 p.i = pos_3;
1404 break :blk_3 false;1488 break :blk_3 false;
1405 }) {}1489 }) {
1490 if (i_1 > max_depth) return error.MaxDepth;
1491 i_1 += 1;
1492 }
1406 break :blk_1 true;1493 break :blk_1 true;
1407 } and (p.parseCOMMA() or true)) break :blk_0 true;1494 } and (try p.parseCOMMA() or true)) break :blk_0 true;
1408 p.i = pos_0;1495 p.i = pos_0;
1409 break :blk_0 false;1496 break :blk_0 false;
1410 };1497 };
1411 }1498 }
1412 pub fn parseForItem(p: *Parser) bool {1499 pub fn parseForItem(p: *Parser) Error!bool {
1413 return blk_0: {1500 return blk_0: {
1414 const pos_0 = p.i;1501 const pos_0 = p.i;
1415 if (p.parseExpr() and blk_2: {1502 if (try p.parseExpr() and blk_2: {
1416 const pos_2 = p.i;1503 const pos_2 = p.i;
1417 if (p.parseDOT2() and blk_4: {1504 if (try p.parseDOT2() and blk_4: {
1418 const pos_4 = p.i;1505 const pos_4 = p.i;
1419 if (p.parseExpr()) break :blk_4 true;1506 if (try p.parseExpr()) break :blk_4 true;
1420 p.i = pos_4;1507 p.i = pos_4;
1421 if (blk_5: {1508 if (blk_5: {
1422 const pos_5 = p.i;1509 const pos_5 = p.i;
1423 const match_5 = p.parseExprPrefix();1510 const match_5 = try p.parseExprPrefix();
1424 p.i = pos_5;1511 p.i = pos_5;
1425 break :blk_5 !match_5;1512 break :blk_5 !match_5;
1426 }) break :blk_4 true;1513 }) break :blk_4 true;
...@@ -1430,7 +1517,7 @@ const Parser = struct {...@@ -1430,7 +1517,7 @@ const Parser = struct {
1430 p.i = pos_2;1517 p.i = pos_2;
1431 if (blk_3: {1518 if (blk_3: {
1432 const pos_3 = p.i;1519 const pos_3 = p.i;
1433 const match_3 = p.parseDOT2();1520 const match_3 = try p.parseDOT2();
1434 p.i = pos_3;1521 p.i = pos_3;
1435 break :blk_3 !match_3;1522 break :blk_3 !match_3;
1436 }) break :blk_2 true;1523 }) break :blk_2 true;
...@@ -1441,61 +1528,61 @@ const Parser = struct {...@@ -1441,61 +1528,61 @@ const Parser = struct {
1441 break :blk_0 false;1528 break :blk_0 false;
1442 };1529 };
1443 }1530 }
1444 pub fn parseAssignOp(p: *Parser) bool {1531 pub fn parseAssignOp(p: *Parser) Error!bool {
1445 return blk_0: {1532 return blk_0: {
1446 const pos_0 = p.i;1533 const pos_0 = p.i;
1447 if (p.parseASTERISKEQUAL()) break :blk_0 true;1534 if (try p.parseASTERISKEQUAL()) break :blk_0 true;
1448 p.i = pos_0;1535 p.i = pos_0;
1449 if (p.parseASTERISKPIPEEQUAL()) break :blk_0 true;1536 if (try p.parseASTERISKPIPEEQUAL()) break :blk_0 true;
1450 p.i = pos_0;1537 p.i = pos_0;
1451 if (p.parseSLASHEQUAL()) break :blk_0 true;1538 if (try p.parseSLASHEQUAL()) break :blk_0 true;
1452 p.i = pos_0;1539 p.i = pos_0;
1453 if (p.parsePERCENTEQUAL()) break :blk_0 true;1540 if (try p.parsePERCENTEQUAL()) break :blk_0 true;
1454 p.i = pos_0;1541 p.i = pos_0;
1455 if (p.parsePLUSEQUAL()) break :blk_0 true;1542 if (try p.parsePLUSEQUAL()) break :blk_0 true;
1456 p.i = pos_0;1543 p.i = pos_0;
1457 if (p.parsePLUSPIPEEQUAL()) break :blk_0 true;1544 if (try p.parsePLUSPIPEEQUAL()) break :blk_0 true;
1458 p.i = pos_0;1545 p.i = pos_0;
1459 if (p.parseMINUSEQUAL()) break :blk_0 true;1546 if (try p.parseMINUSEQUAL()) break :blk_0 true;
1460 p.i = pos_0;1547 p.i = pos_0;
1461 if (p.parseMINUSPIPEEQUAL()) break :blk_0 true;1548 if (try p.parseMINUSPIPEEQUAL()) break :blk_0 true;
1462 p.i = pos_0;1549 p.i = pos_0;
1463 if (p.parseLARROW2EQUAL()) break :blk_0 true;1550 if (try p.parseLARROW2EQUAL()) break :blk_0 true;
1464 p.i = pos_0;1551 p.i = pos_0;
1465 if (p.parseLARROW2PIPEEQUAL()) break :blk_0 true;1552 if (try p.parseLARROW2PIPEEQUAL()) break :blk_0 true;
1466 p.i = pos_0;1553 p.i = pos_0;
1467 if (p.parseRARROW2EQUAL()) break :blk_0 true;1554 if (try p.parseRARROW2EQUAL()) break :blk_0 true;
1468 p.i = pos_0;1555 p.i = pos_0;
1469 if (p.parseAMPERSANDEQUAL()) break :blk_0 true;1556 if (try p.parseAMPERSANDEQUAL()) break :blk_0 true;
1470 p.i = pos_0;1557 p.i = pos_0;
1471 if (p.parseCARETEQUAL()) break :blk_0 true;1558 if (try p.parseCARETEQUAL()) break :blk_0 true;
1472 p.i = pos_0;1559 p.i = pos_0;
1473 if (p.parsePIPEEQUAL()) break :blk_0 true;1560 if (try p.parsePIPEEQUAL()) break :blk_0 true;
1474 p.i = pos_0;1561 p.i = pos_0;
1475 if (p.parseASTERISKPERCENTEQUAL()) break :blk_0 true;1562 if (try p.parseASTERISKPERCENTEQUAL()) break :blk_0 true;
1476 p.i = pos_0;1563 p.i = pos_0;
1477 if (p.parsePLUSPERCENTEQUAL()) break :blk_0 true;1564 if (try p.parsePLUSPERCENTEQUAL()) break :blk_0 true;
1478 p.i = pos_0;1565 p.i = pos_0;
1479 if (p.parseMINUSPERCENTEQUAL()) break :blk_0 true;1566 if (try p.parseMINUSPERCENTEQUAL()) break :blk_0 true;
1480 p.i = pos_0;1567 p.i = pos_0;
1481 if (p.parseEQUAL()) break :blk_0 true;1568 if (try p.parseEQUAL()) break :blk_0 true;
1482 p.i = pos_0;1569 p.i = pos_0;
1483 break :blk_0 false;1570 break :blk_0 false;
1484 };1571 };
1485 }1572 }
1486 pub fn parseOrOp(p: *Parser) bool {1573 pub fn parseOrOp(p: *Parser) Error!bool {
1487 return blk_0: {1574 return blk_0: {
1488 const pos_0 = p.i;1575 const pos_0 = p.i;
1489 if (p.parsepre_op_white() and p.parseKEYWORD_or() and p.parsepost_op_white()) break :blk_0 true;1576 if (try p.parsepre_op_white() and try p.parseKEYWORD_or() and try p.parsepost_op_white()) break :blk_0 true;
1490 p.i = pos_0;1577 p.i = pos_0;
1491 if (blk_1: {1578 if (blk_1: {
1492 const pos_1 = p.i;1579 const pos_1 = p.i;
1493 const match_1 = p.parsepre_op_white();1580 const match_1 = try p.parsepre_op_white();
1494 p.i = pos_1;1581 p.i = pos_1;
1495 break :blk_1 !match_1;1582 break :blk_1 !match_1;
1496 } and p.parseKEYWORD_or() and blk_1: {1583 } and try p.parseKEYWORD_or() and blk_1: {
1497 const pos_1 = p.i;1584 const pos_1 = p.i;
1498 const match_1 = p.parsepost_op_white();1585 const match_1 = try p.parsepost_op_white();
1499 p.i = pos_1;1586 p.i = pos_1;
1500 break :blk_1 !match_1;1587 break :blk_1 !match_1;
1501 }) break :blk_0 true;1588 }) break :blk_0 true;
...@@ -1503,19 +1590,19 @@ const Parser = struct {...@@ -1503,19 +1590,19 @@ const Parser = struct {
1503 break :blk_0 false;1590 break :blk_0 false;
1504 };1591 };
1505 }1592 }
1506 pub fn parseAndOp(p: *Parser) bool {1593 pub fn parseAndOp(p: *Parser) Error!bool {
1507 return blk_0: {1594 return blk_0: {
1508 const pos_0 = p.i;1595 const pos_0 = p.i;
1509 if (p.parsepre_op_white() and p.parseKEYWORD_and() and p.parsepost_op_white()) break :blk_0 true;1596 if (try p.parsepre_op_white() and try p.parseKEYWORD_and() and try p.parsepost_op_white()) break :blk_0 true;
1510 p.i = pos_0;1597 p.i = pos_0;
1511 if (blk_1: {1598 if (blk_1: {
1512 const pos_1 = p.i;1599 const pos_1 = p.i;
1513 const match_1 = p.parsepre_op_white();1600 const match_1 = try p.parsepre_op_white();
1514 p.i = pos_1;1601 p.i = pos_1;
1515 break :blk_1 !match_1;1602 break :blk_1 !match_1;
1516 } and p.parseKEYWORD_and() and blk_1: {1603 } and try p.parseKEYWORD_and() and blk_1: {
1517 const pos_1 = p.i;1604 const pos_1 = p.i;
1518 const match_1 = p.parsepost_op_white();1605 const match_1 = try p.parsepost_op_white();
1519 p.i = pos_1;1606 p.i = pos_1;
1520 break :blk_1 !match_1;1607 break :blk_1 !match_1;
1521 }) break :blk_0 true;1608 }) break :blk_0 true;
...@@ -1523,19 +1610,19 @@ const Parser = struct {...@@ -1523,19 +1610,19 @@ const Parser = struct {
1523 break :blk_0 false;1610 break :blk_0 false;
1524 };1611 };
1525 }1612 }
1526 pub fn parseCompareOp(p: *Parser) bool {1613 pub fn parseCompareOp(p: *Parser) Error!bool {
1527 return blk_0: {1614 return blk_0: {
1528 const pos_0 = p.i;1615 const pos_0 = p.i;
1529 if (p.parsepre_op_white() and p.parseCompareOpTok() and p.parsepost_op_white()) break :blk_0 true;1616 if (try p.parsepre_op_white() and try p.parseCompareOpTok() and try p.parsepost_op_white()) break :blk_0 true;
1530 p.i = pos_0;1617 p.i = pos_0;
1531 if (blk_1: {1618 if (blk_1: {
1532 const pos_1 = p.i;1619 const pos_1 = p.i;
1533 const match_1 = p.parsepre_op_white();1620 const match_1 = try p.parsepre_op_white();
1534 p.i = pos_1;1621 p.i = pos_1;
1535 break :blk_1 !match_1;1622 break :blk_1 !match_1;
1536 } and p.parseCompareOpTok() and blk_1: {1623 } and try p.parseCompareOpTok() and blk_1: {
1537 const pos_1 = p.i;1624 const pos_1 = p.i;
1538 const match_1 = p.parsepost_op_white();1625 const match_1 = try p.parsepost_op_white();
1539 p.i = pos_1;1626 p.i = pos_1;
1540 break :blk_1 !match_1;1627 break :blk_1 !match_1;
1541 }) break :blk_0 true;1628 }) break :blk_0 true;
...@@ -1543,37 +1630,37 @@ const Parser = struct {...@@ -1543,37 +1630,37 @@ const Parser = struct {
1543 break :blk_0 false;1630 break :blk_0 false;
1544 };1631 };
1545 }1632 }
1546 pub fn parseCompareOpTok(p: *Parser) bool {1633 pub fn parseCompareOpTok(p: *Parser) Error!bool {
1547 return blk_0: {1634 return blk_0: {
1548 const pos_0 = p.i;1635 const pos_0 = p.i;
1549 if (p.parseEQUALEQUAL()) break :blk_0 true;1636 if (try p.parseEQUALEQUAL()) break :blk_0 true;
1550 p.i = pos_0;1637 p.i = pos_0;
1551 if (p.parseEXCLAMATIONMARKEQUAL()) break :blk_0 true;1638 if (try p.parseEXCLAMATIONMARKEQUAL()) break :blk_0 true;
1552 p.i = pos_0;1639 p.i = pos_0;
1553 if (p.parseLARROW()) break :blk_0 true;1640 if (try p.parseLARROW()) break :blk_0 true;
1554 p.i = pos_0;1641 p.i = pos_0;
1555 if (p.parseRARROW()) break :blk_0 true;1642 if (try p.parseRARROW()) break :blk_0 true;
1556 p.i = pos_0;1643 p.i = pos_0;
1557 if (p.parseLARROWEQUAL()) break :blk_0 true;1644 if (try p.parseLARROWEQUAL()) break :blk_0 true;
1558 p.i = pos_0;1645 p.i = pos_0;
1559 if (p.parseRARROWEQUAL()) break :blk_0 true;1646 if (try p.parseRARROWEQUAL()) break :blk_0 true;
1560 p.i = pos_0;1647 p.i = pos_0;
1561 break :blk_0 false;1648 break :blk_0 false;
1562 };1649 };
1563 }1650 }
1564 pub fn parseBitwiseOp(p: *Parser) bool {1651 pub fn parseBitwiseOp(p: *Parser) Error!bool {
1565 return blk_0: {1652 return blk_0: {
1566 const pos_0 = p.i;1653 const pos_0 = p.i;
1567 if (p.parsepre_op_white() and p.parseBitwiseOpTok() and p.parsepost_op_white()) break :blk_0 true;1654 if (try p.parsepre_op_white() and try p.parseBitwiseOpTok() and try p.parsepost_op_white()) break :blk_0 true;
1568 p.i = pos_0;1655 p.i = pos_0;
1569 if (blk_1: {1656 if (blk_1: {
1570 const pos_1 = p.i;1657 const pos_1 = p.i;
1571 const match_1 = p.parsepre_op_white();1658 const match_1 = try p.parsepre_op_white();
1572 p.i = pos_1;1659 p.i = pos_1;
1573 break :blk_1 !match_1;1660 break :blk_1 !match_1;
1574 } and p.parseBitwiseOpTok() and blk_1: {1661 } and try p.parseBitwiseOpTok() and blk_1: {
1575 const pos_1 = p.i;1662 const pos_1 = p.i;
1576 const match_1 = p.parsepost_op_white();1663 const match_1 = try p.parsepost_op_white();
1577 p.i = pos_1;1664 p.i = pos_1;
1578 break :blk_1 !match_1;1665 break :blk_1 !match_1;
1579 }) break :blk_0 true;1666 }) break :blk_0 true;
...@@ -1581,10 +1668,10 @@ const Parser = struct {...@@ -1581,10 +1668,10 @@ const Parser = struct {
1581 break :blk_0 false;1668 break :blk_0 false;
1582 };1669 };
1583 }1670 }
1584 pub fn parseBitwiseOpTok(p: *Parser) bool {1671 pub fn parseBitwiseOpTok(p: *Parser) Error!bool {
1585 return blk_0: {1672 return blk_0: {
1586 const pos_0 = p.i;1673 const pos_0 = p.i;
1587 if (p.parseAMPERSAND() and blk_1: {1674 if (try p.parseAMPERSAND() and blk_1: {
1588 const pos_1 = p.i;1675 const pos_1 = p.i;
1589 const match_1 = (p.i < p.source.len and switch (p.source[p.i]) {1676 const match_1 = (p.i < p.source.len and switch (p.source[p.i]) {
1590 '&'...'&',1677 '&'...'&',
...@@ -1598,30 +1685,30 @@ const Parser = struct {...@@ -1598,30 +1685,30 @@ const Parser = struct {
1598 break :blk_1 !match_1;1685 break :blk_1 !match_1;
1599 }) break :blk_0 true;1686 }) break :blk_0 true;
1600 p.i = pos_0;1687 p.i = pos_0;
1601 if (p.parseCARET()) break :blk_0 true;1688 if (try p.parseCARET()) break :blk_0 true;
1602 p.i = pos_0;1689 p.i = pos_0;
1603 if (p.parsePIPE()) break :blk_0 true;1690 if (try p.parsePIPE()) break :blk_0 true;
1604 p.i = pos_0;1691 p.i = pos_0;
1605 if (p.parseKEYWORD_orelse()) break :blk_0 true;1692 if (try p.parseKEYWORD_orelse()) break :blk_0 true;
1606 p.i = pos_0;1693 p.i = pos_0;
1607 if (p.parseKEYWORD_catch() and (p.parsePayload() or true)) break :blk_0 true;1694 if (try p.parseKEYWORD_catch() and (try p.parsePayload() or true)) break :blk_0 true;
1608 p.i = pos_0;1695 p.i = pos_0;
1609 break :blk_0 false;1696 break :blk_0 false;
1610 };1697 };
1611 }1698 }
1612 pub fn parseBitShiftOp(p: *Parser) bool {1699 pub fn parseBitShiftOp(p: *Parser) Error!bool {
1613 return blk_0: {1700 return blk_0: {
1614 const pos_0 = p.i;1701 const pos_0 = p.i;
1615 if (p.parsepre_op_white() and p.parseBitShiftOpTok() and p.parsepost_op_white()) break :blk_0 true;1702 if (try p.parsepre_op_white() and try p.parseBitShiftOpTok() and try p.parsepost_op_white()) break :blk_0 true;
1616 p.i = pos_0;1703 p.i = pos_0;
1617 if (blk_1: {1704 if (blk_1: {
1618 const pos_1 = p.i;1705 const pos_1 = p.i;
1619 const match_1 = p.parsepre_op_white();1706 const match_1 = try p.parsepre_op_white();
1620 p.i = pos_1;1707 p.i = pos_1;
1621 break :blk_1 !match_1;1708 break :blk_1 !match_1;
1622 } and p.parseBitShiftOpTok() and blk_1: {1709 } and try p.parseBitShiftOpTok() and blk_1: {
1623 const pos_1 = p.i;1710 const pos_1 = p.i;
1624 const match_1 = p.parsepost_op_white();1711 const match_1 = try p.parsepost_op_white();
1625 p.i = pos_1;1712 p.i = pos_1;
1626 break :blk_1 !match_1;1713 break :blk_1 !match_1;
1627 }) break :blk_0 true;1714 }) break :blk_0 true;
...@@ -1629,31 +1716,31 @@ const Parser = struct {...@@ -1629,31 +1716,31 @@ const Parser = struct {
1629 break :blk_0 false;1716 break :blk_0 false;
1630 };1717 };
1631 }1718 }
1632 pub fn parseBitShiftOpTok(p: *Parser) bool {1719 pub fn parseBitShiftOpTok(p: *Parser) Error!bool {
1633 return blk_0: {1720 return blk_0: {
1634 const pos_0 = p.i;1721 const pos_0 = p.i;
1635 if (p.parseLARROW2()) break :blk_0 true;1722 if (try p.parseLARROW2()) break :blk_0 true;
1636 p.i = pos_0;1723 p.i = pos_0;
1637 if (p.parseRARROW2()) break :blk_0 true;1724 if (try p.parseRARROW2()) break :blk_0 true;
1638 p.i = pos_0;1725 p.i = pos_0;
1639 if (p.parseLARROW2PIPE()) break :blk_0 true;1726 if (try p.parseLARROW2PIPE()) break :blk_0 true;
1640 p.i = pos_0;1727 p.i = pos_0;
1641 break :blk_0 false;1728 break :blk_0 false;
1642 };1729 };
1643 }1730 }
1644 pub fn parseAdditionOp(p: *Parser) bool {1731 pub fn parseAdditionOp(p: *Parser) Error!bool {
1645 return blk_0: {1732 return blk_0: {
1646 const pos_0 = p.i;1733 const pos_0 = p.i;
1647 if (p.parsepre_op_white() and p.parseAdditionOpTok() and p.parsepost_op_white()) break :blk_0 true;1734 if (try p.parsepre_op_white() and try p.parseAdditionOpTok() and try p.parsepost_op_white()) break :blk_0 true;
1648 p.i = pos_0;1735 p.i = pos_0;
1649 if (blk_1: {1736 if (blk_1: {
1650 const pos_1 = p.i;1737 const pos_1 = p.i;
1651 const match_1 = p.parsepre_op_white();1738 const match_1 = try p.parsepre_op_white();
1652 p.i = pos_1;1739 p.i = pos_1;
1653 break :blk_1 !match_1;1740 break :blk_1 !match_1;
1654 } and p.parseAdditionOpTok() and blk_1: {1741 } and try p.parseAdditionOpTok() and blk_1: {
1655 const pos_1 = p.i;1742 const pos_1 = p.i;
1656 const match_1 = p.parsepost_op_white();1743 const match_1 = try p.parsepost_op_white();
1657 p.i = pos_1;1744 p.i = pos_1;
1658 break :blk_1 !match_1;1745 break :blk_1 !match_1;
1659 }) break :blk_0 true;1746 }) break :blk_0 true;
...@@ -1661,39 +1748,39 @@ const Parser = struct {...@@ -1661,39 +1748,39 @@ const Parser = struct {
1661 break :blk_0 false;1748 break :blk_0 false;
1662 };1749 };
1663 }1750 }
1664 pub fn parseAdditionOpTok(p: *Parser) bool {1751 pub fn parseAdditionOpTok(p: *Parser) Error!bool {
1665 return blk_0: {1752 return blk_0: {
1666 const pos_0 = p.i;1753 const pos_0 = p.i;
1667 if (p.parsePLUS()) break :blk_0 true;1754 if (try p.parsePLUS()) break :blk_0 true;
1668 p.i = pos_0;1755 p.i = pos_0;
1669 if (p.parseMINUS()) break :blk_0 true;1756 if (try p.parseMINUS()) break :blk_0 true;
1670 p.i = pos_0;1757 p.i = pos_0;
1671 if (p.parsePLUS2()) break :blk_0 true;1758 if (try p.parsePLUS2()) break :blk_0 true;
1672 p.i = pos_0;1759 p.i = pos_0;
1673 if (p.parsePLUSPERCENT()) break :blk_0 true;1760 if (try p.parsePLUSPERCENT()) break :blk_0 true;
1674 p.i = pos_0;1761 p.i = pos_0;
1675 if (p.parseMINUSPERCENT()) break :blk_0 true;1762 if (try p.parseMINUSPERCENT()) break :blk_0 true;
1676 p.i = pos_0;1763 p.i = pos_0;
1677 if (p.parsePLUSPIPE()) break :blk_0 true;1764 if (try p.parsePLUSPIPE()) break :blk_0 true;
1678 p.i = pos_0;1765 p.i = pos_0;
1679 if (p.parseMINUSPIPE()) break :blk_0 true;1766 if (try p.parseMINUSPIPE()) break :blk_0 true;
1680 p.i = pos_0;1767 p.i = pos_0;
1681 break :blk_0 false;1768 break :blk_0 false;
1682 };1769 };
1683 }1770 }
1684 pub fn parseMultiplyOp(p: *Parser) bool {1771 pub fn parseMultiplyOp(p: *Parser) Error!bool {
1685 return blk_0: {1772 return blk_0: {
1686 const pos_0 = p.i;1773 const pos_0 = p.i;
1687 if (p.parsepre_op_white() and p.parseMultiplyOpTok() and p.parsepost_op_white()) break :blk_0 true;1774 if (try p.parsepre_op_white() and try p.parseMultiplyOpTok() and try p.parsepost_op_white()) break :blk_0 true;
1688 p.i = pos_0;1775 p.i = pos_0;
1689 if (blk_1: {1776 if (blk_1: {
1690 const pos_1 = p.i;1777 const pos_1 = p.i;
1691 const match_1 = p.parsepre_op_white();1778 const match_1 = try p.parsepre_op_white();
1692 p.i = pos_1;1779 p.i = pos_1;
1693 break :blk_1 !match_1;1780 break :blk_1 !match_1;
1694 } and p.parseMultiplyOpTok() and blk_1: {1781 } and try p.parseMultiplyOpTok() and blk_1: {
1695 const pos_1 = p.i;1782 const pos_1 = p.i;
1696 const match_1 = p.parsepost_op_white();1783 const match_1 = try p.parsepost_op_white();
1697 p.i = pos_1;1784 p.i = pos_1;
1698 break :blk_1 !match_1;1785 break :blk_1 !match_1;
1699 }) break :blk_0 true;1786 }) break :blk_0 true;
...@@ -1701,159 +1788,207 @@ const Parser = struct {...@@ -1701,159 +1788,207 @@ const Parser = struct {
1701 break :blk_0 false;1788 break :blk_0 false;
1702 };1789 };
1703 }1790 }
1704 pub fn parseMultiplyOpTok(p: *Parser) bool {1791 pub fn parseMultiplyOpTok(p: *Parser) Error!bool {
1705 return blk_0: {1792 return blk_0: {
1706 const pos_0 = p.i;1793 const pos_0 = p.i;
1707 if (p.parsePIPE2()) break :blk_0 true;1794 if (try p.parsePIPE2()) break :blk_0 true;
1708 p.i = pos_0;1795 p.i = pos_0;
1709 if (p.parseASTERISK()) break :blk_0 true;1796 if (try p.parseASTERISK()) break :blk_0 true;
1710 p.i = pos_0;1797 p.i = pos_0;
1711 if (p.parseSLASH()) break :blk_0 true;1798 if (try p.parseSLASH()) break :blk_0 true;
1712 p.i = pos_0;1799 p.i = pos_0;
1713 if (p.parsePERCENT()) break :blk_0 true;1800 if (try p.parsePERCENT()) break :blk_0 true;
1714 p.i = pos_0;1801 p.i = pos_0;
1715 if (p.parseASTERISKPERCENT()) break :blk_0 true;1802 if (try p.parseASTERISKPERCENT()) break :blk_0 true;
1716 p.i = pos_0;1803 p.i = pos_0;
1717 if (p.parseASTERISKPIPE()) break :blk_0 true;1804 if (try p.parseASTERISKPIPE()) break :blk_0 true;
1718 p.i = pos_0;1805 p.i = pos_0;
1719 break :blk_0 false;1806 break :blk_0 false;
1720 };1807 };
1721 }1808 }
1722 pub fn parsePrefixOp(p: *Parser) bool {1809 pub fn parsePrefixOp(p: *Parser) Error!bool {
1723 return blk_0: {1810 return blk_0: {
1724 const pos_0 = p.i;1811 const pos_0 = p.i;
1725 if (p.parseEXCLAMATIONMARK()) break :blk_0 true;1812 if (try p.parseEXCLAMATIONMARK()) break :blk_0 true;
1726 p.i = pos_0;1813 p.i = pos_0;
1727 if (p.parseMINUS()) break :blk_0 true;1814 if (try p.parseMINUS()) break :blk_0 true;
1728 p.i = pos_0;1815 p.i = pos_0;
1729 if (p.parseTILDE()) break :blk_0 true;1816 if (try p.parseTILDE()) break :blk_0 true;
1730 p.i = pos_0;1817 p.i = pos_0;
1731 if (p.parseMINUSPERCENT()) break :blk_0 true;1818 if (try p.parseMINUSPERCENT()) break :blk_0 true;
1732 p.i = pos_0;1819 p.i = pos_0;
1733 if (p.parseAMPERSAND()) break :blk_0 true;1820 if (try p.parseAMPERSAND()) break :blk_0 true;
1734 p.i = pos_0;1821 p.i = pos_0;
1735 if (p.parseKEYWORD_try()) break :blk_0 true;1822 if (try p.parseKEYWORD_try()) break :blk_0 true;
1736 p.i = pos_0;1823 p.i = pos_0;
1737 break :blk_0 false;1824 break :blk_0 false;
1738 };1825 };
1739 }1826 }
1740 pub fn parsePrefixTypeOp(p: *Parser) bool {1827 pub fn parsePrefixTypeOp(p: *Parser) Error!bool {
1741 return blk_0: {1828 return blk_0: {
1742 const pos_0 = p.i;1829 const pos_0 = p.i;
1743 if (p.parseQUESTIONMARK()) break :blk_0 true;1830 if (try p.parseQUESTIONMARK()) break :blk_0 true;
1744 p.i = pos_0;1831 p.i = pos_0;
1745 if (p.parseKEYWORD_anyframe() and p.parseMINUSRARROW()) break :blk_0 true;1832 if (try p.parseKEYWORD_anyframe() and try p.parseMINUSRARROW()) break :blk_0 true;
1746 p.i = pos_0;1833 p.i = pos_0;
1747 if (blk_2: {1834 if (blk_2: {
1748 const pos_2 = p.i;1835 const pos_2 = p.i;
1749 if (p.parseManyPtrTypeStart()) break :blk_2 true;1836 if (try p.parseManyPtrTypeStart()) break :blk_2 true;
1750 p.i = pos_2;1837 p.i = pos_2;
1751 if (p.parseSliceTypeStart()) break :blk_2 true;1838 if (try p.parseSliceTypeStart()) break :blk_2 true;
1752 p.i = pos_2;1839 p.i = pos_2;
1753 break :blk_2 false;1840 break :blk_2 false;
1754 } and p.parsePtrMods()) break :blk_0 true;1841 } and try p.parsePtrMods()) break :blk_0 true;
1755 p.i = pos_0;1842 p.i = pos_0;
1756 if (p.parseSinglePtrTypeStart() and p.parseSinglePtrMods()) break :blk_0 true;1843 if (try p.parseSinglePtrTypeStart() and try p.parseSinglePtrMods()) break :blk_0 true;
1757 p.i = pos_0;1844 p.i = pos_0;
1758 if (p.parseArrayTypeStart()) break :blk_0 true;1845 if (try p.parseArrayTypeStart()) break :blk_0 true;
1759 p.i = pos_0;1846 p.i = pos_0;
1760 break :blk_0 false;1847 break :blk_0 false;
1761 };1848 };
1762 }1849 }
1763 pub fn parsePtrMods(p: *Parser) bool {1850 pub fn parsePtrMods(p: *Parser) Error!bool {
1764 return blk_0: {1851 return blk_0: {
1765 const pos_0 = p.i;1852 const pos_0 = p.i;
1766 if (blk_1: {1853 if (blk_1: {
1767 while (p.parsePtrMod()) {}1854 var i_1: usize = 0;
1855 while (try p.parsePtrMod()) {
1856 if (i_1 > max_depth) return error.MaxDepth;
1857 i_1 += 1;
1858 }
1768 break :blk_1 true;1859 break :blk_1 true;
1769 } and (p.parseByteAlign() or true) and blk_1: {1860 } and (try p.parseByteAlign() or true) and blk_1: {
1770 while (p.parsePtrMod()) {}1861 var i_1: usize = 0;
1862 while (try p.parsePtrMod()) {
1863 if (i_1 > max_depth) return error.MaxDepth;
1864 i_1 += 1;
1865 }
1771 break :blk_1 true;1866 break :blk_1 true;
1772 } and (p.parseAddrSpace() or true) and blk_1: {1867 } and (try p.parseAddrSpace() or true) and blk_1: {
1773 while (p.parsePtrMod()) {}1868 var i_1: usize = 0;
1869 while (try p.parsePtrMod()) {
1870 if (i_1 > max_depth) return error.MaxDepth;
1871 i_1 += 1;
1872 }
1774 break :blk_1 true;1873 break :blk_1 true;
1775 }) break :blk_0 true;1874 }) break :blk_0 true;
1776 p.i = pos_0;1875 p.i = pos_0;
1777 if (blk_1: {1876 if (blk_1: {
1778 while (p.parsePtrMod()) {}1877 var i_1: usize = 0;
1878 while (try p.parsePtrMod()) {
1879 if (i_1 > max_depth) return error.MaxDepth;
1880 i_1 += 1;
1881 }
1779 break :blk_1 true;1882 break :blk_1 true;
1780 } and (p.parseAddrSpace() or true) and blk_1: {1883 } and (try p.parseAddrSpace() or true) and blk_1: {
1781 while (p.parsePtrMod()) {}1884 var i_1: usize = 0;
1885 while (try p.parsePtrMod()) {
1886 if (i_1 > max_depth) return error.MaxDepth;
1887 i_1 += 1;
1888 }
1782 break :blk_1 true;1889 break :blk_1 true;
1783 } and (p.parseByteAlign() or true) and blk_1: {1890 } and (try p.parseByteAlign() or true) and blk_1: {
1784 while (p.parsePtrMod()) {}1891 var i_1: usize = 0;
1892 while (try p.parsePtrMod()) {
1893 if (i_1 > max_depth) return error.MaxDepth;
1894 i_1 += 1;
1895 }
1785 break :blk_1 true;1896 break :blk_1 true;
1786 }) break :blk_0 true;1897 }) break :blk_0 true;
1787 p.i = pos_0;1898 p.i = pos_0;
1788 break :blk_0 false;1899 break :blk_0 false;
1789 };1900 };
1790 }1901 }
1791 pub fn parseSinglePtrMods(p: *Parser) bool {1902 pub fn parseSinglePtrMods(p: *Parser) Error!bool {
1792 return blk_0: {1903 return blk_0: {
1793 const pos_0 = p.i;1904 const pos_0 = p.i;
1794 if (blk_1: {1905 if (blk_1: {
1795 while (p.parsePtrMod()) {}1906 var i_1: usize = 0;
1907 while (try p.parsePtrMod()) {
1908 if (i_1 > max_depth) return error.MaxDepth;
1909 i_1 += 1;
1910 }
1796 break :blk_1 true;1911 break :blk_1 true;
1797 } and (p.parseBitAlign() or true) and blk_1: {1912 } and (try p.parseBitAlign() or true) and blk_1: {
1798 while (p.parsePtrMod()) {}1913 var i_1: usize = 0;
1914 while (try p.parsePtrMod()) {
1915 if (i_1 > max_depth) return error.MaxDepth;
1916 i_1 += 1;
1917 }
1799 break :blk_1 true;1918 break :blk_1 true;
1800 } and (p.parseAddrSpace() or true) and blk_1: {1919 } and (try p.parseAddrSpace() or true) and blk_1: {
1801 while (p.parsePtrMod()) {}1920 var i_1: usize = 0;
1921 while (try p.parsePtrMod()) {
1922 if (i_1 > max_depth) return error.MaxDepth;
1923 i_1 += 1;
1924 }
1802 break :blk_1 true;1925 break :blk_1 true;
1803 }) break :blk_0 true;1926 }) break :blk_0 true;
1804 p.i = pos_0;1927 p.i = pos_0;
1805 if (blk_1: {1928 if (blk_1: {
1806 while (p.parsePtrMod()) {}1929 var i_1: usize = 0;
1930 while (try p.parsePtrMod()) {
1931 if (i_1 > max_depth) return error.MaxDepth;
1932 i_1 += 1;
1933 }
1807 break :blk_1 true;1934 break :blk_1 true;
1808 } and (p.parseAddrSpace() or true) and blk_1: {1935 } and (try p.parseAddrSpace() or true) and blk_1: {
1809 while (p.parsePtrMod()) {}1936 var i_1: usize = 0;
1937 while (try p.parsePtrMod()) {
1938 if (i_1 > max_depth) return error.MaxDepth;
1939 i_1 += 1;
1940 }
1810 break :blk_1 true;1941 break :blk_1 true;
1811 } and (p.parseBitAlign() or true) and blk_1: {1942 } and (try p.parseBitAlign() or true) and blk_1: {
1812 while (p.parsePtrMod()) {}1943 var i_1: usize = 0;
1944 while (try p.parsePtrMod()) {
1945 if (i_1 > max_depth) return error.MaxDepth;
1946 i_1 += 1;
1947 }
1813 break :blk_1 true;1948 break :blk_1 true;
1814 }) break :blk_0 true;1949 }) break :blk_0 true;
1815 p.i = pos_0;1950 p.i = pos_0;
1816 break :blk_0 false;1951 break :blk_0 false;
1817 };1952 };
1818 }1953 }
1819 pub fn parsePtrMod(p: *Parser) bool {1954 pub fn parsePtrMod(p: *Parser) Error!bool {
1820 return blk_0: {1955 return blk_0: {
1821 const pos_0 = p.i;1956 const pos_0 = p.i;
1822 if (p.parseKEYWORD_allowzero()) break :blk_0 true;1957 if (try p.parseKEYWORD_allowzero()) break :blk_0 true;
1823 p.i = pos_0;1958 p.i = pos_0;
1824 if (p.parseKEYWORD_const()) break :blk_0 true;1959 if (try p.parseKEYWORD_const()) break :blk_0 true;
1825 p.i = pos_0;1960 p.i = pos_0;
1826 if (p.parseKEYWORD_volatile()) break :blk_0 true;1961 if (try p.parseKEYWORD_volatile()) break :blk_0 true;
1827 p.i = pos_0;1962 p.i = pos_0;
1828 break :blk_0 false;1963 break :blk_0 false;
1829 };1964 };
1830 }1965 }
1831 pub fn parsePrefixTypeOpPrefix(p: *Parser) bool {1966 pub fn parsePrefixTypeOpPrefix(p: *Parser) Error!bool {
1832 return blk_0: {1967 return blk_0: {
1833 const pos_0 = p.i;1968 const pos_0 = p.i;
1834 if (p.parseQUESTIONMARK()) break :blk_0 true;1969 if (try p.parseQUESTIONMARK()) break :blk_0 true;
1835 p.i = pos_0;1970 p.i = pos_0;
1836 if (p.parseKEYWORD_anyframe() and p.parseMINUSRARROW()) break :blk_0 true;1971 if (try p.parseKEYWORD_anyframe() and try p.parseMINUSRARROW()) break :blk_0 true;
1837 p.i = pos_0;1972 p.i = pos_0;
1838 if (p.parseLBRACKET()) break :blk_0 true;1973 if (try p.parseLBRACKET()) break :blk_0 true;
1839 p.i = pos_0;1974 p.i = pos_0;
1840 if (p.parseASTERISK()) break :blk_0 true;1975 if (try p.parseASTERISK()) break :blk_0 true;
1841 p.i = pos_0;1976 p.i = pos_0;
1842 break :blk_0 false;1977 break :blk_0 false;
1843 };1978 };
1844 }1979 }
1845 pub fn parseSuffixOp(p: *Parser) bool {1980 pub fn parseSuffixOp(p: *Parser) Error!bool {
1846 return blk_0: {1981 return blk_0: {
1847 const pos_0 = p.i;1982 const pos_0 = p.i;
1848 if (p.parseLBRACKET() and p.parseExpr() and (blk_3: {1983 if (try p.parseLBRACKET() and try p.parseExpr() and (blk_3: {
1849 const pos_3 = p.i;1984 const pos_3 = p.i;
1850 if (p.parseDOT2() and blk_5: {1985 if (try p.parseDOT2() and blk_5: {
1851 const pos_5 = p.i;1986 const pos_5 = p.i;
1852 if (p.parseExpr()) break :blk_5 true;1987 if (try p.parseExpr()) break :blk_5 true;
1853 p.i = pos_5;1988 p.i = pos_5;
1854 if (blk_6: {1989 if (blk_6: {
1855 const pos_6 = p.i;1990 const pos_6 = p.i;
1856 const match_6 = p.parseExprPrefix();1991 const match_6 = try p.parseExprPrefix();
1857 p.i = pos_6;1992 p.i = pos_6;
1858 break :blk_6 !match_6;1993 break :blk_6 !match_6;
1859 }) break :blk_5 true;1994 }) break :blk_5 true;
...@@ -1861,145 +1996,145 @@ const Parser = struct {...@@ -1861,145 +1996,145 @@ const Parser = struct {
1861 break :blk_5 false;1996 break :blk_5 false;
1862 } and (blk_6: {1997 } and (blk_6: {
1863 const pos_6 = p.i;1998 const pos_6 = p.i;
1864 if (p.parseCOLON() and p.parseExpr()) break :blk_6 true;1999 if (try p.parseCOLON() and try p.parseExpr()) break :blk_6 true;
1865 p.i = pos_6;2000 p.i = pos_6;
1866 break :blk_6 false;2001 break :blk_6 false;
1867 } or true)) break :blk_3 true;2002 } or true)) break :blk_3 true;
1868 p.i = pos_3;2003 p.i = pos_3;
1869 break :blk_3 false;2004 break :blk_3 false;
1870 } or true) and p.parseRBRACKET()) break :blk_0 true;2005 } or true) and try p.parseRBRACKET()) break :blk_0 true;
1871 p.i = pos_0;2006 p.i = pos_0;
1872 if (p.parseDOT() and p.parseIDENTIFIER()) break :blk_0 true;2007 if (try p.parseDOT() and try p.parseIDENTIFIER()) break :blk_0 true;
1873 p.i = pos_0;2008 p.i = pos_0;
1874 if (p.parseDOTASTERISK()) break :blk_0 true;2009 if (try p.parseDOTASTERISK()) break :blk_0 true;
1875 p.i = pos_0;2010 p.i = pos_0;
1876 if (p.parseDOT() and p.parseQUESTIONMARK()) break :blk_0 true;2011 if (try p.parseDOT() and try p.parseQUESTIONMARK()) break :blk_0 true;
1877 p.i = pos_0;2012 p.i = pos_0;
1878 if (p.parseFnCallArguments()) break :blk_0 true;2013 if (try p.parseFnCallArguments()) break :blk_0 true;
1879 p.i = pos_0;2014 p.i = pos_0;
1880 break :blk_0 false;2015 break :blk_0 false;
1881 };2016 };
1882 }2017 }
1883 pub fn parseSuffixOpPrefix(p: *Parser) bool {2018 pub fn parseSuffixOpPrefix(p: *Parser) Error!bool {
1884 return blk_0: {2019 return blk_0: {
1885 const pos_0 = p.i;2020 const pos_0 = p.i;
1886 if (p.parseLBRACKET()) break :blk_0 true;2021 if (try p.parseLBRACKET()) break :blk_0 true;
1887 p.i = pos_0;2022 p.i = pos_0;
1888 if (p.parseDOT() and p.parseIDENTIFIER()) break :blk_0 true;2023 if (try p.parseDOT() and try p.parseIDENTIFIER()) break :blk_0 true;
1889 p.i = pos_0;2024 p.i = pos_0;
1890 if (p.parseDOTASTERISK()) break :blk_0 true;2025 if (try p.parseDOTASTERISK()) break :blk_0 true;
1891 p.i = pos_0;2026 p.i = pos_0;
1892 if (p.parseDOT() and p.parseQUESTIONMARK()) break :blk_0 true;2027 if (try p.parseDOT() and try p.parseQUESTIONMARK()) break :blk_0 true;
1893 p.i = pos_0;2028 p.i = pos_0;
1894 if (p.parseLPAREN()) break :blk_0 true;2029 if (try p.parseLPAREN()) break :blk_0 true;
1895 p.i = pos_0;2030 p.i = pos_0;
1896 break :blk_0 false;2031 break :blk_0 false;
1897 };2032 };
1898 }2033 }
1899 pub fn parseFnCallArguments(p: *Parser) bool {2034 pub fn parseFnCallArguments(p: *Parser) Error!bool {
1900 return blk_0: {2035 return blk_0: {
1901 const pos_0 = p.i;2036 const pos_0 = p.i;
1902 if (p.parseLPAREN() and p.parseExprList() and p.parseRPAREN()) break :blk_0 true;2037 if (try p.parseLPAREN() and try p.parseExprList() and try p.parseRPAREN()) break :blk_0 true;
1903 p.i = pos_0;2038 p.i = pos_0;
1904 break :blk_0 false;2039 break :blk_0 false;
1905 };2040 };
1906 }2041 }
1907 pub fn parseSliceTypeStart(p: *Parser) bool {2042 pub fn parseSliceTypeStart(p: *Parser) Error!bool {
1908 return blk_0: {2043 return blk_0: {
1909 const pos_0 = p.i;2044 const pos_0 = p.i;
1910 if (p.parseLBRACKET() and (blk_3: {2045 if (try p.parseLBRACKET() and (blk_3: {
1911 const pos_3 = p.i;2046 const pos_3 = p.i;
1912 if (p.parseCOLON() and p.parseExpr()) break :blk_3 true;2047 if (try p.parseCOLON() and try p.parseExpr()) break :blk_3 true;
1913 p.i = pos_3;2048 p.i = pos_3;
1914 break :blk_3 false;2049 break :blk_3 false;
1915 } or true) and p.parseRBRACKET()) break :blk_0 true;2050 } or true) and try p.parseRBRACKET()) break :blk_0 true;
1916 p.i = pos_0;2051 p.i = pos_0;
1917 break :blk_0 false;2052 break :blk_0 false;
1918 };2053 };
1919 }2054 }
1920 pub fn parseSinglePtrTypeStart(p: *Parser) bool {2055 pub fn parseSinglePtrTypeStart(p: *Parser) Error!bool {
1921 return blk_0: {2056 return blk_0: {
1922 const pos_0 = p.i;2057 const pos_0 = p.i;
1923 if (p.parseASTERISK()) break :blk_0 true;2058 if (try p.parseASTERISK()) break :blk_0 true;
1924 p.i = pos_0;2059 p.i = pos_0;
1925 break :blk_0 false;2060 break :blk_0 false;
1926 };2061 };
1927 }2062 }
1928 pub fn parseManyPtrTypeStart(p: *Parser) bool {2063 pub fn parseManyPtrTypeStart(p: *Parser) Error!bool {
1929 return blk_0: {2064 return blk_0: {
1930 const pos_0 = p.i;2065 const pos_0 = p.i;
1931 if (p.parseLBRACKET() and p.parseASTERISK() and (blk_3: {2066 if (try p.parseLBRACKET() and try p.parseASTERISK() and (blk_3: {
1932 const pos_3 = p.i;2067 const pos_3 = p.i;
1933 if (p.parseLETTERC()) break :blk_3 true;2068 if (try p.parseLETTERC()) break :blk_3 true;
1934 p.i = pos_3;2069 p.i = pos_3;
1935 if (p.parseCOLON() and p.parseExpr()) break :blk_3 true;2070 if (try p.parseCOLON() and try p.parseExpr()) break :blk_3 true;
1936 p.i = pos_3;2071 p.i = pos_3;
1937 break :blk_3 false;2072 break :blk_3 false;
1938 } or true) and p.parseRBRACKET()) break :blk_0 true;2073 } or true) and try p.parseRBRACKET()) break :blk_0 true;
1939 p.i = pos_0;2074 p.i = pos_0;
1940 break :blk_0 false;2075 break :blk_0 false;
1941 };2076 };
1942 }2077 }
1943 pub fn parseArrayTypeStart(p: *Parser) bool {2078 pub fn parseArrayTypeStart(p: *Parser) Error!bool {
1944 return blk_0: {2079 return blk_0: {
1945 const pos_0 = p.i;2080 const pos_0 = p.i;
1946 if (p.parseLBRACKET() and blk_1: {2081 if (try p.parseLBRACKET() and blk_1: {
1947 const pos_1 = p.i;2082 const pos_1 = p.i;
1948 const match_1 = p.parseASTERISK();2083 const match_1 = try p.parseASTERISK();
1949 p.i = pos_1;2084 p.i = pos_1;
1950 break :blk_1 !match_1;2085 break :blk_1 !match_1;
1951 } and p.parseExpr() and (blk_3: {2086 } and try p.parseExpr() and (blk_3: {
1952 const pos_3 = p.i;2087 const pos_3 = p.i;
1953 if (p.parseCOLON() and p.parseExpr()) break :blk_3 true;2088 if (try p.parseCOLON() and try p.parseExpr()) break :blk_3 true;
1954 p.i = pos_3;2089 p.i = pos_3;
1955 break :blk_3 false;2090 break :blk_3 false;
1956 } or true) and p.parseRBRACKET()) break :blk_0 true;2091 } or true) and try p.parseRBRACKET()) break :blk_0 true;
1957 p.i = pos_0;2092 p.i = pos_0;
1958 break :blk_0 false;2093 break :blk_0 false;
1959 };2094 };
1960 }2095 }
1961 pub fn parseContainerTypeAuto(p: *Parser) bool {2096 pub fn parseContainerTypeAuto(p: *Parser) Error!bool {
1962 return blk_0: {2097 return blk_0: {
1963 const pos_0 = p.i;2098 const pos_0 = p.i;
1964 if (p.parseContainerTypeKind() and p.parseLBRACE() and p.parseContainerMembers() and p.parseRBRACE()) break :blk_0 true;2099 if (try p.parseContainerTypeKind() and try p.parseLBRACE() and try p.parseContainerMembers() and try p.parseRBRACE()) break :blk_0 true;
1965 p.i = pos_0;2100 p.i = pos_0;
1966 break :blk_0 false;2101 break :blk_0 false;
1967 };2102 };
1968 }2103 }
1969 pub fn parseContainerTypeKind(p: *Parser) bool {2104 pub fn parseContainerTypeKind(p: *Parser) Error!bool {
1970 return blk_0: {2105 return blk_0: {
1971 const pos_0 = p.i;2106 const pos_0 = p.i;
1972 if (p.parseKEYWORD_struct() and (blk_3: {2107 if (try p.parseKEYWORD_struct() and (blk_3: {
1973 const pos_3 = p.i;2108 const pos_3 = p.i;
1974 if (p.parseLPAREN() and p.parseExpr() and p.parseRPAREN()) break :blk_3 true;2109 if (try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_3 true;
1975 p.i = pos_3;2110 p.i = pos_3;
1976 break :blk_3 false;2111 break :blk_3 false;
1977 } or true)) break :blk_0 true;2112 } or true)) break :blk_0 true;
1978 p.i = pos_0;2113 p.i = pos_0;
1979 if (p.parseKEYWORD_opaque()) break :blk_0 true;2114 if (try p.parseKEYWORD_opaque()) break :blk_0 true;
1980 p.i = pos_0;2115 p.i = pos_0;
1981 if (p.parseKEYWORD_enum() and (blk_3: {2116 if (try p.parseKEYWORD_enum() and (blk_3: {
1982 const pos_3 = p.i;2117 const pos_3 = p.i;
1983 if (p.parseLPAREN() and p.parseExpr() and p.parseRPAREN()) break :blk_3 true;2118 if (try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_3 true;
1984 p.i = pos_3;2119 p.i = pos_3;
1985 break :blk_3 false;2120 break :blk_3 false;
1986 } or true)) break :blk_0 true;2121 } or true)) break :blk_0 true;
1987 p.i = pos_0;2122 p.i = pos_0;
1988 if (p.parseKEYWORD_union() and (blk_3: {2123 if (try p.parseKEYWORD_union() and (blk_3: {
1989 const pos_3 = p.i;2124 const pos_3 = p.i;
1990 if (p.parseLPAREN() and blk_5: {2125 if (try p.parseLPAREN() and blk_5: {
1991 const pos_5 = p.i;2126 const pos_5 = p.i;
1992 if (p.parseKEYWORD_enum() and (blk_8: {2127 if (try p.parseKEYWORD_enum() and (blk_8: {
1993 const pos_8 = p.i;2128 const pos_8 = p.i;
1994 if (p.parseLPAREN() and p.parseExpr() and p.parseRPAREN()) break :blk_8 true;2129 if (try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_8 true;
1995 p.i = pos_8;2130 p.i = pos_8;
1996 break :blk_8 false;2131 break :blk_8 false;
1997 } or true)) break :blk_5 true;2132 } or true)) break :blk_5 true;
1998 p.i = pos_5;2133 p.i = pos_5;
1999 if (p.parseExpr()) break :blk_5 true;2134 if (try p.parseExpr()) break :blk_5 true;
2000 p.i = pos_5;2135 p.i = pos_5;
2001 break :blk_5 false;2136 break :blk_5 false;
2002 } and p.parseRPAREN()) break :blk_3 true;2137 } and try p.parseRPAREN()) break :blk_3 true;
2003 p.i = pos_3;2138 p.i = pos_3;
2004 break :blk_3 false;2139 break :blk_3 false;
2005 } or true)) break :blk_0 true;2140 } or true)) break :blk_0 true;
...@@ -2007,41 +2142,45 @@ const Parser = struct {...@@ -2007,41 +2142,45 @@ const Parser = struct {
2007 break :blk_0 false;2142 break :blk_0 false;
2008 };2143 };
2009 }2144 }
2010 pub fn parseByteAlign(p: *Parser) bool {2145 pub fn parseByteAlign(p: *Parser) Error!bool {
2011 return blk_0: {2146 return blk_0: {
2012 const pos_0 = p.i;2147 const pos_0 = p.i;
2013 if (p.parseKEYWORD_align() and p.parseLPAREN() and p.parseExpr() and p.parseRPAREN()) break :blk_0 true;2148 if (try p.parseKEYWORD_align() and try p.parseLPAREN() and try p.parseExpr() and try p.parseRPAREN()) break :blk_0 true;
2014 p.i = pos_0;2149 p.i = pos_0;
2015 break :blk_0 false;2150 break :blk_0 false;
2016 };2151 };
2017 }2152 }
2018 pub fn parseBitAlign(p: *Parser) bool {2153 pub fn parseBitAlign(p: *Parser) Error!bool {
2019 return blk_0: {2154 return blk_0: {
2020 const pos_0 = p.i;2155 const pos_0 = p.i;
2021 if (p.parseKEYWORD_align() and p.parseLPAREN() and p.parseExpr() and (blk_3: {2156 if (try p.parseKEYWORD_align() and try p.parseLPAREN() and try p.parseExpr() and (blk_3: {
2022 const pos_3 = p.i;2157 const pos_3 = p.i;
2023 if (p.parseCOLON() and p.parseExpr() and p.parseCOLON() and p.parseExpr()) break :blk_3 true;2158 if (try p.parseCOLON() and try p.parseExpr() and try p.parseCOLON() and try p.parseExpr()) break :blk_3 true;
2024 p.i = pos_3;2159 p.i = pos_3;
2025 break :blk_3 false;2160 break :blk_3 false;
2026 } or true) and p.parseRPAREN()) break :blk_0 true;2161 } or true) and try p.parseRPAREN()) break :blk_0 true;
2027 p.i = pos_0;2162 p.i = pos_0;
2028 break :blk_0 false;2163 break :blk_0 false;
2029 };2164 };
2030 }2165 }
2031 pub fn parseIdentifierList(p: *Parser) bool {2166 pub fn parseIdentifierList(p: *Parser) Error!bool {
2032 return blk_0: {2167 return blk_0: {
2033 const pos_0 = p.i;2168 const pos_0 = p.i;
2034 if (blk_1: {2169 if (blk_1: {
2170 var i_1: usize = 0;
2035 while (blk_3: {2171 while (blk_3: {
2036 const pos_3 = p.i;2172 const pos_3 = p.i;
2037 if ((p.parsedoc_comment() or true) and p.parseIDENTIFIER() and p.parseCOMMA()) break :blk_3 true;2173 if ((try p.parsedoc_comment() or true) and try p.parseIDENTIFIER() and try p.parseCOMMA()) break :blk_3 true;
2038 p.i = pos_3;2174 p.i = pos_3;
2039 break :blk_3 false;2175 break :blk_3 false;
2040 }) {}2176 }) {
2177 if (i_1 > max_depth) return error.MaxDepth;
2178 i_1 += 1;
2179 }
2041 break :blk_1 true;2180 break :blk_1 true;
2042 } and (blk_3: {2181 } and (blk_3: {
2043 const pos_3 = p.i;2182 const pos_3 = p.i;
2044 if ((p.parsedoc_comment() or true) and p.parseIDENTIFIER()) break :blk_3 true;2183 if ((try p.parsedoc_comment() or true) and try p.parseIDENTIFIER()) break :blk_3 true;
2045 p.i = pos_3;2184 p.i = pos_3;
2046 break :blk_3 false;2185 break :blk_3 false;
2047 } or true)) break :blk_0 true;2186 } or true)) break :blk_0 true;
...@@ -2049,70 +2188,86 @@ const Parser = struct {...@@ -2049,70 +2188,86 @@ const Parser = struct {
2049 break :blk_0 false;2188 break :blk_0 false;
2050 };2189 };
2051 }2190 }
2052 pub fn parseSwitchProngList(p: *Parser) bool {2191 pub fn parseSwitchProngList(p: *Parser) Error!bool {
2053 return blk_0: {2192 return blk_0: {
2054 const pos_0 = p.i;2193 const pos_0 = p.i;
2055 if (blk_1: {2194 if (blk_1: {
2195 var i_1: usize = 0;
2056 while (blk_3: {2196 while (blk_3: {
2057 const pos_3 = p.i;2197 const pos_3 = p.i;
2058 if (p.parseSwitchProng() and p.parseCOMMA()) break :blk_3 true;2198 if (try p.parseSwitchProng() and try p.parseCOMMA()) break :blk_3 true;
2059 p.i = pos_3;2199 p.i = pos_3;
2060 break :blk_3 false;2200 break :blk_3 false;
2061 }) {}2201 }) {
2202 if (i_1 > max_depth) return error.MaxDepth;
2203 i_1 += 1;
2204 }
2062 break :blk_1 true;2205 break :blk_1 true;
2063 } and (p.parseSwitchProng() or true)) break :blk_0 true;2206 } and (try p.parseSwitchProng() or true)) break :blk_0 true;
2064 p.i = pos_0;2207 p.i = pos_0;
2065 break :blk_0 false;2208 break :blk_0 false;
2066 };2209 };
2067 }2210 }
2068 pub fn parseAsmOutputList(p: *Parser) bool {2211 pub fn parseAsmOutputList(p: *Parser) Error!bool {
2069 return blk_0: {2212 return blk_0: {
2070 const pos_0 = p.i;2213 const pos_0 = p.i;
2071 if (blk_1: {2214 if (blk_1: {
2215 var i_1: usize = 0;
2072 while (blk_3: {2216 while (blk_3: {
2073 const pos_3 = p.i;2217 const pos_3 = p.i;
2074 if (p.parseAsmOutputItem() and p.parseCOMMA()) break :blk_3 true;2218 if (try p.parseAsmOutputItem() and try p.parseCOMMA()) break :blk_3 true;
2075 p.i = pos_3;2219 p.i = pos_3;
2076 break :blk_3 false;2220 break :blk_3 false;
2077 }) {}2221 }) {
2222 if (i_1 > max_depth) return error.MaxDepth;
2223 i_1 += 1;
2224 }
2078 break :blk_1 true;2225 break :blk_1 true;
2079 } and (p.parseAsmOutputItem() or true)) break :blk_0 true;2226 } and (try p.parseAsmOutputItem() or true)) break :blk_0 true;
2080 p.i = pos_0;2227 p.i = pos_0;
2081 break :blk_0 false;2228 break :blk_0 false;
2082 };2229 };
2083 }2230 }
2084 pub fn parseAsmInputList(p: *Parser) bool {2231 pub fn parseAsmInputList(p: *Parser) Error!bool {
2085 return blk_0: {2232 return blk_0: {
2086 const pos_0 = p.i;2233 const pos_0 = p.i;
2087 if (blk_1: {2234 if (blk_1: {
2235 var i_1: usize = 0;
2088 while (blk_3: {2236 while (blk_3: {
2089 const pos_3 = p.i;2237 const pos_3 = p.i;
2090 if (p.parseAsmInputItem() and p.parseCOMMA()) break :blk_3 true;2238 if (try p.parseAsmInputItem() and try p.parseCOMMA()) break :blk_3 true;
2091 p.i = pos_3;2239 p.i = pos_3;
2092 break :blk_3 false;2240 break :blk_3 false;
2093 }) {}2241 }) {
2242 if (i_1 > max_depth) return error.MaxDepth;
2243 i_1 += 1;
2244 }
2094 break :blk_1 true;2245 break :blk_1 true;
2095 } and (p.parseAsmInputItem() or true)) break :blk_0 true;2246 } and (try p.parseAsmInputItem() or true)) break :blk_0 true;
2096 p.i = pos_0;2247 p.i = pos_0;
2097 break :blk_0 false;2248 break :blk_0 false;
2098 };2249 };
2099 }2250 }
2100 pub fn parseParamDeclList(p: *Parser) bool {2251 pub fn parseParamDeclList(p: *Parser) Error!bool {
2101 return blk_0: {2252 return blk_0: {
2102 const pos_0 = p.i;2253 const pos_0 = p.i;
2103 if (blk_1: {2254 if (blk_1: {
2255 var i_1: usize = 0;
2104 while (blk_3: {2256 while (blk_3: {
2105 const pos_3 = p.i;2257 const pos_3 = p.i;
2106 if (p.parseParamDecl() and p.parseCOMMA()) break :blk_3 true;2258 if (try p.parseParamDecl() and try p.parseCOMMA()) break :blk_3 true;
2107 p.i = pos_3;2259 p.i = pos_3;
2108 break :blk_3 false;2260 break :blk_3 false;
2109 }) {}2261 }) {
2262 if (i_1 > max_depth) return error.MaxDepth;
2263 i_1 += 1;
2264 }
2110 break :blk_1 true;2265 break :blk_1 true;
2111 } and (blk_3: {2266 } and (blk_3: {
2112 const pos_3 = p.i;2267 const pos_3 = p.i;
2113 if (p.parseParamDecl()) break :blk_3 true;2268 if (try p.parseParamDecl()) break :blk_3 true;
2114 p.i = pos_3;2269 p.i = pos_3;
2115 if (p.parseDOT3() and (p.parseCOMMA() or true)) break :blk_3 true;2270 if (try p.parseDOT3() and (try p.parseCOMMA() or true)) break :blk_3 true;
2116 p.i = pos_3;2271 p.i = pos_3;
2117 break :blk_3 false;2272 break :blk_3 false;
2118 } or true)) break :blk_0 true;2273 } or true)) break :blk_0 true;
...@@ -2120,24 +2275,28 @@ const Parser = struct {...@@ -2120,24 +2275,28 @@ const Parser = struct {
2120 break :blk_0 false;2275 break :blk_0 false;
2121 };2276 };
2122 }2277 }
2123 pub fn parseExprList(p: *Parser) bool {2278 pub fn parseExprList(p: *Parser) Error!bool {
2124 return blk_0: {2279 return blk_0: {
2125 const pos_0 = p.i;2280 const pos_0 = p.i;
2126 if (blk_1: {2281 if (blk_1: {
2282 var i_1: usize = 0;
2127 while (blk_3: {2283 while (blk_3: {
2128 const pos_3 = p.i;2284 const pos_3 = p.i;
2129 if (p.parseExpr() and p.parseCOMMA()) break :blk_3 true;2285 if (try p.parseExpr() and try p.parseCOMMA()) break :blk_3 true;
2130 p.i = pos_3;2286 p.i = pos_3;
2131 break :blk_3 false;2287 break :blk_3 false;
2132 }) {}2288 }) {
2289 if (i_1 > max_depth) return error.MaxDepth;
2290 i_1 += 1;
2291 }
2133 break :blk_1 true;2292 break :blk_1 true;
2134 } and blk_2: {2293 } and blk_2: {
2135 const pos_2 = p.i;2294 const pos_2 = p.i;
2136 if (p.parseExpr()) break :blk_2 true;2295 if (try p.parseExpr()) break :blk_2 true;
2137 p.i = pos_2;2296 p.i = pos_2;
2138 if (blk_3: {2297 if (blk_3: {
2139 const pos_3 = p.i;2298 const pos_3 = p.i;
2140 const match_3 = p.parseExprPrefix();2299 const match_3 = try p.parseExprPrefix();
2141 p.i = pos_3;2300 p.i = pos_3;
2142 break :blk_3 !match_3;2301 break :blk_3 !match_3;
2143 }) break :blk_2 true;2302 }) break :blk_2 true;
...@@ -2148,15 +2307,15 @@ const Parser = struct {...@@ -2148,15 +2307,15 @@ const Parser = struct {
2148 break :blk_0 false;2307 break :blk_0 false;
2149 };2308 };
2150 }2309 }
2151 pub fn parseExprPrefix(p: *Parser) bool {2310 pub fn parseExprPrefix(p: *Parser) Error!bool {
2152 return blk_0: {2311 return blk_0: {
2153 const pos_0 = p.i;2312 const pos_0 = p.i;
2154 if (p.parseASTERISK()) break :blk_0 true;2313 if (try p.parseASTERISK()) break :blk_0 true;
2155 p.i = pos_0;2314 p.i = pos_0;
2156 break :blk_0 false;2315 break :blk_0 false;
2157 };2316 };
2158 }2317 }
2159 pub fn parsesof(p: *Parser) bool {2318 pub fn parsesof(p: *Parser) Error!bool {
2160 return blk_0: {2319 return blk_0: {
2161 const pos_0 = p.i;2320 const pos_0 = p.i;
2162 if ((p.i == 0)) break :blk_0 true;2321 if ((p.i == 0)) break :blk_0 true;
...@@ -2164,7 +2323,7 @@ const Parser = struct {...@@ -2164,7 +2323,7 @@ const Parser = struct {
2164 break :blk_0 false;2323 break :blk_0 false;
2165 };2324 };
2166 }2325 }
2167 pub fn parseeof(p: *Parser) bool {2326 pub fn parseeof(p: *Parser) Error!bool {
2168 return blk_0: {2327 return blk_0: {
2169 const pos_0 = p.i;2328 const pos_0 = p.i;
2170 if (blk_1: {2329 if (blk_1: {
...@@ -2183,7 +2342,7 @@ const Parser = struct {...@@ -2183,7 +2342,7 @@ const Parser = struct {
2183 break :blk_0 false;2342 break :blk_0 false;
2184 };2343 };
2185 }2344 }
2186 pub fn parseox80_oxBF(p: *Parser) bool {2345 pub fn parseox80_oxBF(p: *Parser) Error!bool {
2187 return blk_0: {2346 return blk_0: {
2188 const pos_0 = p.i;2347 const pos_0 = p.i;
2189 if ((p.i < p.source.len and switch (p.source[p.i]) {2348 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2198,7 +2357,7 @@ const Parser = struct {...@@ -2198,7 +2357,7 @@ const Parser = struct {
2198 break :blk_0 false;2357 break :blk_0 false;
2199 };2358 };
2200 }2359 }
2201 pub fn parseoxF4(p: *Parser) bool {2360 pub fn parseoxF4(p: *Parser) Error!bool {
2202 return blk_0: {2361 return blk_0: {
2203 const pos_0 = p.i;2362 const pos_0 = p.i;
2204 if (blk_1: {2363 if (blk_1: {
...@@ -2212,7 +2371,7 @@ const Parser = struct {...@@ -2212,7 +2371,7 @@ const Parser = struct {
2212 break :blk_0 false;2371 break :blk_0 false;
2213 };2372 };
2214 }2373 }
2215 pub fn parseox80_ox8F(p: *Parser) bool {2374 pub fn parseox80_ox8F(p: *Parser) Error!bool {
2216 return blk_0: {2375 return blk_0: {
2217 const pos_0 = p.i;2376 const pos_0 = p.i;
2218 if ((p.i < p.source.len and switch (p.source[p.i]) {2377 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2227,7 +2386,7 @@ const Parser = struct {...@@ -2227,7 +2386,7 @@ const Parser = struct {
2227 break :blk_0 false;2386 break :blk_0 false;
2228 };2387 };
2229 }2388 }
2230 pub fn parseoxF1_oxF3(p: *Parser) bool {2389 pub fn parseoxF1_oxF3(p: *Parser) Error!bool {
2231 return blk_0: {2390 return blk_0: {
2232 const pos_0 = p.i;2391 const pos_0 = p.i;
2233 if ((p.i < p.source.len and switch (p.source[p.i]) {2392 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2242,7 +2401,7 @@ const Parser = struct {...@@ -2242,7 +2401,7 @@ const Parser = struct {
2242 break :blk_0 false;2401 break :blk_0 false;
2243 };2402 };
2244 }2403 }
2245 pub fn parseoxF0(p: *Parser) bool {2404 pub fn parseoxF0(p: *Parser) Error!bool {
2246 return blk_0: {2405 return blk_0: {
2247 const pos_0 = p.i;2406 const pos_0 = p.i;
2248 if (blk_1: {2407 if (blk_1: {
...@@ -2256,7 +2415,7 @@ const Parser = struct {...@@ -2256,7 +2415,7 @@ const Parser = struct {
2256 break :blk_0 false;2415 break :blk_0 false;
2257 };2416 };
2258 }2417 }
2259 pub fn parseox90_0xBF(p: *Parser) bool {2418 pub fn parseox90_0xBF(p: *Parser) Error!bool {
2260 return blk_0: {2419 return blk_0: {
2261 const pos_0 = p.i;2420 const pos_0 = p.i;
2262 if ((p.i < p.source.len and switch (p.source[p.i]) {2421 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2271,7 +2430,7 @@ const Parser = struct {...@@ -2271,7 +2430,7 @@ const Parser = struct {
2271 break :blk_0 false;2430 break :blk_0 false;
2272 };2431 };
2273 }2432 }
2274 pub fn parseoxEE_oxEF(p: *Parser) bool {2433 pub fn parseoxEE_oxEF(p: *Parser) Error!bool {
2275 return blk_0: {2434 return blk_0: {
2276 const pos_0 = p.i;2435 const pos_0 = p.i;
2277 if ((p.i < p.source.len and switch (p.source[p.i]) {2436 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2286,7 +2445,7 @@ const Parser = struct {...@@ -2286,7 +2445,7 @@ const Parser = struct {
2286 break :blk_0 false;2445 break :blk_0 false;
2287 };2446 };
2288 }2447 }
2289 pub fn parseoxED(p: *Parser) bool {2448 pub fn parseoxED(p: *Parser) Error!bool {
2290 return blk_0: {2449 return blk_0: {
2291 const pos_0 = p.i;2450 const pos_0 = p.i;
2292 if (blk_1: {2451 if (blk_1: {
...@@ -2300,7 +2459,7 @@ const Parser = struct {...@@ -2300,7 +2459,7 @@ const Parser = struct {
2300 break :blk_0 false;2459 break :blk_0 false;
2301 };2460 };
2302 }2461 }
2303 pub fn parseox80_ox9F(p: *Parser) bool {2462 pub fn parseox80_ox9F(p: *Parser) Error!bool {
2304 return blk_0: {2463 return blk_0: {
2305 const pos_0 = p.i;2464 const pos_0 = p.i;
2306 if ((p.i < p.source.len and switch (p.source[p.i]) {2465 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2315,7 +2474,7 @@ const Parser = struct {...@@ -2315,7 +2474,7 @@ const Parser = struct {
2315 break :blk_0 false;2474 break :blk_0 false;
2316 };2475 };
2317 }2476 }
2318 pub fn parseoxE1_oxEC(p: *Parser) bool {2477 pub fn parseoxE1_oxEC(p: *Parser) Error!bool {
2319 return blk_0: {2478 return blk_0: {
2320 const pos_0 = p.i;2479 const pos_0 = p.i;
2321 if ((p.i < p.source.len and switch (p.source[p.i]) {2480 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2330,7 +2489,7 @@ const Parser = struct {...@@ -2330,7 +2489,7 @@ const Parser = struct {
2330 break :blk_0 false;2489 break :blk_0 false;
2331 };2490 };
2332 }2491 }
2333 pub fn parseoxE0(p: *Parser) bool {2492 pub fn parseoxE0(p: *Parser) Error!bool {
2334 return blk_0: {2493 return blk_0: {
2335 const pos_0 = p.i;2494 const pos_0 = p.i;
2336 if (blk_1: {2495 if (blk_1: {
...@@ -2344,7 +2503,7 @@ const Parser = struct {...@@ -2344,7 +2503,7 @@ const Parser = struct {
2344 break :blk_0 false;2503 break :blk_0 false;
2345 };2504 };
2346 }2505 }
2347 pub fn parseoxA0_oxBF(p: *Parser) bool {2506 pub fn parseoxA0_oxBF(p: *Parser) Error!bool {
2348 return blk_0: {2507 return blk_0: {
2349 const pos_0 = p.i;2508 const pos_0 = p.i;
2350 if ((p.i < p.source.len and switch (p.source[p.i]) {2509 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2359,7 +2518,7 @@ const Parser = struct {...@@ -2359,7 +2518,7 @@ const Parser = struct {
2359 break :blk_0 false;2518 break :blk_0 false;
2360 };2519 };
2361 }2520 }
2362 pub fn parseoxC2_oxDF(p: *Parser) bool {2521 pub fn parseoxC2_oxDF(p: *Parser) Error!bool {
2363 return blk_0: {2522 return blk_0: {
2364 const pos_0 = p.i;2523 const pos_0 = p.i;
2365 if ((p.i < p.source.len and switch (p.source[p.i]) {2524 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2374,29 +2533,29 @@ const Parser = struct {...@@ -2374,29 +2533,29 @@ const Parser = struct {
2374 break :blk_0 false;2533 break :blk_0 false;
2375 };2534 };
2376 }2535 }
2377 pub fn parsemultibyte_utf8(p: *Parser) bool {2536 pub fn parsemultibyte_utf8(p: *Parser) Error!bool {
2378 return blk_0: {2537 return blk_0: {
2379 const pos_0 = p.i;2538 const pos_0 = p.i;
2380 if (p.parseoxF4() and p.parseox80_ox8F() and p.parseox80_oxBF() and p.parseox80_oxBF()) break :blk_0 true;2539 if (try p.parseoxF4() and try p.parseox80_ox8F() and try p.parseox80_oxBF() and try p.parseox80_oxBF()) break :blk_0 true;
2381 p.i = pos_0;2540 p.i = pos_0;
2382 if (p.parseoxF1_oxF3() and p.parseox80_oxBF() and p.parseox80_oxBF() and p.parseox80_oxBF()) break :blk_0 true;2541 if (try p.parseoxF1_oxF3() and try p.parseox80_oxBF() and try p.parseox80_oxBF() and try p.parseox80_oxBF()) break :blk_0 true;
2383 p.i = pos_0;2542 p.i = pos_0;
2384 if (p.parseoxF0() and p.parseox90_0xBF() and p.parseox80_oxBF() and p.parseox80_oxBF()) break :blk_0 true;2543 if (try p.parseoxF0() and try p.parseox90_0xBF() and try p.parseox80_oxBF() and try p.parseox80_oxBF()) break :blk_0 true;
2385 p.i = pos_0;2544 p.i = pos_0;
2386 if (p.parseoxEE_oxEF() and p.parseox80_oxBF() and p.parseox80_oxBF()) break :blk_0 true;2545 if (try p.parseoxEE_oxEF() and try p.parseox80_oxBF() and try p.parseox80_oxBF()) break :blk_0 true;
2387 p.i = pos_0;2546 p.i = pos_0;
2388 if (p.parseoxED() and p.parseox80_ox9F() and p.parseox80_oxBF()) break :blk_0 true;2547 if (try p.parseoxED() and try p.parseox80_ox9F() and try p.parseox80_oxBF()) break :blk_0 true;
2389 p.i = pos_0;2548 p.i = pos_0;
2390 if (p.parseoxE1_oxEC() and p.parseox80_oxBF() and p.parseox80_oxBF()) break :blk_0 true;2549 if (try p.parseoxE1_oxEC() and try p.parseox80_oxBF() and try p.parseox80_oxBF()) break :blk_0 true;
2391 p.i = pos_0;2550 p.i = pos_0;
2392 if (p.parseoxE0() and p.parseoxA0_oxBF() and p.parseox80_oxBF()) break :blk_0 true;2551 if (try p.parseoxE0() and try p.parseoxA0_oxBF() and try p.parseox80_oxBF()) break :blk_0 true;
2393 p.i = pos_0;2552 p.i = pos_0;
2394 if (p.parseoxC2_oxDF() and p.parseox80_oxBF()) break :blk_0 true;2553 if (try p.parseoxC2_oxDF() and try p.parseox80_oxBF()) break :blk_0 true;
2395 p.i = pos_0;2554 p.i = pos_0;
2396 break :blk_0 false;2555 break :blk_0 false;
2397 };2556 };
2398 }2557 }
2399 pub fn parsenon_control_ascii(p: *Parser) bool {2558 pub fn parsenon_control_ascii(p: *Parser) Error!bool {
2400 return blk_0: {2559 return blk_0: {
2401 const pos_0 = p.i;2560 const pos_0 = p.i;
2402 if ((p.i < p.source.len and switch (p.source[p.i]) {2561 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2411,7 +2570,7 @@ const Parser = struct {...@@ -2411,7 +2570,7 @@ const Parser = struct {
2411 break :blk_0 false;2570 break :blk_0 false;
2412 };2571 };
2413 }2572 }
2414 pub fn parsenon_control_utf8(p: *Parser) bool {2573 pub fn parsenon_control_utf8(p: *Parser) Error!bool {
2415 return blk_0: {2574 return blk_0: {
2416 const pos_0 = p.i;2575 const pos_0 = p.i;
2417 if ((p.i < p.source.len and switch (p.source[p.i]) {2576 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2427,7 +2586,7 @@ const Parser = struct {...@@ -2427,7 +2586,7 @@ const Parser = struct {
2427 break :blk_0 false;2586 break :blk_0 false;
2428 };2587 };
2429 }2588 }
2430 pub fn parsechar_char(p: *Parser) bool {2589 pub fn parsechar_char(p: *Parser) Error!bool {
2431 return blk_0: {2590 return blk_0: {
2432 const pos_0 = p.i;2591 const pos_0 = p.i;
2433 if (blk_1: {2592 if (blk_1: {
...@@ -2458,12 +2617,12 @@ const Parser = struct {...@@ -2458,12 +2617,12 @@ const Parser = struct {
2458 });2617 });
2459 p.i = pos_1;2618 p.i = pos_1;
2460 break :blk_1 !match_1;2619 break :blk_1 !match_1;
2461 } and p.parsenon_control_utf8()) break :blk_0 true;2620 } and try p.parsenon_control_utf8()) break :blk_0 true;
2462 p.i = pos_0;2621 p.i = pos_0;
2463 break :blk_0 false;2622 break :blk_0 false;
2464 };2623 };
2465 }2624 }
2466 pub fn parsestring_char(p: *Parser) bool {2625 pub fn parsestring_char(p: *Parser) Error!bool {
2467 return blk_0: {2626 return blk_0: {
2468 const pos_0 = p.i;2627 const pos_0 = p.i;
2469 if (blk_1: {2628 if (blk_1: {
...@@ -2494,32 +2653,39 @@ const Parser = struct {...@@ -2494,32 +2653,39 @@ const Parser = struct {
2494 });2653 });
2495 p.i = pos_1;2654 p.i = pos_1;
2496 break :blk_1 !match_1;2655 break :blk_1 !match_1;
2497 } and p.parsenon_control_utf8()) break :blk_0 true;2656 } and try p.parsenon_control_utf8()) break :blk_0 true;
2498 p.i = pos_0;2657 p.i = pos_0;
2499 break :blk_0 false;2658 break :blk_0 false;
2500 };2659 };
2501 }2660 }
2502 pub fn parsecontainer_doc_comment(p: *Parser) bool {2661 pub fn parsecontainer_doc_comment(p: *Parser) Error!bool {
2503 return blk_0: {2662 return blk_0: {
2504 const pos_0 = p.i;2663 const pos_0 = p.i;
2505 if (blk_1: {2664 if (blk_1: {
2506 var match_1 = false;2665 var match_1 = false;
2666 var i_1: usize = 0;
2507 while (blk_3: {2667 while (blk_3: {
2508 const pos_3 = p.i;2668 const pos_3 = p.i;
2509 if (p.parseskip() and blk_4: {2669 if (try p.parseskip() and blk_4: {
2510 if (std.mem.startsWith(u8, p.source[p.i..], "//!")) {2670 if (std.mem.startsWith(u8, p.source[p.i..], "//!")) {
2511 p.i += 3;2671 p.i += 3;
2512 break :blk_4 true;2672 break :blk_4 true;
2513 }2673 }
2514 break :blk_4 false;2674 break :blk_4 false;
2515 } and blk_4: {2675 } and blk_4: {
2516 while (p.parsenon_control_utf8()) {}2676 var i_4: usize = 0;
2677 while (try p.parsenon_control_utf8()) {
2678 if (i_4 > max_depth) return error.MaxDepth;
2679 i_4 += 1;
2680 }
2517 break :blk_4 true;2681 break :blk_4 true;
2518 } and p.parsenewline()) break :blk_3 true;2682 } and try p.parsenewline()) break :blk_3 true;
2519 p.i = pos_3;2683 p.i = pos_3;
2520 break :blk_3 false;2684 break :blk_3 false;
2521 }) {2685 }) {
2522 match_1 = true;2686 match_1 = true;
2687 if (i_1 > max_depth) return error.MaxDepth;
2688 i_1 += 1;
2523 }2689 }
2524 break :blk_1 match_1;2690 break :blk_1 match_1;
2525 }) break :blk_0 true;2691 }) break :blk_0 true;
...@@ -2527,34 +2693,41 @@ const Parser = struct {...@@ -2527,34 +2693,41 @@ const Parser = struct {
2527 break :blk_0 false;2693 break :blk_0 false;
2528 };2694 };
2529 }2695 }
2530 pub fn parsedoc_comment(p: *Parser) bool {2696 pub fn parsedoc_comment(p: *Parser) Error!bool {
2531 return blk_0: {2697 return blk_0: {
2532 const pos_0 = p.i;2698 const pos_0 = p.i;
2533 if (blk_2: {2699 if (blk_2: {
2534 const pos_2 = p.i;2700 const pos_2 = p.i;
2535 if (p.parsesof()) break :blk_2 true;2701 if (try p.parsesof()) break :blk_2 true;
2536 p.i = pos_2;2702 p.i = pos_2;
2537 if (p.parseskip_require_newline()) break :blk_2 true;2703 if (try p.parseskip_require_newline()) break :blk_2 true;
2538 p.i = pos_2;2704 p.i = pos_2;
2539 break :blk_2 false;2705 break :blk_2 false;
2540 } and blk_1: {2706 } and blk_1: {
2541 var match_1 = false;2707 var match_1 = false;
2708 var i_1: usize = 0;
2542 while (blk_3: {2709 while (blk_3: {
2543 const pos_3 = p.i;2710 const pos_3 = p.i;
2544 if (p.parseskip() and blk_4: {2711 if (try p.parseskip() and blk_4: {
2545 if (std.mem.startsWith(u8, p.source[p.i..], "///")) {2712 if (std.mem.startsWith(u8, p.source[p.i..], "///")) {
2546 p.i += 3;2713 p.i += 3;
2547 break :blk_4 true;2714 break :blk_4 true;
2548 }2715 }
2549 break :blk_4 false;2716 break :blk_4 false;
2550 } and blk_4: {2717 } and blk_4: {
2551 while (p.parsenon_control_utf8()) {}2718 var i_4: usize = 0;
2719 while (try p.parsenon_control_utf8()) {
2720 if (i_4 > max_depth) return error.MaxDepth;
2721 i_4 += 1;
2722 }
2552 break :blk_4 true;2723 break :blk_4 true;
2553 } and p.parsenewline()) break :blk_3 true;2724 } and try p.parsenewline()) break :blk_3 true;
2554 p.i = pos_3;2725 p.i = pos_3;
2555 break :blk_3 false;2726 break :blk_3 false;
2556 }) {2727 }) {
2557 match_1 = true;2728 match_1 = true;
2729 if (i_1 > max_depth) return error.MaxDepth;
2730 i_1 += 1;
2558 }2731 }
2559 break :blk_1 match_1;2732 break :blk_1 match_1;
2560 }) break :blk_0 true;2733 }) break :blk_0 true;
...@@ -2562,7 +2735,7 @@ const Parser = struct {...@@ -2562,7 +2735,7 @@ const Parser = struct {
2562 break :blk_0 false;2735 break :blk_0 false;
2563 };2736 };
2564 }2737 }
2565 pub fn parseline_comment(p: *Parser) bool {2738 pub fn parseline_comment(p: *Parser) Error!bool {
2566 return blk_0: {2739 return blk_0: {
2567 const pos_0 = p.i;2740 const pos_0 = p.i;
2568 if (blk_1: {2741 if (blk_1: {
...@@ -2585,9 +2758,13 @@ const Parser = struct {...@@ -2585,9 +2758,13 @@ const Parser = struct {
2585 p.i = pos_1;2758 p.i = pos_1;
2586 break :blk_1 !match_1;2759 break :blk_1 !match_1;
2587 } and blk_1: {2760 } and blk_1: {
2588 while (p.parsenon_control_utf8()) {}2761 var i_1: usize = 0;
2762 while (try p.parsenon_control_utf8()) {
2763 if (i_1 > max_depth) return error.MaxDepth;
2764 i_1 += 1;
2765 }
2589 break :blk_1 true;2766 break :blk_1 true;
2590 } and p.parsenewline()) break :blk_0 true;2767 } and try p.parsenewline()) break :blk_0 true;
2591 p.i = pos_0;2768 p.i = pos_0;
2592 if (blk_1: {2769 if (blk_1: {
2593 if (std.mem.startsWith(u8, p.source[p.i..], "////")) {2770 if (std.mem.startsWith(u8, p.source[p.i..], "////")) {
...@@ -2596,14 +2773,18 @@ const Parser = struct {...@@ -2596,14 +2773,18 @@ const Parser = struct {
2596 }2773 }
2597 break :blk_1 false;2774 break :blk_1 false;
2598 } and blk_1: {2775 } and blk_1: {
2599 while (p.parsenon_control_utf8()) {}2776 var i_1: usize = 0;
2777 while (try p.parsenon_control_utf8()) {
2778 if (i_1 > max_depth) return error.MaxDepth;
2779 i_1 += 1;
2780 }
2600 break :blk_1 true;2781 break :blk_1 true;
2601 } and p.parsenewline()) break :blk_0 true;2782 } and try p.parsenewline()) break :blk_0 true;
2602 p.i = pos_0;2783 p.i = pos_0;
2603 break :blk_0 false;2784 break :blk_0 false;
2604 };2785 };
2605 }2786 }
2606 pub fn parseline_string(p: *Parser) bool {2787 pub fn parseline_string(p: *Parser) Error!bool {
2607 return blk_0: {2788 return blk_0: {
2608 const pos_0 = p.i;2789 const pos_0 = p.i;
2609 if (blk_1: {2790 if (blk_1: {
...@@ -2613,14 +2794,18 @@ const Parser = struct {...@@ -2613,14 +2794,18 @@ const Parser = struct {
2613 }2794 }
2614 break :blk_1 false;2795 break :blk_1 false;
2615 } and blk_1: {2796 } and blk_1: {
2616 while (p.parsenon_control_utf8()) {}2797 var i_1: usize = 0;
2798 while (try p.parsenon_control_utf8()) {
2799 if (i_1 > max_depth) return error.MaxDepth;
2800 i_1 += 1;
2801 }
2617 break :blk_1 true;2802 break :blk_1 true;
2618 } and p.parsenewline()) break :blk_0 true;2803 } and try p.parsenewline()) break :blk_0 true;
2619 p.i = pos_0;2804 p.i = pos_0;
2620 break :blk_0 false;2805 break :blk_0 false;
2621 };2806 };
2622 }2807 }
2623 pub fn parsenewline(p: *Parser) bool {2808 pub fn parsenewline(p: *Parser) Error!bool {
2624 return blk_0: {2809 return blk_0: {
2625 const pos_0 = p.i;2810 const pos_0 = p.i;
2626 if (blk_1: {2811 if (blk_1: {
...@@ -2643,7 +2828,7 @@ const Parser = struct {...@@ -2643,7 +2828,7 @@ const Parser = struct {
2643 break :blk_4 false;2828 break :blk_4 false;
2644 }) break :blk_3 true;2829 }) break :blk_3 true;
2645 p.i = pos_3;2830 p.i = pos_3;
2646 if (p.parseeof()) break :blk_3 true;2831 if (try p.parseeof()) break :blk_3 true;
2647 p.i = pos_3;2832 p.i = pos_3;
2648 break :blk_3 false;2833 break :blk_3 false;
2649 };2834 };
...@@ -2654,10 +2839,11 @@ const Parser = struct {...@@ -2654,10 +2839,11 @@ const Parser = struct {
2654 break :blk_0 false;2839 break :blk_0 false;
2655 };2840 };
2656 }2841 }
2657 pub fn parseskip(p: *Parser) bool {2842 pub fn parseskip(p: *Parser) Error!bool {
2658 return blk_0: {2843 return blk_0: {
2659 const pos_0 = p.i;2844 const pos_0 = p.i;
2660 if (blk_1: {2845 if (blk_1: {
2846 var i_1: usize = 0;
2661 while (blk_3: {2847 while (blk_3: {
2662 const pos_3 = p.i;2848 const pos_3 = p.i;
2663 if ((p.i < p.source.len and switch (p.source[p.i]) {2849 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2672,20 +2858,24 @@ const Parser = struct {...@@ -2672,20 +2858,24 @@ const Parser = struct {
2672 else => false,2858 else => false,
2673 })) break :blk_3 true;2859 })) break :blk_3 true;
2674 p.i = pos_3;2860 p.i = pos_3;
2675 if (p.parseline_comment()) break :blk_3 true;2861 if (try p.parseline_comment()) break :blk_3 true;
2676 p.i = pos_3;2862 p.i = pos_3;
2677 break :blk_3 false;2863 break :blk_3 false;
2678 }) {}2864 }) {
2865 if (i_1 > max_depth) return error.MaxDepth;
2866 i_1 += 1;
2867 }
2679 break :blk_1 true;2868 break :blk_1 true;
2680 }) break :blk_0 true;2869 }) break :blk_0 true;
2681 p.i = pos_0;2870 p.i = pos_0;
2682 break :blk_0 false;2871 break :blk_0 false;
2683 };2872 };
2684 }2873 }
2685 pub fn parseskip_require_newline(p: *Parser) bool {2874 pub fn parseskip_require_newline(p: *Parser) Error!bool {
2686 return blk_0: {2875 return blk_0: {
2687 const pos_0 = p.i;2876 const pos_0 = p.i;
2688 if (blk_1: {2877 if (blk_1: {
2878 var i_1: usize = 0;
2689 while ((p.i < p.source.len and switch (p.source[p.i]) {2879 while ((p.i < p.source.len and switch (p.source[p.i]) {
2690 ' '...' ',2880 ' '...' ',
2691 '\t'...'\t',2881 '\t'...'\t',
...@@ -2695,7 +2885,10 @@ const Parser = struct {...@@ -2695,7 +2885,10 @@ const Parser = struct {
2695 break :blk_2 true;2885 break :blk_2 true;
2696 },2886 },
2697 else => false,2887 else => false,
2698 })) {}2888 })) {
2889 if (i_1 > max_depth) return error.MaxDepth;
2890 i_1 += 1;
2891 }
2699 break :blk_1 true;2892 break :blk_1 true;
2700 } and blk_2: {2893 } and blk_2: {
2701 const pos_2 = p.i;2894 const pos_2 = p.i;
...@@ -2708,19 +2901,20 @@ const Parser = struct {...@@ -2708,19 +2901,20 @@ const Parser = struct {
2708 else => false,2901 else => false,
2709 })) break :blk_2 true;2902 })) break :blk_2 true;
2710 p.i = pos_2;2903 p.i = pos_2;
2711 if (p.parseline_comment()) break :blk_2 true;2904 if (try p.parseline_comment()) break :blk_2 true;
2712 p.i = pos_2;2905 p.i = pos_2;
2713 break :blk_2 false;2906 break :blk_2 false;
2714 } and p.parseskip()) break :blk_0 true;2907 } and try p.parseskip()) break :blk_0 true;
2715 p.i = pos_0;2908 p.i = pos_0;
2716 break :blk_0 false;2909 break :blk_0 false;
2717 };2910 };
2718 }2911 }
2719 pub fn parsepre_op_white(p: *Parser) bool {2912 pub fn parsepre_op_white(p: *Parser) Error!bool {
2720 return blk_0: {2913 return blk_0: {
2721 const pos_0 = p.i;2914 const pos_0 = p.i;
2722 if (blk_1: {2915 if (blk_1: {
2723 var match_1 = false;2916 var match_1 = false;
2917 var i_1: usize = 0;
2724 while (blk_3: {2918 while (blk_3: {
2725 const pos_3 = p.i;2919 const pos_3 = p.i;
2726 if ((p.i < p.source.len and switch (p.source[p.i]) {2920 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2735,11 +2929,13 @@ const Parser = struct {...@@ -2735,11 +2929,13 @@ const Parser = struct {
2735 else => false,2929 else => false,
2736 })) break :blk_3 true;2930 })) break :blk_3 true;
2737 p.i = pos_3;2931 p.i = pos_3;
2738 if (p.parseline_comment()) break :blk_3 true;2932 if (try p.parseline_comment()) break :blk_3 true;
2739 p.i = pos_3;2933 p.i = pos_3;
2740 break :blk_3 false;2934 break :blk_3 false;
2741 }) {2935 }) {
2742 match_1 = true;2936 match_1 = true;
2937 if (i_1 > max_depth) return error.MaxDepth;
2938 i_1 += 1;
2743 }2939 }
2744 break :blk_1 match_1;2940 break :blk_1 match_1;
2745 }) break :blk_0 true;2941 }) break :blk_0 true;
...@@ -2747,7 +2943,7 @@ const Parser = struct {...@@ -2747,7 +2943,7 @@ const Parser = struct {
2747 break :blk_0 false;2943 break :blk_0 false;
2748 };2944 };
2749 }2945 }
2750 pub fn parsepost_op_white(p: *Parser) bool {2946 pub fn parsepost_op_white(p: *Parser) Error!bool {
2751 return blk_0: {2947 return blk_0: {
2752 const pos_0 = p.i;2948 const pos_0 = p.i;
2753 if ((p.i < p.source.len and switch (p.source[p.i]) {2949 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2760,15 +2956,15 @@ const Parser = struct {...@@ -2760,15 +2956,15 @@ const Parser = struct {
2760 break :blk_1 true;2956 break :blk_1 true;
2761 },2957 },
2762 else => false,2958 else => false,
2763 }) and p.parseskip()) break :blk_0 true;2959 }) and try p.parseskip()) break :blk_0 true;
2764 p.i = pos_0;2960 p.i = pos_0;
2765 break :blk_0 false;2961 break :blk_0 false;
2766 };2962 };
2767 }2963 }
2768 pub fn parseCHAR_LITERAL(p: *Parser) bool {2964 pub fn parseCHAR_LITERAL(p: *Parser) Error!bool {
2769 return blk_0: {2965 return blk_0: {
2770 const pos_0 = p.i;2966 const pos_0 = p.i;
2771 if (p.parseskip() and (p.i < p.source.len and switch (p.source[p.i]) {2967 if (try p.parseskip() and (p.i < p.source.len and switch (p.source[p.i]) {
2772 '\''...'\'',2968 '\''...'\'',
2773 => blk_1: {2969 => blk_1: {
2774 p.i += 1;2970 p.i += 1;
...@@ -2776,7 +2972,11 @@ const Parser = struct {...@@ -2776,7 +2972,11 @@ const Parser = struct {
2776 },2972 },
2777 else => false,2973 else => false,
2778 }) and blk_1: {2974 }) and blk_1: {
2779 while (p.parsechar_char()) {}2975 var i_1: usize = 0;
2976 while (try p.parsechar_char()) {
2977 if (i_1 > max_depth) return error.MaxDepth;
2978 i_1 += 1;
2979 }
2780 break :blk_1 true;2980 break :blk_1 true;
2781 } and (p.i < p.source.len and switch (p.source[p.i]) {2981 } and (p.i < p.source.len and switch (p.source[p.i]) {
2782 '\''...'\'',2982 '\''...'\'',
...@@ -2790,7 +2990,7 @@ const Parser = struct {...@@ -2790,7 +2990,7 @@ const Parser = struct {
2790 break :blk_0 false;2990 break :blk_0 false;
2791 };2991 };
2792 }2992 }
2793 pub fn parsedigit(p: *Parser) bool {2993 pub fn parsedigit(p: *Parser) Error!bool {
2794 return blk_0: {2994 return blk_0: {
2795 const pos_0 = p.i;2995 const pos_0 = p.i;
2796 if ((p.i < p.source.len and switch (p.source[p.i]) {2996 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2812,10 +3012,10 @@ const Parser = struct {...@@ -2812,10 +3012,10 @@ const Parser = struct {
2812 break :blk_0 false;3012 break :blk_0 false;
2813 };3013 };
2814 }3014 }
2815 pub fn parsedigit_int(p: *Parser) bool {3015 pub fn parsedigit_int(p: *Parser) Error!bool {
2816 return blk_0: {3016 return blk_0: {
2817 const pos_0 = p.i;3017 const pos_0 = p.i;
2818 if (p.parsedigit()) break :blk_0 true;3018 if (try p.parsedigit()) break :blk_0 true;
2819 p.i = pos_0;3019 p.i = pos_0;
2820 if ((p.i < p.source.len and switch (p.source[p.i]) {3020 if ((p.i < p.source.len and switch (p.source[p.i]) {
2821 'e'...'e',3021 'e'...'e',
...@@ -2832,10 +3032,10 @@ const Parser = struct {...@@ -2832,10 +3032,10 @@ const Parser = struct {
2832 break :blk_0 false;3032 break :blk_0 false;
2833 };3033 };
2834 }3034 }
2835 pub fn parsedigit_float(p: *Parser) bool {3035 pub fn parsedigit_float(p: *Parser) Error!bool {
2836 return blk_0: {3036 return blk_0: {
2837 const pos_0 = p.i;3037 const pos_0 = p.i;
2838 if (p.parsedigit()) break :blk_0 true;3038 if (try p.parsedigit()) break :blk_0 true;
2839 p.i = pos_0;3039 p.i = pos_0;
2840 if ((p.i < p.source.len and switch (p.source[p.i]) {3040 if ((p.i < p.source.len and switch (p.source[p.i]) {
2841 'e'...'e',3041 'e'...'e',
...@@ -2860,10 +3060,10 @@ const Parser = struct {...@@ -2860,10 +3060,10 @@ const Parser = struct {
2860 break :blk_0 false;3060 break :blk_0 false;
2861 };3061 };
2862 }3062 }
2863 pub fn parseNUMBERLITERAL(p: *Parser) bool {3063 pub fn parseNUMBERLITERAL(p: *Parser) Error!bool {
2864 return blk_0: {3064 return blk_0: {
2865 const pos_0 = p.i;3065 const pos_0 = p.i;
2866 if (p.parseskip() and (p.i < p.source.len and switch (p.source[p.i]) {3066 if (try p.parseskip() and (p.i < p.source.len and switch (p.source[p.i]) {
2867 '0'...'9',3067 '0'...'9',
2868 => blk_1: {3068 => blk_1: {
2869 p.i += 1;3069 p.i += 1;
...@@ -2871,7 +3071,11 @@ const Parser = struct {...@@ -2871,7 +3071,11 @@ const Parser = struct {
2871 },3071 },
2872 else => false,3072 else => false,
2873 }) and blk_1: {3073 }) and blk_1: {
2874 while (p.parsedigit_int()) {}3074 var i_1: usize = 0;
3075 while (try p.parsedigit_int()) {
3076 if (i_1 > max_depth) return error.MaxDepth;
3077 i_1 += 1;
3078 }
2875 break :blk_1 true;3079 break :blk_1 true;
2876 } and blk_1: {3080 } and blk_1: {
2877 if (std.mem.startsWith(u8, p.source[p.i..], ".")) {3081 if (std.mem.startsWith(u8, p.source[p.i..], ".")) {
...@@ -2881,13 +3085,16 @@ const Parser = struct {...@@ -2881,13 +3085,16 @@ const Parser = struct {
2881 break :blk_1 false;3085 break :blk_1 false;
2882 } and blk_1: {3086 } and blk_1: {
2883 var match_1 = false;3087 var match_1 = false;
2884 while (p.parsedigit_float()) {3088 var i_1: usize = 0;
3089 while (try p.parsedigit_float()) {
2885 match_1 = true;3090 match_1 = true;
3091 if (i_1 > max_depth) return error.MaxDepth;
3092 i_1 += 1;
2886 }3093 }
2887 break :blk_1 match_1;3094 break :blk_1 match_1;
2888 }) break :blk_0 true;3095 }) break :blk_0 true;
2889 p.i = pos_0;3096 p.i = pos_0;
2890 if (p.parseskip() and (p.i < p.source.len and switch (p.source[p.i]) {3097 if (try p.parseskip() and (p.i < p.source.len and switch (p.source[p.i]) {
2891 '0'...'9',3098 '0'...'9',
2892 => blk_1: {3099 => blk_1: {
2893 p.i += 1;3100 p.i += 1;
...@@ -2895,14 +3102,18 @@ const Parser = struct {...@@ -2895,14 +3102,18 @@ const Parser = struct {
2895 },3102 },
2896 else => false,3103 else => false,
2897 }) and blk_1: {3104 }) and blk_1: {
2898 while (p.parsedigit_float()) {}3105 var i_1: usize = 0;
3106 while (try p.parsedigit_float()) {
3107 if (i_1 > max_depth) return error.MaxDepth;
3108 i_1 += 1;
3109 }
2899 break :blk_1 true;3110 break :blk_1 true;
2900 }) break :blk_0 true;3111 }) break :blk_0 true;
2901 p.i = pos_0;3112 p.i = pos_0;
2902 break :blk_0 false;3113 break :blk_0 false;
2903 };3114 };
2904 }3115 }
2905 pub fn parsestring(p: *Parser) bool {3116 pub fn parsestring(p: *Parser) Error!bool {
2906 return blk_0: {3117 return blk_0: {
2907 const pos_0 = p.i;3118 const pos_0 = p.i;
2908 if ((p.i < p.source.len and switch (p.source[p.i]) {3119 if ((p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2913,7 +3124,11 @@ const Parser = struct {...@@ -2913,7 +3124,11 @@ const Parser = struct {
2913 },3124 },
2914 else => false,3125 else => false,
2915 }) and blk_1: {3126 }) and blk_1: {
2916 while (p.parsestring_char()) {}3127 var i_1: usize = 0;
3128 while (try p.parsestring_char()) {
3129 if (i_1 > max_depth) return error.MaxDepth;
3130 i_1 += 1;
3131 }
2917 break :blk_1 true;3132 break :blk_1 true;
2918 } and (p.i < p.source.len and switch (p.source[p.i]) {3133 } and (p.i < p.source.len and switch (p.source[p.i]) {
2919 '"'...'"',3134 '"'...'"',
...@@ -2927,28 +3142,31 @@ const Parser = struct {...@@ -2927,28 +3142,31 @@ const Parser = struct {
2927 break :blk_0 false;3142 break :blk_0 false;
2928 };3143 };
2929 }3144 }
2930 pub fn parseSTRINGLITERALSINGLE(p: *Parser) bool {3145 pub fn parseSTRINGLITERALSINGLE(p: *Parser) Error!bool {
2931 return blk_0: {3146 return blk_0: {
2932 const pos_0 = p.i;3147 const pos_0 = p.i;
2933 if (p.parseskip() and p.parsestring()) break :blk_0 true;3148 if (try p.parseskip() and try p.parsestring()) break :blk_0 true;
2934 p.i = pos_0;3149 p.i = pos_0;
2935 break :blk_0 false;3150 break :blk_0 false;
2936 };3151 };
2937 }3152 }
2938 pub fn parseSTRINGLITERAL(p: *Parser) bool {3153 pub fn parseSTRINGLITERAL(p: *Parser) Error!bool {
2939 return blk_0: {3154 return blk_0: {
2940 const pos_0 = p.i;3155 const pos_0 = p.i;
2941 if (p.parseskip() and p.parsestring()) break :blk_0 true;3156 if (try p.parseskip() and try p.parsestring()) break :blk_0 true;
2942 p.i = pos_0;3157 p.i = pos_0;
2943 if (blk_1: {3158 if (blk_1: {
2944 var match_1 = false;3159 var match_1 = false;
3160 var i_1: usize = 0;
2945 while (blk_3: {3161 while (blk_3: {
2946 const pos_3 = p.i;3162 const pos_3 = p.i;
2947 if (p.parseskip() and p.parseline_string()) break :blk_3 true;3163 if (try p.parseskip() and try p.parseline_string()) break :blk_3 true;
2948 p.i = pos_3;3164 p.i = pos_3;
2949 break :blk_3 false;3165 break :blk_3 false;
2950 }) {3166 }) {
2951 match_1 = true;3167 match_1 = true;
3168 if (i_1 > max_depth) return error.MaxDepth;
3169 i_1 += 1;
2952 }3170 }
2953 break :blk_1 match_1;3171 break :blk_1 match_1;
2954 }) break :blk_0 true;3172 }) break :blk_0 true;
...@@ -2956,12 +3174,12 @@ const Parser = struct {...@@ -2956,12 +3174,12 @@ const Parser = struct {
2956 break :blk_0 false;3174 break :blk_0 false;
2957 };3175 };
2958 }3176 }
2959 pub fn parseIDENTIFIER(p: *Parser) bool {3177 pub fn parseIDENTIFIER(p: *Parser) Error!bool {
2960 return blk_0: {3178 return blk_0: {
2961 const pos_0 = p.i;3179 const pos_0 = p.i;
2962 if (p.parseskip() and blk_1: {3180 if (try p.parseskip() and blk_1: {
2963 const pos_1 = p.i;3181 const pos_1 = p.i;
2964 const match_1 = p.parsekeyword();3182 const match_1 = try p.parsekeyword();
2965 p.i = pos_1;3183 p.i = pos_1;
2966 break :blk_1 !match_1;3184 break :blk_1 !match_1;
2967 } and (p.i < p.source.len and switch (p.source[p.i]) {3185 } and (p.i < p.source.len and switch (p.source[p.i]) {
...@@ -2974,6 +3192,7 @@ const Parser = struct {...@@ -2974,6 +3192,7 @@ const Parser = struct {
2974 },3192 },
2975 else => false,3193 else => false,
2976 }) and blk_1: {3194 }) and blk_1: {
3195 var i_1: usize = 0;
2977 while ((p.i < p.source.len and switch (p.source[p.i]) {3196 while ((p.i < p.source.len and switch (p.source[p.i]) {
2978 'A'...'Z',3197 'A'...'Z',
2979 'a'...'z',3198 'a'...'z',
...@@ -2984,25 +3203,28 @@ const Parser = struct {...@@ -2984,25 +3203,28 @@ const Parser = struct {
2984 break :blk_2 true;3203 break :blk_2 true;
2985 },3204 },
2986 else => false,3205 else => false,
2987 })) {}3206 })) {
3207 if (i_1 > max_depth) return error.MaxDepth;
3208 i_1 += 1;
3209 }
2988 break :blk_1 true;3210 break :blk_1 true;
2989 }) break :blk_0 true;3211 }) break :blk_0 true;
2990 p.i = pos_0;3212 p.i = pos_0;
2991 if (p.parseskip() and blk_1: {3213 if (try p.parseskip() and blk_1: {
2992 if (std.mem.startsWith(u8, p.source[p.i..], "@")) {3214 if (std.mem.startsWith(u8, p.source[p.i..], "@")) {
2993 p.i += 1;3215 p.i += 1;
2994 break :blk_1 true;3216 break :blk_1 true;
2995 }3217 }
2996 break :blk_1 false;3218 break :blk_1 false;
2997 } and p.parsestring()) break :blk_0 true;3219 } and try p.parsestring()) break :blk_0 true;
2998 p.i = pos_0;3220 p.i = pos_0;
2999 break :blk_0 false;3221 break :blk_0 false;
3000 };3222 };
3001 }3223 }
3002 pub fn parseBUILTINIDENTIFIER(p: *Parser) bool {3224 pub fn parseBUILTINIDENTIFIER(p: *Parser) Error!bool {
3003 return blk_0: {3225 return blk_0: {
3004 const pos_0 = p.i;3226 const pos_0 = p.i;
3005 if (p.parseskip() and blk_1: {3227 if (try p.parseskip() and blk_1: {
3006 if (std.mem.startsWith(u8, p.source[p.i..], "@")) {3228 if (std.mem.startsWith(u8, p.source[p.i..], "@")) {
3007 p.i += 1;3229 p.i += 1;
3008 break :blk_1 true;3230 break :blk_1 true;
...@@ -3018,6 +3240,7 @@ const Parser = struct {...@@ -3018,6 +3240,7 @@ const Parser = struct {
3018 },3240 },
3019 else => false,3241 else => false,
3020 }) and blk_1: {3242 }) and blk_1: {
3243 var i_1: usize = 0;
3021 while ((p.i < p.source.len and switch (p.source[p.i]) {3244 while ((p.i < p.source.len and switch (p.source[p.i]) {
3022 'A'...'Z',3245 'A'...'Z',
3023 'a'...'z',3246 'a'...'z',
...@@ -3028,17 +3251,20 @@ const Parser = struct {...@@ -3028,17 +3251,20 @@ const Parser = struct {
3028 break :blk_2 true;3251 break :blk_2 true;
3029 },3252 },
3030 else => false,3253 else => false,
3031 })) {}3254 })) {
3255 if (i_1 > max_depth) return error.MaxDepth;
3256 i_1 += 1;
3257 }
3032 break :blk_1 true;3258 break :blk_1 true;
3033 }) break :blk_0 true;3259 }) break :blk_0 true;
3034 p.i = pos_0;3260 p.i = pos_0;
3035 break :blk_0 false;3261 break :blk_0 false;
3036 };3262 };
3037 }3263 }
3038 pub fn parseAMPERSAND(p: *Parser) bool {3264 pub fn parseAMPERSAND(p: *Parser) Error!bool {
3039 return blk_0: {3265 return blk_0: {
3040 const pos_0 = p.i;3266 const pos_0 = p.i;
3041 if (p.parseskip() and blk_1: {3267 if (try p.parseskip() and blk_1: {
3042 if (std.mem.startsWith(u8, p.source[p.i..], "&")) {3268 if (std.mem.startsWith(u8, p.source[p.i..], "&")) {
3043 p.i += 1;3269 p.i += 1;
3044 break :blk_1 true;3270 break :blk_1 true;
...@@ -3061,10 +3287,10 @@ const Parser = struct {...@@ -3061,10 +3287,10 @@ const Parser = struct {
3061 break :blk_0 false;3287 break :blk_0 false;
3062 };3288 };
3063 }3289 }
3064 pub fn parseAMPERSANDEQUAL(p: *Parser) bool {3290 pub fn parseAMPERSANDEQUAL(p: *Parser) Error!bool {
3065 return blk_0: {3291 return blk_0: {
3066 const pos_0 = p.i;3292 const pos_0 = p.i;
3067 if (p.parseskip() and blk_1: {3293 if (try p.parseskip() and blk_1: {
3068 if (std.mem.startsWith(u8, p.source[p.i..], "&=")) {3294 if (std.mem.startsWith(u8, p.source[p.i..], "&=")) {
3069 p.i += 2;3295 p.i += 2;
3070 break :blk_1 true;3296 break :blk_1 true;
...@@ -3075,10 +3301,10 @@ const Parser = struct {...@@ -3075,10 +3301,10 @@ const Parser = struct {
3075 break :blk_0 false;3301 break :blk_0 false;
3076 };3302 };
3077 }3303 }
3078 pub fn parseASTERISK(p: *Parser) bool {3304 pub fn parseASTERISK(p: *Parser) Error!bool {
3079 return blk_0: {3305 return blk_0: {
3080 const pos_0 = p.i;3306 const pos_0 = p.i;
3081 if (p.parseskip() and blk_1: {3307 if (try p.parseskip() and blk_1: {
3082 if (std.mem.startsWith(u8, p.source[p.i..], "*")) {3308 if (std.mem.startsWith(u8, p.source[p.i..], "*")) {
3083 p.i += 1;3309 p.i += 1;
3084 break :blk_1 true;3310 break :blk_1 true;
...@@ -3103,10 +3329,10 @@ const Parser = struct {...@@ -3103,10 +3329,10 @@ const Parser = struct {
3103 break :blk_0 false;3329 break :blk_0 false;
3104 };3330 };
3105 }3331 }
3106 pub fn parseASTERISKEQUAL(p: *Parser) bool {3332 pub fn parseASTERISKEQUAL(p: *Parser) Error!bool {
3107 return blk_0: {3333 return blk_0: {
3108 const pos_0 = p.i;3334 const pos_0 = p.i;
3109 if (p.parseskip() and blk_1: {3335 if (try p.parseskip() and blk_1: {
3110 if (std.mem.startsWith(u8, p.source[p.i..], "*=")) {3336 if (std.mem.startsWith(u8, p.source[p.i..], "*=")) {
3111 p.i += 2;3337 p.i += 2;
3112 break :blk_1 true;3338 break :blk_1 true;
...@@ -3117,10 +3343,10 @@ const Parser = struct {...@@ -3117,10 +3343,10 @@ const Parser = struct {
3117 break :blk_0 false;3343 break :blk_0 false;
3118 };3344 };
3119 }3345 }
3120 pub fn parseASTERISKPERCENT(p: *Parser) bool {3346 pub fn parseASTERISKPERCENT(p: *Parser) Error!bool {
3121 return blk_0: {3347 return blk_0: {
3122 const pos_0 = p.i;3348 const pos_0 = p.i;
3123 if (p.parseskip() and blk_1: {3349 if (try p.parseskip() and blk_1: {
3124 if (std.mem.startsWith(u8, p.source[p.i..], "*%")) {3350 if (std.mem.startsWith(u8, p.source[p.i..], "*%")) {
3125 p.i += 2;3351 p.i += 2;
3126 break :blk_1 true;3352 break :blk_1 true;
...@@ -3143,10 +3369,10 @@ const Parser = struct {...@@ -3143,10 +3369,10 @@ const Parser = struct {
3143 break :blk_0 false;3369 break :blk_0 false;
3144 };3370 };
3145 }3371 }
3146 pub fn parseASTERISKPERCENTEQUAL(p: *Parser) bool {3372 pub fn parseASTERISKPERCENTEQUAL(p: *Parser) Error!bool {
3147 return blk_0: {3373 return blk_0: {
3148 const pos_0 = p.i;3374 const pos_0 = p.i;
3149 if (p.parseskip() and blk_1: {3375 if (try p.parseskip() and blk_1: {
3150 if (std.mem.startsWith(u8, p.source[p.i..], "*%=")) {3376 if (std.mem.startsWith(u8, p.source[p.i..], "*%=")) {
3151 p.i += 3;3377 p.i += 3;
3152 break :blk_1 true;3378 break :blk_1 true;
...@@ -3157,10 +3383,10 @@ const Parser = struct {...@@ -3157,10 +3383,10 @@ const Parser = struct {
3157 break :blk_0 false;3383 break :blk_0 false;
3158 };3384 };
3159 }3385 }
3160 pub fn parseASTERISKPIPE(p: *Parser) bool {3386 pub fn parseASTERISKPIPE(p: *Parser) Error!bool {
3161 return blk_0: {3387 return blk_0: {
3162 const pos_0 = p.i;3388 const pos_0 = p.i;
3163 if (p.parseskip() and blk_1: {3389 if (try p.parseskip() and blk_1: {
3164 if (std.mem.startsWith(u8, p.source[p.i..], "*|")) {3390 if (std.mem.startsWith(u8, p.source[p.i..], "*|")) {
3165 p.i += 2;3391 p.i += 2;
3166 break :blk_1 true;3392 break :blk_1 true;
...@@ -3183,10 +3409,10 @@ const Parser = struct {...@@ -3183,10 +3409,10 @@ const Parser = struct {
3183 break :blk_0 false;3409 break :blk_0 false;
3184 };3410 };
3185 }3411 }
3186 pub fn parseASTERISKPIPEEQUAL(p: *Parser) bool {3412 pub fn parseASTERISKPIPEEQUAL(p: *Parser) Error!bool {
3187 return blk_0: {3413 return blk_0: {
3188 const pos_0 = p.i;3414 const pos_0 = p.i;
3189 if (p.parseskip() and blk_1: {3415 if (try p.parseskip() and blk_1: {
3190 if (std.mem.startsWith(u8, p.source[p.i..], "*|=")) {3416 if (std.mem.startsWith(u8, p.source[p.i..], "*|=")) {
3191 p.i += 3;3417 p.i += 3;
3192 break :blk_1 true;3418 break :blk_1 true;
...@@ -3197,10 +3423,10 @@ const Parser = struct {...@@ -3197,10 +3423,10 @@ const Parser = struct {
3197 break :blk_0 false;3423 break :blk_0 false;
3198 };3424 };
3199 }3425 }
3200 pub fn parseCARET(p: *Parser) bool {3426 pub fn parseCARET(p: *Parser) Error!bool {
3201 return blk_0: {3427 return blk_0: {
3202 const pos_0 = p.i;3428 const pos_0 = p.i;
3203 if (p.parseskip() and blk_1: {3429 if (try p.parseskip() and blk_1: {
3204 if (std.mem.startsWith(u8, p.source[p.i..], "^")) {3430 if (std.mem.startsWith(u8, p.source[p.i..], "^")) {
3205 p.i += 1;3431 p.i += 1;
3206 break :blk_1 true;3432 break :blk_1 true;
...@@ -3223,10 +3449,10 @@ const Parser = struct {...@@ -3223,10 +3449,10 @@ const Parser = struct {
3223 break :blk_0 false;3449 break :blk_0 false;
3224 };3450 };
3225 }3451 }
3226 pub fn parseCARETEQUAL(p: *Parser) bool {3452 pub fn parseCARETEQUAL(p: *Parser) Error!bool {
3227 return blk_0: {3453 return blk_0: {
3228 const pos_0 = p.i;3454 const pos_0 = p.i;
3229 if (p.parseskip() and blk_1: {3455 if (try p.parseskip() and blk_1: {
3230 if (std.mem.startsWith(u8, p.source[p.i..], "^=")) {3456 if (std.mem.startsWith(u8, p.source[p.i..], "^=")) {
3231 p.i += 2;3457 p.i += 2;
3232 break :blk_1 true;3458 break :blk_1 true;
...@@ -3237,10 +3463,10 @@ const Parser = struct {...@@ -3237,10 +3463,10 @@ const Parser = struct {
3237 break :blk_0 false;3463 break :blk_0 false;
3238 };3464 };
3239 }3465 }
3240 pub fn parseCOLON(p: *Parser) bool {3466 pub fn parseCOLON(p: *Parser) Error!bool {
3241 return blk_0: {3467 return blk_0: {
3242 const pos_0 = p.i;3468 const pos_0 = p.i;
3243 if (p.parseskip() and blk_1: {3469 if (try p.parseskip() and blk_1: {
3244 if (std.mem.startsWith(u8, p.source[p.i..], ":")) {3470 if (std.mem.startsWith(u8, p.source[p.i..], ":")) {
3245 p.i += 1;3471 p.i += 1;
3246 break :blk_1 true;3472 break :blk_1 true;
...@@ -3251,10 +3477,10 @@ const Parser = struct {...@@ -3251,10 +3477,10 @@ const Parser = struct {
3251 break :blk_0 false;3477 break :blk_0 false;
3252 };3478 };
3253 }3479 }
3254 pub fn parseCOMMA(p: *Parser) bool {3480 pub fn parseCOMMA(p: *Parser) Error!bool {
3255 return blk_0: {3481 return blk_0: {
3256 const pos_0 = p.i;3482 const pos_0 = p.i;
3257 if (p.parseskip() and blk_1: {3483 if (try p.parseskip() and blk_1: {
3258 if (std.mem.startsWith(u8, p.source[p.i..], ",")) {3484 if (std.mem.startsWith(u8, p.source[p.i..], ",")) {
3259 p.i += 1;3485 p.i += 1;
3260 break :blk_1 true;3486 break :blk_1 true;
...@@ -3265,10 +3491,10 @@ const Parser = struct {...@@ -3265,10 +3491,10 @@ const Parser = struct {
3265 break :blk_0 false;3491 break :blk_0 false;
3266 };3492 };
3267 }3493 }
3268 pub fn parseDOT(p: *Parser) bool {3494 pub fn parseDOT(p: *Parser) Error!bool {
3269 return blk_0: {3495 return blk_0: {
3270 const pos_0 = p.i;3496 const pos_0 = p.i;
3271 if (p.parseskip() and blk_1: {3497 if (try p.parseskip() and blk_1: {
3272 if (std.mem.startsWith(u8, p.source[p.i..], ".")) {3498 if (std.mem.startsWith(u8, p.source[p.i..], ".")) {
3273 p.i += 1;3499 p.i += 1;
3274 break :blk_1 true;3500 break :blk_1 true;
...@@ -3292,10 +3518,10 @@ const Parser = struct {...@@ -3292,10 +3518,10 @@ const Parser = struct {
3292 break :blk_0 false;3518 break :blk_0 false;
3293 };3519 };
3294 }3520 }
3295 pub fn parseDOT2(p: *Parser) bool {3521 pub fn parseDOT2(p: *Parser) Error!bool {
3296 return blk_0: {3522 return blk_0: {
3297 const pos_0 = p.i;3523 const pos_0 = p.i;
3298 if (p.parseskip() and blk_1: {3524 if (try p.parseskip() and blk_1: {
3299 if (std.mem.startsWith(u8, p.source[p.i..], "..")) {3525 if (std.mem.startsWith(u8, p.source[p.i..], "..")) {
3300 p.i += 2;3526 p.i += 2;
3301 break :blk_1 true;3527 break :blk_1 true;
...@@ -3318,10 +3544,10 @@ const Parser = struct {...@@ -3318,10 +3544,10 @@ const Parser = struct {
3318 break :blk_0 false;3544 break :blk_0 false;
3319 };3545 };
3320 }3546 }
3321 pub fn parseDOT3(p: *Parser) bool {3547 pub fn parseDOT3(p: *Parser) Error!bool {
3322 return blk_0: {3548 return blk_0: {
3323 const pos_0 = p.i;3549 const pos_0 = p.i;
3324 if (p.parseskip() and blk_1: {3550 if (try p.parseskip() and blk_1: {
3325 if (std.mem.startsWith(u8, p.source[p.i..], "...")) {3551 if (std.mem.startsWith(u8, p.source[p.i..], "...")) {
3326 p.i += 3;3552 p.i += 3;
3327 break :blk_1 true;3553 break :blk_1 true;
...@@ -3332,10 +3558,10 @@ const Parser = struct {...@@ -3332,10 +3558,10 @@ const Parser = struct {
3332 break :blk_0 false;3558 break :blk_0 false;
3333 };3559 };
3334 }3560 }
3335 pub fn parseDOTASTERISK(p: *Parser) bool {3561 pub fn parseDOTASTERISK(p: *Parser) Error!bool {
3336 return blk_0: {3562 return blk_0: {
3337 const pos_0 = p.i;3563 const pos_0 = p.i;
3338 if (p.parseskip() and blk_1: {3564 if (try p.parseskip() and blk_1: {
3339 if (std.mem.startsWith(u8, p.source[p.i..], ".*")) {3565 if (std.mem.startsWith(u8, p.source[p.i..], ".*")) {
3340 p.i += 2;3566 p.i += 2;
3341 break :blk_1 true;3567 break :blk_1 true;
...@@ -3346,10 +3572,10 @@ const Parser = struct {...@@ -3346,10 +3572,10 @@ const Parser = struct {
3346 break :blk_0 false;3572 break :blk_0 false;
3347 };3573 };
3348 }3574 }
3349 pub fn parseEQUAL(p: *Parser) bool {3575 pub fn parseEQUAL(p: *Parser) Error!bool {
3350 return blk_0: {3576 return blk_0: {
3351 const pos_0 = p.i;3577 const pos_0 = p.i;
3352 if (p.parseskip() and blk_1: {3578 if (try p.parseskip() and blk_1: {
3353 if (std.mem.startsWith(u8, p.source[p.i..], "=")) {3579 if (std.mem.startsWith(u8, p.source[p.i..], "=")) {
3354 p.i += 1;3580 p.i += 1;
3355 break :blk_1 true;3581 break :blk_1 true;
...@@ -3373,10 +3599,10 @@ const Parser = struct {...@@ -3373,10 +3599,10 @@ const Parser = struct {
3373 break :blk_0 false;3599 break :blk_0 false;
3374 };3600 };
3375 }3601 }
3376 pub fn parseEQUALEQUAL(p: *Parser) bool {3602 pub fn parseEQUALEQUAL(p: *Parser) Error!bool {
3377 return blk_0: {3603 return blk_0: {
3378 const pos_0 = p.i;3604 const pos_0 = p.i;
3379 if (p.parseskip() and blk_1: {3605 if (try p.parseskip() and blk_1: {
3380 if (std.mem.startsWith(u8, p.source[p.i..], "==")) {3606 if (std.mem.startsWith(u8, p.source[p.i..], "==")) {
3381 p.i += 2;3607 p.i += 2;
3382 break :blk_1 true;3608 break :blk_1 true;
...@@ -3387,10 +3613,10 @@ const Parser = struct {...@@ -3387,10 +3613,10 @@ const Parser = struct {
3387 break :blk_0 false;3613 break :blk_0 false;
3388 };3614 };
3389 }3615 }
3390 pub fn parseEQUALRARROW(p: *Parser) bool {3616 pub fn parseEQUALRARROW(p: *Parser) Error!bool {
3391 return blk_0: {3617 return blk_0: {
3392 const pos_0 = p.i;3618 const pos_0 = p.i;
3393 if (p.parseskip() and blk_1: {3619 if (try p.parseskip() and blk_1: {
3394 if (std.mem.startsWith(u8, p.source[p.i..], "=>")) {3620 if (std.mem.startsWith(u8, p.source[p.i..], "=>")) {
3395 p.i += 2;3621 p.i += 2;
3396 break :blk_1 true;3622 break :blk_1 true;
...@@ -3401,10 +3627,10 @@ const Parser = struct {...@@ -3401,10 +3627,10 @@ const Parser = struct {
3401 break :blk_0 false;3627 break :blk_0 false;
3402 };3628 };
3403 }3629 }
3404 pub fn parseEXCLAMATIONMARK(p: *Parser) bool {3630 pub fn parseEXCLAMATIONMARK(p: *Parser) Error!bool {
3405 return blk_0: {3631 return blk_0: {
3406 const pos_0 = p.i;3632 const pos_0 = p.i;
3407 if (p.parseskip() and blk_1: {3633 if (try p.parseskip() and blk_1: {
3408 if (std.mem.startsWith(u8, p.source[p.i..], "!")) {3634 if (std.mem.startsWith(u8, p.source[p.i..], "!")) {
3409 p.i += 1;3635 p.i += 1;
3410 break :blk_1 true;3636 break :blk_1 true;
...@@ -3427,10 +3653,10 @@ const Parser = struct {...@@ -3427,10 +3653,10 @@ const Parser = struct {
3427 break :blk_0 false;3653 break :blk_0 false;
3428 };3654 };
3429 }3655 }
3430 pub fn parseEXCLAMATIONMARKEQUAL(p: *Parser) bool {3656 pub fn parseEXCLAMATIONMARKEQUAL(p: *Parser) Error!bool {
3431 return blk_0: {3657 return blk_0: {
3432 const pos_0 = p.i;3658 const pos_0 = p.i;
3433 if (p.parseskip() and blk_1: {3659 if (try p.parseskip() and blk_1: {
3434 if (std.mem.startsWith(u8, p.source[p.i..], "!=")) {3660 if (std.mem.startsWith(u8, p.source[p.i..], "!=")) {
3435 p.i += 2;3661 p.i += 2;
3436 break :blk_1 true;3662 break :blk_1 true;
...@@ -3441,10 +3667,10 @@ const Parser = struct {...@@ -3441,10 +3667,10 @@ const Parser = struct {
3441 break :blk_0 false;3667 break :blk_0 false;
3442 };3668 };
3443 }3669 }
3444 pub fn parseLARROW(p: *Parser) bool {3670 pub fn parseLARROW(p: *Parser) Error!bool {
3445 return blk_0: {3671 return blk_0: {
3446 const pos_0 = p.i;3672 const pos_0 = p.i;
3447 if (p.parseskip() and blk_1: {3673 if (try p.parseskip() and blk_1: {
3448 if (std.mem.startsWith(u8, p.source[p.i..], "<")) {3674 if (std.mem.startsWith(u8, p.source[p.i..], "<")) {
3449 p.i += 1;3675 p.i += 1;
3450 break :blk_1 true;3676 break :blk_1 true;
...@@ -3468,10 +3694,10 @@ const Parser = struct {...@@ -3468,10 +3694,10 @@ const Parser = struct {
3468 break :blk_0 false;3694 break :blk_0 false;
3469 };3695 };
3470 }3696 }
3471 pub fn parseLARROW2(p: *Parser) bool {3697 pub fn parseLARROW2(p: *Parser) Error!bool {
3472 return blk_0: {3698 return blk_0: {
3473 const pos_0 = p.i;3699 const pos_0 = p.i;
3474 if (p.parseskip() and blk_1: {3700 if (try p.parseskip() and blk_1: {
3475 if (std.mem.startsWith(u8, p.source[p.i..], "<<")) {3701 if (std.mem.startsWith(u8, p.source[p.i..], "<<")) {
3476 p.i += 2;3702 p.i += 2;
3477 break :blk_1 true;3703 break :blk_1 true;
...@@ -3495,10 +3721,10 @@ const Parser = struct {...@@ -3495,10 +3721,10 @@ const Parser = struct {
3495 break :blk_0 false;3721 break :blk_0 false;
3496 };3722 };
3497 }3723 }
3498 pub fn parseLARROW2EQUAL(p: *Parser) bool {3724 pub fn parseLARROW2EQUAL(p: *Parser) Error!bool {
3499 return blk_0: {3725 return blk_0: {
3500 const pos_0 = p.i;3726 const pos_0 = p.i;
3501 if (p.parseskip() and blk_1: {3727 if (try p.parseskip() and blk_1: {
3502 if (std.mem.startsWith(u8, p.source[p.i..], "<<=")) {3728 if (std.mem.startsWith(u8, p.source[p.i..], "<<=")) {
3503 p.i += 3;3729 p.i += 3;
3504 break :blk_1 true;3730 break :blk_1 true;
...@@ -3509,10 +3735,10 @@ const Parser = struct {...@@ -3509,10 +3735,10 @@ const Parser = struct {
3509 break :blk_0 false;3735 break :blk_0 false;
3510 };3736 };
3511 }3737 }
3512 pub fn parseLARROW2PIPE(p: *Parser) bool {3738 pub fn parseLARROW2PIPE(p: *Parser) Error!bool {
3513 return blk_0: {3739 return blk_0: {
3514 const pos_0 = p.i;3740 const pos_0 = p.i;
3515 if (p.parseskip() and blk_1: {3741 if (try p.parseskip() and blk_1: {
3516 if (std.mem.startsWith(u8, p.source[p.i..], "<<|")) {3742 if (std.mem.startsWith(u8, p.source[p.i..], "<<|")) {
3517 p.i += 3;3743 p.i += 3;
3518 break :blk_1 true;3744 break :blk_1 true;
...@@ -3535,10 +3761,10 @@ const Parser = struct {...@@ -3535,10 +3761,10 @@ const Parser = struct {
3535 break :blk_0 false;3761 break :blk_0 false;
3536 };3762 };
3537 }3763 }
3538 pub fn parseLARROW2PIPEEQUAL(p: *Parser) bool {3764 pub fn parseLARROW2PIPEEQUAL(p: *Parser) Error!bool {
3539 return blk_0: {3765 return blk_0: {
3540 const pos_0 = p.i;3766 const pos_0 = p.i;
3541 if (p.parseskip() and blk_1: {3767 if (try p.parseskip() and blk_1: {
3542 if (std.mem.startsWith(u8, p.source[p.i..], "<<|=")) {3768 if (std.mem.startsWith(u8, p.source[p.i..], "<<|=")) {
3543 p.i += 4;3769 p.i += 4;
3544 break :blk_1 true;3770 break :blk_1 true;
...@@ -3549,10 +3775,10 @@ const Parser = struct {...@@ -3549,10 +3775,10 @@ const Parser = struct {
3549 break :blk_0 false;3775 break :blk_0 false;
3550 };3776 };
3551 }3777 }
3552 pub fn parseLARROWEQUAL(p: *Parser) bool {3778 pub fn parseLARROWEQUAL(p: *Parser) Error!bool {
3553 return blk_0: {3779 return blk_0: {
3554 const pos_0 = p.i;3780 const pos_0 = p.i;
3555 if (p.parseskip() and blk_1: {3781 if (try p.parseskip() and blk_1: {
3556 if (std.mem.startsWith(u8, p.source[p.i..], "<=")) {3782 if (std.mem.startsWith(u8, p.source[p.i..], "<=")) {
3557 p.i += 2;3783 p.i += 2;
3558 break :blk_1 true;3784 break :blk_1 true;
...@@ -3563,10 +3789,10 @@ const Parser = struct {...@@ -3563,10 +3789,10 @@ const Parser = struct {
3563 break :blk_0 false;3789 break :blk_0 false;
3564 };3790 };
3565 }3791 }
3566 pub fn parseLBRACE(p: *Parser) bool {3792 pub fn parseLBRACE(p: *Parser) Error!bool {
3567 return blk_0: {3793 return blk_0: {
3568 const pos_0 = p.i;3794 const pos_0 = p.i;
3569 if (p.parseskip() and blk_1: {3795 if (try p.parseskip() and blk_1: {
3570 if (std.mem.startsWith(u8, p.source[p.i..], "{")) {3796 if (std.mem.startsWith(u8, p.source[p.i..], "{")) {
3571 p.i += 1;3797 p.i += 1;
3572 break :blk_1 true;3798 break :blk_1 true;
...@@ -3577,10 +3803,10 @@ const Parser = struct {...@@ -3577,10 +3803,10 @@ const Parser = struct {
3577 break :blk_0 false;3803 break :blk_0 false;
3578 };3804 };
3579 }3805 }
3580 pub fn parseLBRACKET(p: *Parser) bool {3806 pub fn parseLBRACKET(p: *Parser) Error!bool {
3581 return blk_0: {3807 return blk_0: {
3582 const pos_0 = p.i;3808 const pos_0 = p.i;
3583 if (p.parseskip() and blk_1: {3809 if (try p.parseskip() and blk_1: {
3584 if (std.mem.startsWith(u8, p.source[p.i..], "[")) {3810 if (std.mem.startsWith(u8, p.source[p.i..], "[")) {
3585 p.i += 1;3811 p.i += 1;
3586 break :blk_1 true;3812 break :blk_1 true;
...@@ -3591,10 +3817,10 @@ const Parser = struct {...@@ -3591,10 +3817,10 @@ const Parser = struct {
3591 break :blk_0 false;3817 break :blk_0 false;
3592 };3818 };
3593 }3819 }
3594 pub fn parseLPAREN(p: *Parser) bool {3820 pub fn parseLPAREN(p: *Parser) Error!bool {
3595 return blk_0: {3821 return blk_0: {
3596 const pos_0 = p.i;3822 const pos_0 = p.i;
3597 if (p.parseskip() and blk_1: {3823 if (try p.parseskip() and blk_1: {
3598 if (std.mem.startsWith(u8, p.source[p.i..], "(")) {3824 if (std.mem.startsWith(u8, p.source[p.i..], "(")) {
3599 p.i += 1;3825 p.i += 1;
3600 break :blk_1 true;3826 break :blk_1 true;
...@@ -3605,10 +3831,10 @@ const Parser = struct {...@@ -3605,10 +3831,10 @@ const Parser = struct {
3605 break :blk_0 false;3831 break :blk_0 false;
3606 };3832 };
3607 }3833 }
3608 pub fn parseMINUS(p: *Parser) bool {3834 pub fn parseMINUS(p: *Parser) Error!bool {
3609 return blk_0: {3835 return blk_0: {
3610 const pos_0 = p.i;3836 const pos_0 = p.i;
3611 if (p.parseskip() and blk_1: {3837 if (try p.parseskip() and blk_1: {
3612 if (std.mem.startsWith(u8, p.source[p.i..], "-")) {3838 if (std.mem.startsWith(u8, p.source[p.i..], "-")) {
3613 p.i += 1;3839 p.i += 1;
3614 break :blk_1 true;3840 break :blk_1 true;
...@@ -3634,10 +3860,10 @@ const Parser = struct {...@@ -3634,10 +3860,10 @@ const Parser = struct {
3634 break :blk_0 false;3860 break :blk_0 false;
3635 };3861 };
3636 }3862 }
3637 pub fn parseMINUSEQUAL(p: *Parser) bool {3863 pub fn parseMINUSEQUAL(p: *Parser) Error!bool {
3638 return blk_0: {3864 return blk_0: {
3639 const pos_0 = p.i;3865 const pos_0 = p.i;
3640 if (p.parseskip() and blk_1: {3866 if (try p.parseskip() and blk_1: {
3641 if (std.mem.startsWith(u8, p.source[p.i..], "-=")) {3867 if (std.mem.startsWith(u8, p.source[p.i..], "-=")) {
3642 p.i += 2;3868 p.i += 2;
3643 break :blk_1 true;3869 break :blk_1 true;
...@@ -3648,10 +3874,10 @@ const Parser = struct {...@@ -3648,10 +3874,10 @@ const Parser = struct {
3648 break :blk_0 false;3874 break :blk_0 false;
3649 };3875 };
3650 }3876 }
3651 pub fn parseMINUSPERCENT(p: *Parser) bool {3877 pub fn parseMINUSPERCENT(p: *Parser) Error!bool {
3652 return blk_0: {3878 return blk_0: {
3653 const pos_0 = p.i;3879 const pos_0 = p.i;
3654 if (p.parseskip() and blk_1: {3880 if (try p.parseskip() and blk_1: {
3655 if (std.mem.startsWith(u8, p.source[p.i..], "-%")) {3881 if (std.mem.startsWith(u8, p.source[p.i..], "-%")) {
3656 p.i += 2;3882 p.i += 2;
3657 break :blk_1 true;3883 break :blk_1 true;
...@@ -3674,10 +3900,10 @@ const Parser = struct {...@@ -3674,10 +3900,10 @@ const Parser = struct {
3674 break :blk_0 false;3900 break :blk_0 false;
3675 };3901 };
3676 }3902 }
3677 pub fn parseMINUSPERCENTEQUAL(p: *Parser) bool {3903 pub fn parseMINUSPERCENTEQUAL(p: *Parser) Error!bool {
3678 return blk_0: {3904 return blk_0: {
3679 const pos_0 = p.i;3905 const pos_0 = p.i;
3680 if (p.parseskip() and blk_1: {3906 if (try p.parseskip() and blk_1: {
3681 if (std.mem.startsWith(u8, p.source[p.i..], "-%=")) {3907 if (std.mem.startsWith(u8, p.source[p.i..], "-%=")) {
3682 p.i += 3;3908 p.i += 3;
3683 break :blk_1 true;3909 break :blk_1 true;
...@@ -3688,10 +3914,10 @@ const Parser = struct {...@@ -3688,10 +3914,10 @@ const Parser = struct {
3688 break :blk_0 false;3914 break :blk_0 false;
3689 };3915 };
3690 }3916 }
3691 pub fn parseMINUSPIPE(p: *Parser) bool {3917 pub fn parseMINUSPIPE(p: *Parser) Error!bool {
3692 return blk_0: {3918 return blk_0: {
3693 const pos_0 = p.i;3919 const pos_0 = p.i;
3694 if (p.parseskip() and blk_1: {3920 if (try p.parseskip() and blk_1: {
3695 if (std.mem.startsWith(u8, p.source[p.i..], "-|")) {3921 if (std.mem.startsWith(u8, p.source[p.i..], "-|")) {
3696 p.i += 2;3922 p.i += 2;
3697 break :blk_1 true;3923 break :blk_1 true;
...@@ -3714,10 +3940,10 @@ const Parser = struct {...@@ -3714,10 +3940,10 @@ const Parser = struct {
3714 break :blk_0 false;3940 break :blk_0 false;
3715 };3941 };
3716 }3942 }
3717 pub fn parseMINUSPIPEEQUAL(p: *Parser) bool {3943 pub fn parseMINUSPIPEEQUAL(p: *Parser) Error!bool {
3718 return blk_0: {3944 return blk_0: {
3719 const pos_0 = p.i;3945 const pos_0 = p.i;
3720 if (p.parseskip() and blk_1: {3946 if (try p.parseskip() and blk_1: {
3721 if (std.mem.startsWith(u8, p.source[p.i..], "-|=")) {3947 if (std.mem.startsWith(u8, p.source[p.i..], "-|=")) {
3722 p.i += 3;3948 p.i += 3;
3723 break :blk_1 true;3949 break :blk_1 true;
...@@ -3728,10 +3954,10 @@ const Parser = struct {...@@ -3728,10 +3954,10 @@ const Parser = struct {
3728 break :blk_0 false;3954 break :blk_0 false;
3729 };3955 };
3730 }3956 }
3731 pub fn parseMINUSRARROW(p: *Parser) bool {3957 pub fn parseMINUSRARROW(p: *Parser) Error!bool {
3732 return blk_0: {3958 return blk_0: {
3733 const pos_0 = p.i;3959 const pos_0 = p.i;
3734 if (p.parseskip() and blk_1: {3960 if (try p.parseskip() and blk_1: {
3735 if (std.mem.startsWith(u8, p.source[p.i..], "->")) {3961 if (std.mem.startsWith(u8, p.source[p.i..], "->")) {
3736 p.i += 2;3962 p.i += 2;
3737 break :blk_1 true;3963 break :blk_1 true;
...@@ -3742,10 +3968,10 @@ const Parser = struct {...@@ -3742,10 +3968,10 @@ const Parser = struct {
3742 break :blk_0 false;3968 break :blk_0 false;
3743 };3969 };
3744 }3970 }
3745 pub fn parsePERCENT(p: *Parser) bool {3971 pub fn parsePERCENT(p: *Parser) Error!bool {
3746 return blk_0: {3972 return blk_0: {
3747 const pos_0 = p.i;3973 const pos_0 = p.i;
3748 if (p.parseskip() and blk_1: {3974 if (try p.parseskip() and blk_1: {
3749 if (std.mem.startsWith(u8, p.source[p.i..], "%")) {3975 if (std.mem.startsWith(u8, p.source[p.i..], "%")) {
3750 p.i += 1;3976 p.i += 1;
3751 break :blk_1 true;3977 break :blk_1 true;
...@@ -3768,10 +3994,10 @@ const Parser = struct {...@@ -3768,10 +3994,10 @@ const Parser = struct {
3768 break :blk_0 false;3994 break :blk_0 false;
3769 };3995 };
3770 }3996 }
3771 pub fn parsePERCENTEQUAL(p: *Parser) bool {3997 pub fn parsePERCENTEQUAL(p: *Parser) Error!bool {
3772 return blk_0: {3998 return blk_0: {
3773 const pos_0 = p.i;3999 const pos_0 = p.i;
3774 if (p.parseskip() and blk_1: {4000 if (try p.parseskip() and blk_1: {
3775 if (std.mem.startsWith(u8, p.source[p.i..], "%=")) {4001 if (std.mem.startsWith(u8, p.source[p.i..], "%=")) {
3776 p.i += 2;4002 p.i += 2;
3777 break :blk_1 true;4003 break :blk_1 true;
...@@ -3782,10 +4008,10 @@ const Parser = struct {...@@ -3782,10 +4008,10 @@ const Parser = struct {
3782 break :blk_0 false;4008 break :blk_0 false;
3783 };4009 };
3784 }4010 }
3785 pub fn parsePIPE(p: *Parser) bool {4011 pub fn parsePIPE(p: *Parser) Error!bool {
3786 return blk_0: {4012 return blk_0: {
3787 const pos_0 = p.i;4013 const pos_0 = p.i;
3788 if (p.parseskip() and blk_1: {4014 if (try p.parseskip() and blk_1: {
3789 if (std.mem.startsWith(u8, p.source[p.i..], "|")) {4015 if (std.mem.startsWith(u8, p.source[p.i..], "|")) {
3790 p.i += 1;4016 p.i += 1;
3791 break :blk_1 true;4017 break :blk_1 true;
...@@ -3809,10 +4035,10 @@ const Parser = struct {...@@ -3809,10 +4035,10 @@ const Parser = struct {
3809 break :blk_0 false;4035 break :blk_0 false;
3810 };4036 };
3811 }4037 }
3812 pub fn parsePIPE2(p: *Parser) bool {4038 pub fn parsePIPE2(p: *Parser) Error!bool {
3813 return blk_0: {4039 return blk_0: {
3814 const pos_0 = p.i;4040 const pos_0 = p.i;
3815 if (p.parseskip() and blk_1: {4041 if (try p.parseskip() and blk_1: {
3816 if (std.mem.startsWith(u8, p.source[p.i..], "||")) {4042 if (std.mem.startsWith(u8, p.source[p.i..], "||")) {
3817 p.i += 2;4043 p.i += 2;
3818 break :blk_1 true;4044 break :blk_1 true;
...@@ -3823,10 +4049,10 @@ const Parser = struct {...@@ -3823,10 +4049,10 @@ const Parser = struct {
3823 break :blk_0 false;4049 break :blk_0 false;
3824 };4050 };
3825 }4051 }
3826 pub fn parsePIPEEQUAL(p: *Parser) bool {4052 pub fn parsePIPEEQUAL(p: *Parser) Error!bool {
3827 return blk_0: {4053 return blk_0: {
3828 const pos_0 = p.i;4054 const pos_0 = p.i;
3829 if (p.parseskip() and blk_1: {4055 if (try p.parseskip() and blk_1: {
3830 if (std.mem.startsWith(u8, p.source[p.i..], "|=")) {4056 if (std.mem.startsWith(u8, p.source[p.i..], "|=")) {
3831 p.i += 2;4057 p.i += 2;
3832 break :blk_1 true;4058 break :blk_1 true;
...@@ -3837,10 +4063,10 @@ const Parser = struct {...@@ -3837,10 +4063,10 @@ const Parser = struct {
3837 break :blk_0 false;4063 break :blk_0 false;
3838 };4064 };
3839 }4065 }
3840 pub fn parsePLUS(p: *Parser) bool {4066 pub fn parsePLUS(p: *Parser) Error!bool {
3841 return blk_0: {4067 return blk_0: {
3842 const pos_0 = p.i;4068 const pos_0 = p.i;
3843 if (p.parseskip() and blk_1: {4069 if (try p.parseskip() and blk_1: {
3844 if (std.mem.startsWith(u8, p.source[p.i..], "+")) {4070 if (std.mem.startsWith(u8, p.source[p.i..], "+")) {
3845 p.i += 1;4071 p.i += 1;
3846 break :blk_1 true;4072 break :blk_1 true;
...@@ -3866,10 +4092,10 @@ const Parser = struct {...@@ -3866,10 +4092,10 @@ const Parser = struct {
3866 break :blk_0 false;4092 break :blk_0 false;
3867 };4093 };
3868 }4094 }
3869 pub fn parsePLUS2(p: *Parser) bool {4095 pub fn parsePLUS2(p: *Parser) Error!bool {
3870 return blk_0: {4096 return blk_0: {
3871 const pos_0 = p.i;4097 const pos_0 = p.i;
3872 if (p.parseskip() and blk_1: {4098 if (try p.parseskip() and blk_1: {
3873 if (std.mem.startsWith(u8, p.source[p.i..], "++")) {4099 if (std.mem.startsWith(u8, p.source[p.i..], "++")) {
3874 p.i += 2;4100 p.i += 2;
3875 break :blk_1 true;4101 break :blk_1 true;
...@@ -3880,10 +4106,10 @@ const Parser = struct {...@@ -3880,10 +4106,10 @@ const Parser = struct {
3880 break :blk_0 false;4106 break :blk_0 false;
3881 };4107 };
3882 }4108 }
3883 pub fn parsePLUSEQUAL(p: *Parser) bool {4109 pub fn parsePLUSEQUAL(p: *Parser) Error!bool {
3884 return blk_0: {4110 return blk_0: {
3885 const pos_0 = p.i;4111 const pos_0 = p.i;
3886 if (p.parseskip() and blk_1: {4112 if (try p.parseskip() and blk_1: {
3887 if (std.mem.startsWith(u8, p.source[p.i..], "+=")) {4113 if (std.mem.startsWith(u8, p.source[p.i..], "+=")) {
3888 p.i += 2;4114 p.i += 2;
3889 break :blk_1 true;4115 break :blk_1 true;
...@@ -3894,10 +4120,10 @@ const Parser = struct {...@@ -3894,10 +4120,10 @@ const Parser = struct {
3894 break :blk_0 false;4120 break :blk_0 false;
3895 };4121 };
3896 }4122 }
3897 pub fn parsePLUSPERCENT(p: *Parser) bool {4123 pub fn parsePLUSPERCENT(p: *Parser) Error!bool {
3898 return blk_0: {4124 return blk_0: {
3899 const pos_0 = p.i;4125 const pos_0 = p.i;
3900 if (p.parseskip() and blk_1: {4126 if (try p.parseskip() and blk_1: {
3901 if (std.mem.startsWith(u8, p.source[p.i..], "+%")) {4127 if (std.mem.startsWith(u8, p.source[p.i..], "+%")) {
3902 p.i += 2;4128 p.i += 2;
3903 break :blk_1 true;4129 break :blk_1 true;
...@@ -3920,10 +4146,10 @@ const Parser = struct {...@@ -3920,10 +4146,10 @@ const Parser = struct {
3920 break :blk_0 false;4146 break :blk_0 false;
3921 };4147 };
3922 }4148 }
3923 pub fn parsePLUSPERCENTEQUAL(p: *Parser) bool {4149 pub fn parsePLUSPERCENTEQUAL(p: *Parser) Error!bool {
3924 return blk_0: {4150 return blk_0: {
3925 const pos_0 = p.i;4151 const pos_0 = p.i;
3926 if (p.parseskip() and blk_1: {4152 if (try p.parseskip() and blk_1: {
3927 if (std.mem.startsWith(u8, p.source[p.i..], "+%=")) {4153 if (std.mem.startsWith(u8, p.source[p.i..], "+%=")) {
3928 p.i += 3;4154 p.i += 3;
3929 break :blk_1 true;4155 break :blk_1 true;
...@@ -3934,10 +4160,10 @@ const Parser = struct {...@@ -3934,10 +4160,10 @@ const Parser = struct {
3934 break :blk_0 false;4160 break :blk_0 false;
3935 };4161 };
3936 }4162 }
3937 pub fn parsePLUSPIPE(p: *Parser) bool {4163 pub fn parsePLUSPIPE(p: *Parser) Error!bool {
3938 return blk_0: {4164 return blk_0: {
3939 const pos_0 = p.i;4165 const pos_0 = p.i;
3940 if (p.parseskip() and blk_1: {4166 if (try p.parseskip() and blk_1: {
3941 if (std.mem.startsWith(u8, p.source[p.i..], "+|")) {4167 if (std.mem.startsWith(u8, p.source[p.i..], "+|")) {
3942 p.i += 2;4168 p.i += 2;
3943 break :blk_1 true;4169 break :blk_1 true;
...@@ -3960,10 +4186,10 @@ const Parser = struct {...@@ -3960,10 +4186,10 @@ const Parser = struct {
3960 break :blk_0 false;4186 break :blk_0 false;
3961 };4187 };
3962 }4188 }
3963 pub fn parsePLUSPIPEEQUAL(p: *Parser) bool {4189 pub fn parsePLUSPIPEEQUAL(p: *Parser) Error!bool {
3964 return blk_0: {4190 return blk_0: {
3965 const pos_0 = p.i;4191 const pos_0 = p.i;
3966 if (p.parseskip() and blk_1: {4192 if (try p.parseskip() and blk_1: {
3967 if (std.mem.startsWith(u8, p.source[p.i..], "+|=")) {4193 if (std.mem.startsWith(u8, p.source[p.i..], "+|=")) {
3968 p.i += 3;4194 p.i += 3;
3969 break :blk_1 true;4195 break :blk_1 true;
...@@ -3974,10 +4200,10 @@ const Parser = struct {...@@ -3974,10 +4200,10 @@ const Parser = struct {
3974 break :blk_0 false;4200 break :blk_0 false;
3975 };4201 };
3976 }4202 }
3977 pub fn parseLETTERC(p: *Parser) bool {4203 pub fn parseLETTERC(p: *Parser) Error!bool {
3978 return blk_0: {4204 return blk_0: {
3979 const pos_0 = p.i;4205 const pos_0 = p.i;
3980 if (p.parseskip() and blk_1: {4206 if (try p.parseskip() and blk_1: {
3981 if (std.mem.startsWith(u8, p.source[p.i..], "c")) {4207 if (std.mem.startsWith(u8, p.source[p.i..], "c")) {
3982 p.i += 1;4208 p.i += 1;
3983 break :blk_1 true;4209 break :blk_1 true;
...@@ -3988,10 +4214,10 @@ const Parser = struct {...@@ -3988,10 +4214,10 @@ const Parser = struct {
3988 break :blk_0 false;4214 break :blk_0 false;
3989 };4215 };
3990 }4216 }
3991 pub fn parseQUESTIONMARK(p: *Parser) bool {4217 pub fn parseQUESTIONMARK(p: *Parser) Error!bool {
3992 return blk_0: {4218 return blk_0: {
3993 const pos_0 = p.i;4219 const pos_0 = p.i;
3994 if (p.parseskip() and blk_1: {4220 if (try p.parseskip() and blk_1: {
3995 if (std.mem.startsWith(u8, p.source[p.i..], "?")) {4221 if (std.mem.startsWith(u8, p.source[p.i..], "?")) {
3996 p.i += 1;4222 p.i += 1;
3997 break :blk_1 true;4223 break :blk_1 true;
...@@ -4002,10 +4228,10 @@ const Parser = struct {...@@ -4002,10 +4228,10 @@ const Parser = struct {
4002 break :blk_0 false;4228 break :blk_0 false;
4003 };4229 };
4004 }4230 }
4005 pub fn parseRARROW(p: *Parser) bool {4231 pub fn parseRARROW(p: *Parser) Error!bool {
4006 return blk_0: {4232 return blk_0: {
4007 const pos_0 = p.i;4233 const pos_0 = p.i;
4008 if (p.parseskip() and blk_1: {4234 if (try p.parseskip() and blk_1: {
4009 if (std.mem.startsWith(u8, p.source[p.i..], ">")) {4235 if (std.mem.startsWith(u8, p.source[p.i..], ">")) {
4010 p.i += 1;4236 p.i += 1;
4011 break :blk_1 true;4237 break :blk_1 true;
...@@ -4029,10 +4255,10 @@ const Parser = struct {...@@ -4029,10 +4255,10 @@ const Parser = struct {
4029 break :blk_0 false;4255 break :blk_0 false;
4030 };4256 };
4031 }4257 }
4032 pub fn parseRARROW2(p: *Parser) bool {4258 pub fn parseRARROW2(p: *Parser) Error!bool {
4033 return blk_0: {4259 return blk_0: {
4034 const pos_0 = p.i;4260 const pos_0 = p.i;
4035 if (p.parseskip() and blk_1: {4261 if (try p.parseskip() and blk_1: {
4036 if (std.mem.startsWith(u8, p.source[p.i..], ">>")) {4262 if (std.mem.startsWith(u8, p.source[p.i..], ">>")) {
4037 p.i += 2;4263 p.i += 2;
4038 break :blk_1 true;4264 break :blk_1 true;
...@@ -4055,10 +4281,10 @@ const Parser = struct {...@@ -4055,10 +4281,10 @@ const Parser = struct {
4055 break :blk_0 false;4281 break :blk_0 false;
4056 };4282 };
4057 }4283 }
4058 pub fn parseRARROW2EQUAL(p: *Parser) bool {4284 pub fn parseRARROW2EQUAL(p: *Parser) Error!bool {
4059 return blk_0: {4285 return blk_0: {
4060 const pos_0 = p.i;4286 const pos_0 = p.i;
4061 if (p.parseskip() and blk_1: {4287 if (try p.parseskip() and blk_1: {
4062 if (std.mem.startsWith(u8, p.source[p.i..], ">>=")) {4288 if (std.mem.startsWith(u8, p.source[p.i..], ">>=")) {
4063 p.i += 3;4289 p.i += 3;
4064 break :blk_1 true;4290 break :blk_1 true;
...@@ -4069,10 +4295,10 @@ const Parser = struct {...@@ -4069,10 +4295,10 @@ const Parser = struct {
4069 break :blk_0 false;4295 break :blk_0 false;
4070 };4296 };
4071 }4297 }
4072 pub fn parseRARROWEQUAL(p: *Parser) bool {4298 pub fn parseRARROWEQUAL(p: *Parser) Error!bool {
4073 return blk_0: {4299 return blk_0: {
4074 const pos_0 = p.i;4300 const pos_0 = p.i;
4075 if (p.parseskip() and blk_1: {4301 if (try p.parseskip() and blk_1: {
4076 if (std.mem.startsWith(u8, p.source[p.i..], ">=")) {4302 if (std.mem.startsWith(u8, p.source[p.i..], ">=")) {
4077 p.i += 2;4303 p.i += 2;
4078 break :blk_1 true;4304 break :blk_1 true;
...@@ -4083,10 +4309,10 @@ const Parser = struct {...@@ -4083,10 +4309,10 @@ const Parser = struct {
4083 break :blk_0 false;4309 break :blk_0 false;
4084 };4310 };
4085 }4311 }
4086 pub fn parseRBRACE(p: *Parser) bool {4312 pub fn parseRBRACE(p: *Parser) Error!bool {
4087 return blk_0: {4313 return blk_0: {
4088 const pos_0 = p.i;4314 const pos_0 = p.i;
4089 if (p.parseskip() and blk_1: {4315 if (try p.parseskip() and blk_1: {
4090 if (std.mem.startsWith(u8, p.source[p.i..], "}")) {4316 if (std.mem.startsWith(u8, p.source[p.i..], "}")) {
4091 p.i += 1;4317 p.i += 1;
4092 break :blk_1 true;4318 break :blk_1 true;
...@@ -4097,10 +4323,10 @@ const Parser = struct {...@@ -4097,10 +4323,10 @@ const Parser = struct {
4097 break :blk_0 false;4323 break :blk_0 false;
4098 };4324 };
4099 }4325 }
4100 pub fn parseRBRACKET(p: *Parser) bool {4326 pub fn parseRBRACKET(p: *Parser) Error!bool {
4101 return blk_0: {4327 return blk_0: {
4102 const pos_0 = p.i;4328 const pos_0 = p.i;
4103 if (p.parseskip() and blk_1: {4329 if (try p.parseskip() and blk_1: {
4104 if (std.mem.startsWith(u8, p.source[p.i..], "]")) {4330 if (std.mem.startsWith(u8, p.source[p.i..], "]")) {
4105 p.i += 1;4331 p.i += 1;
4106 break :blk_1 true;4332 break :blk_1 true;
...@@ -4111,10 +4337,10 @@ const Parser = struct {...@@ -4111,10 +4337,10 @@ const Parser = struct {
4111 break :blk_0 false;4337 break :blk_0 false;
4112 };4338 };
4113 }4339 }
4114 pub fn parseRPAREN(p: *Parser) bool {4340 pub fn parseRPAREN(p: *Parser) Error!bool {
4115 return blk_0: {4341 return blk_0: {
4116 const pos_0 = p.i;4342 const pos_0 = p.i;
4117 if (p.parseskip() and blk_1: {4343 if (try p.parseskip() and blk_1: {
4118 if (std.mem.startsWith(u8, p.source[p.i..], ")")) {4344 if (std.mem.startsWith(u8, p.source[p.i..], ")")) {
4119 p.i += 1;4345 p.i += 1;
4120 break :blk_1 true;4346 break :blk_1 true;
...@@ -4125,10 +4351,10 @@ const Parser = struct {...@@ -4125,10 +4351,10 @@ const Parser = struct {
4125 break :blk_0 false;4351 break :blk_0 false;
4126 };4352 };
4127 }4353 }
4128 pub fn parseSEMICOLON(p: *Parser) bool {4354 pub fn parseSEMICOLON(p: *Parser) Error!bool {
4129 return blk_0: {4355 return blk_0: {
4130 const pos_0 = p.i;4356 const pos_0 = p.i;
4131 if (p.parseskip() and blk_1: {4357 if (try p.parseskip() and blk_1: {
4132 if (std.mem.startsWith(u8, p.source[p.i..], ";")) {4358 if (std.mem.startsWith(u8, p.source[p.i..], ";")) {
4133 p.i += 1;4359 p.i += 1;
4134 break :blk_1 true;4360 break :blk_1 true;
...@@ -4139,10 +4365,10 @@ const Parser = struct {...@@ -4139,10 +4365,10 @@ const Parser = struct {
4139 break :blk_0 false;4365 break :blk_0 false;
4140 };4366 };
4141 }4367 }
4142 pub fn parseSLASH(p: *Parser) bool {4368 pub fn parseSLASH(p: *Parser) Error!bool {
4143 return blk_0: {4369 return blk_0: {
4144 const pos_0 = p.i;4370 const pos_0 = p.i;
4145 if (p.parseskip() and blk_1: {4371 if (try p.parseskip() and blk_1: {
4146 if (std.mem.startsWith(u8, p.source[p.i..], "/")) {4372 if (std.mem.startsWith(u8, p.source[p.i..], "/")) {
4147 p.i += 1;4373 p.i += 1;
4148 break :blk_1 true;4374 break :blk_1 true;
...@@ -4166,10 +4392,10 @@ const Parser = struct {...@@ -4166,10 +4392,10 @@ const Parser = struct {
4166 break :blk_0 false;4392 break :blk_0 false;
4167 };4393 };
4168 }4394 }
4169 pub fn parseSLASHEQUAL(p: *Parser) bool {4395 pub fn parseSLASHEQUAL(p: *Parser) Error!bool {
4170 return blk_0: {4396 return blk_0: {
4171 const pos_0 = p.i;4397 const pos_0 = p.i;
4172 if (p.parseskip() and blk_1: {4398 if (try p.parseskip() and blk_1: {
4173 if (std.mem.startsWith(u8, p.source[p.i..], "/=")) {4399 if (std.mem.startsWith(u8, p.source[p.i..], "/=")) {
4174 p.i += 2;4400 p.i += 2;
4175 break :blk_1 true;4401 break :blk_1 true;
...@@ -4180,10 +4406,10 @@ const Parser = struct {...@@ -4180,10 +4406,10 @@ const Parser = struct {
4180 break :blk_0 false;4406 break :blk_0 false;
4181 };4407 };
4182 }4408 }
4183 pub fn parseTILDE(p: *Parser) bool {4409 pub fn parseTILDE(p: *Parser) Error!bool {
4184 return blk_0: {4410 return blk_0: {
4185 const pos_0 = p.i;4411 const pos_0 = p.i;
4186 if (p.parseskip() and blk_1: {4412 if (try p.parseskip() and blk_1: {
4187 if (std.mem.startsWith(u8, p.source[p.i..], "~")) {4413 if (std.mem.startsWith(u8, p.source[p.i..], "~")) {
4188 p.i += 1;4414 p.i += 1;
4189 break :blk_1 true;4415 break :blk_1 true;
...@@ -4194,7 +4420,7 @@ const Parser = struct {...@@ -4194,7 +4420,7 @@ const Parser = struct {
4194 break :blk_0 false;4420 break :blk_0 false;
4195 };4421 };
4196 }4422 }
4197 pub fn parseend_of_word(p: *Parser) bool {4423 pub fn parseend_of_word(p: *Parser) Error!bool {
4198 return blk_0: {4424 return blk_0: {
4199 const pos_0 = p.i;4425 const pos_0 = p.i;
4200 if (blk_1: {4426 if (blk_1: {
...@@ -4217,744 +4443,744 @@ const Parser = struct {...@@ -4217,744 +4443,744 @@ const Parser = struct {
4217 break :blk_0 false;4443 break :blk_0 false;
4218 };4444 };
4219 }4445 }
4220 pub fn parseKEYWORD_addrspace(p: *Parser) bool {4446 pub fn parseKEYWORD_addrspace(p: *Parser) Error!bool {
4221 return blk_0: {4447 return blk_0: {
4222 const pos_0 = p.i;4448 const pos_0 = p.i;
4223 if (p.parseskip() and blk_1: {4449 if (try p.parseskip() and blk_1: {
4224 if (std.mem.startsWith(u8, p.source[p.i..], "addrspace")) {4450 if (std.mem.startsWith(u8, p.source[p.i..], "addrspace")) {
4225 p.i += 9;4451 p.i += 9;
4226 break :blk_1 true;4452 break :blk_1 true;
4227 }4453 }
4228 break :blk_1 false;4454 break :blk_1 false;
4229 } and p.parseend_of_word()) break :blk_0 true;4455 } and try p.parseend_of_word()) break :blk_0 true;
4230 p.i = pos_0;4456 p.i = pos_0;
4231 break :blk_0 false;4457 break :blk_0 false;
4232 };4458 };
4233 }4459 }
4234 pub fn parseKEYWORD_align(p: *Parser) bool {4460 pub fn parseKEYWORD_align(p: *Parser) Error!bool {
4235 return blk_0: {4461 return blk_0: {
4236 const pos_0 = p.i;4462 const pos_0 = p.i;
4237 if (p.parseskip() and blk_1: {4463 if (try p.parseskip() and blk_1: {
4238 if (std.mem.startsWith(u8, p.source[p.i..], "align")) {4464 if (std.mem.startsWith(u8, p.source[p.i..], "align")) {
4239 p.i += 5;4465 p.i += 5;
4240 break :blk_1 true;4466 break :blk_1 true;
4241 }4467 }
4242 break :blk_1 false;4468 break :blk_1 false;
4243 } and p.parseend_of_word()) break :blk_0 true;4469 } and try p.parseend_of_word()) break :blk_0 true;
4244 p.i = pos_0;4470 p.i = pos_0;
4245 break :blk_0 false;4471 break :blk_0 false;
4246 };4472 };
4247 }4473 }
4248 pub fn parseKEYWORD_allowzero(p: *Parser) bool {4474 pub fn parseKEYWORD_allowzero(p: *Parser) Error!bool {
4249 return blk_0: {4475 return blk_0: {
4250 const pos_0 = p.i;4476 const pos_0 = p.i;
4251 if (p.parseskip() and blk_1: {4477 if (try p.parseskip() and blk_1: {
4252 if (std.mem.startsWith(u8, p.source[p.i..], "allowzero")) {4478 if (std.mem.startsWith(u8, p.source[p.i..], "allowzero")) {
4253 p.i += 9;4479 p.i += 9;
4254 break :blk_1 true;4480 break :blk_1 true;
4255 }4481 }
4256 break :blk_1 false;4482 break :blk_1 false;
4257 } and p.parseend_of_word()) break :blk_0 true;4483 } and try p.parseend_of_word()) break :blk_0 true;
4258 p.i = pos_0;4484 p.i = pos_0;
4259 break :blk_0 false;4485 break :blk_0 false;
4260 };4486 };
4261 }4487 }
4262 pub fn parseKEYWORD_and(p: *Parser) bool {4488 pub fn parseKEYWORD_and(p: *Parser) Error!bool {
4263 return blk_0: {4489 return blk_0: {
4264 const pos_0 = p.i;4490 const pos_0 = p.i;
4265 if (p.parseskip() and blk_1: {4491 if (try p.parseskip() and blk_1: {
4266 if (std.mem.startsWith(u8, p.source[p.i..], "and")) {4492 if (std.mem.startsWith(u8, p.source[p.i..], "and")) {
4267 p.i += 3;4493 p.i += 3;
4268 break :blk_1 true;4494 break :blk_1 true;
4269 }4495 }
4270 break :blk_1 false;4496 break :blk_1 false;
4271 } and p.parseend_of_word()) break :blk_0 true;4497 } and try p.parseend_of_word()) break :blk_0 true;
4272 p.i = pos_0;4498 p.i = pos_0;
4273 break :blk_0 false;4499 break :blk_0 false;
4274 };4500 };
4275 }4501 }
4276 pub fn parseKEYWORD_anyframe(p: *Parser) bool {4502 pub fn parseKEYWORD_anyframe(p: *Parser) Error!bool {
4277 return blk_0: {4503 return blk_0: {
4278 const pos_0 = p.i;4504 const pos_0 = p.i;
4279 if (p.parseskip() and blk_1: {4505 if (try p.parseskip() and blk_1: {
4280 if (std.mem.startsWith(u8, p.source[p.i..], "anyframe")) {4506 if (std.mem.startsWith(u8, p.source[p.i..], "anyframe")) {
4281 p.i += 8;4507 p.i += 8;
4282 break :blk_1 true;4508 break :blk_1 true;
4283 }4509 }
4284 break :blk_1 false;4510 break :blk_1 false;
4285 } and p.parseend_of_word()) break :blk_0 true;4511 } and try p.parseend_of_word()) break :blk_0 true;
4286 p.i = pos_0;4512 p.i = pos_0;
4287 break :blk_0 false;4513 break :blk_0 false;
4288 };4514 };
4289 }4515 }
4290 pub fn parseKEYWORD_anytype(p: *Parser) bool {4516 pub fn parseKEYWORD_anytype(p: *Parser) Error!bool {
4291 return blk_0: {4517 return blk_0: {
4292 const pos_0 = p.i;4518 const pos_0 = p.i;
4293 if (p.parseskip() and blk_1: {4519 if (try p.parseskip() and blk_1: {
4294 if (std.mem.startsWith(u8, p.source[p.i..], "anytype")) {4520 if (std.mem.startsWith(u8, p.source[p.i..], "anytype")) {
4295 p.i += 7;4521 p.i += 7;
4296 break :blk_1 true;4522 break :blk_1 true;
4297 }4523 }
4298 break :blk_1 false;4524 break :blk_1 false;
4299 } and p.parseend_of_word()) break :blk_0 true;4525 } and try p.parseend_of_word()) break :blk_0 true;
4300 p.i = pos_0;4526 p.i = pos_0;
4301 break :blk_0 false;4527 break :blk_0 false;
4302 };4528 };
4303 }4529 }
4304 pub fn parseKEYWORD_asm(p: *Parser) bool {4530 pub fn parseKEYWORD_asm(p: *Parser) Error!bool {
4305 return blk_0: {4531 return blk_0: {
4306 const pos_0 = p.i;4532 const pos_0 = p.i;
4307 if (p.parseskip() and blk_1: {4533 if (try p.parseskip() and blk_1: {
4308 if (std.mem.startsWith(u8, p.source[p.i..], "asm")) {4534 if (std.mem.startsWith(u8, p.source[p.i..], "asm")) {
4309 p.i += 3;4535 p.i += 3;
4310 break :blk_1 true;4536 break :blk_1 true;
4311 }4537 }
4312 break :blk_1 false;4538 break :blk_1 false;
4313 } and p.parseend_of_word()) break :blk_0 true;4539 } and try p.parseend_of_word()) break :blk_0 true;
4314 p.i = pos_0;4540 p.i = pos_0;
4315 break :blk_0 false;4541 break :blk_0 false;
4316 };4542 };
4317 }4543 }
4318 pub fn parseKEYWORD_break(p: *Parser) bool {4544 pub fn parseKEYWORD_break(p: *Parser) Error!bool {
4319 return blk_0: {4545 return blk_0: {
4320 const pos_0 = p.i;4546 const pos_0 = p.i;
4321 if (p.parseskip() and blk_1: {4547 if (try p.parseskip() and blk_1: {
4322 if (std.mem.startsWith(u8, p.source[p.i..], "break")) {4548 if (std.mem.startsWith(u8, p.source[p.i..], "break")) {
4323 p.i += 5;4549 p.i += 5;
4324 break :blk_1 true;4550 break :blk_1 true;
4325 }4551 }
4326 break :blk_1 false;4552 break :blk_1 false;
4327 } and p.parseend_of_word()) break :blk_0 true;4553 } and try p.parseend_of_word()) break :blk_0 true;
4328 p.i = pos_0;4554 p.i = pos_0;
4329 break :blk_0 false;4555 break :blk_0 false;
4330 };4556 };
4331 }4557 }
4332 pub fn parseKEYWORD_callconv(p: *Parser) bool {4558 pub fn parseKEYWORD_callconv(p: *Parser) Error!bool {
4333 return blk_0: {4559 return blk_0: {
4334 const pos_0 = p.i;4560 const pos_0 = p.i;
4335 if (p.parseskip() and blk_1: {4561 if (try p.parseskip() and blk_1: {
4336 if (std.mem.startsWith(u8, p.source[p.i..], "callconv")) {4562 if (std.mem.startsWith(u8, p.source[p.i..], "callconv")) {
4337 p.i += 8;4563 p.i += 8;
4338 break :blk_1 true;4564 break :blk_1 true;
4339 }4565 }
4340 break :blk_1 false;4566 break :blk_1 false;
4341 } and p.parseend_of_word()) break :blk_0 true;4567 } and try p.parseend_of_word()) break :blk_0 true;
4342 p.i = pos_0;4568 p.i = pos_0;
4343 break :blk_0 false;4569 break :blk_0 false;
4344 };4570 };
4345 }4571 }
4346 pub fn parseKEYWORD_catch(p: *Parser) bool {4572 pub fn parseKEYWORD_catch(p: *Parser) Error!bool {
4347 return blk_0: {4573 return blk_0: {
4348 const pos_0 = p.i;4574 const pos_0 = p.i;
4349 if (p.parseskip() and blk_1: {4575 if (try p.parseskip() and blk_1: {
4350 if (std.mem.startsWith(u8, p.source[p.i..], "catch")) {4576 if (std.mem.startsWith(u8, p.source[p.i..], "catch")) {
4351 p.i += 5;4577 p.i += 5;
4352 break :blk_1 true;4578 break :blk_1 true;
4353 }4579 }
4354 break :blk_1 false;4580 break :blk_1 false;
4355 } and p.parseend_of_word()) break :blk_0 true;4581 } and try p.parseend_of_word()) break :blk_0 true;
4356 p.i = pos_0;4582 p.i = pos_0;
4357 break :blk_0 false;4583 break :blk_0 false;
4358 };4584 };
4359 }4585 }
4360 pub fn parseKEYWORD_comptime(p: *Parser) bool {4586 pub fn parseKEYWORD_comptime(p: *Parser) Error!bool {
4361 return blk_0: {4587 return blk_0: {
4362 const pos_0 = p.i;4588 const pos_0 = p.i;
4363 if (p.parseskip() and blk_1: {4589 if (try p.parseskip() and blk_1: {
4364 if (std.mem.startsWith(u8, p.source[p.i..], "comptime")) {4590 if (std.mem.startsWith(u8, p.source[p.i..], "comptime")) {
4365 p.i += 8;4591 p.i += 8;
4366 break :blk_1 true;4592 break :blk_1 true;
4367 }4593 }
4368 break :blk_1 false;4594 break :blk_1 false;
4369 } and p.parseend_of_word()) break :blk_0 true;4595 } and try p.parseend_of_word()) break :blk_0 true;
4370 p.i = pos_0;4596 p.i = pos_0;
4371 break :blk_0 false;4597 break :blk_0 false;
4372 };4598 };
4373 }4599 }
4374 pub fn parseKEYWORD_const(p: *Parser) bool {4600 pub fn parseKEYWORD_const(p: *Parser) Error!bool {
4375 return blk_0: {4601 return blk_0: {
4376 const pos_0 = p.i;4602 const pos_0 = p.i;
4377 if (p.parseskip() and blk_1: {4603 if (try p.parseskip() and blk_1: {
4378 if (std.mem.startsWith(u8, p.source[p.i..], "const")) {4604 if (std.mem.startsWith(u8, p.source[p.i..], "const")) {
4379 p.i += 5;4605 p.i += 5;
4380 break :blk_1 true;4606 break :blk_1 true;
4381 }4607 }
4382 break :blk_1 false;4608 break :blk_1 false;
4383 } and p.parseend_of_word()) break :blk_0 true;4609 } and try p.parseend_of_word()) break :blk_0 true;
4384 p.i = pos_0;4610 p.i = pos_0;
4385 break :blk_0 false;4611 break :blk_0 false;
4386 };4612 };
4387 }4613 }
4388 pub fn parseKEYWORD_continue(p: *Parser) bool {4614 pub fn parseKEYWORD_continue(p: *Parser) Error!bool {
4389 return blk_0: {4615 return blk_0: {
4390 const pos_0 = p.i;4616 const pos_0 = p.i;
4391 if (p.parseskip() and blk_1: {4617 if (try p.parseskip() and blk_1: {
4392 if (std.mem.startsWith(u8, p.source[p.i..], "continue")) {4618 if (std.mem.startsWith(u8, p.source[p.i..], "continue")) {
4393 p.i += 8;4619 p.i += 8;
4394 break :blk_1 true;4620 break :blk_1 true;
4395 }4621 }
4396 break :blk_1 false;4622 break :blk_1 false;
4397 } and p.parseend_of_word()) break :blk_0 true;4623 } and try p.parseend_of_word()) break :blk_0 true;
4398 p.i = pos_0;4624 p.i = pos_0;
4399 break :blk_0 false;4625 break :blk_0 false;
4400 };4626 };
4401 }4627 }
4402 pub fn parseKEYWORD_defer(p: *Parser) bool {4628 pub fn parseKEYWORD_defer(p: *Parser) Error!bool {
4403 return blk_0: {4629 return blk_0: {
4404 const pos_0 = p.i;4630 const pos_0 = p.i;
4405 if (p.parseskip() and blk_1: {4631 if (try p.parseskip() and blk_1: {
4406 if (std.mem.startsWith(u8, p.source[p.i..], "defer")) {4632 if (std.mem.startsWith(u8, p.source[p.i..], "defer")) {
4407 p.i += 5;4633 p.i += 5;
4408 break :blk_1 true;4634 break :blk_1 true;
4409 }4635 }
4410 break :blk_1 false;4636 break :blk_1 false;
4411 } and p.parseend_of_word()) break :blk_0 true;4637 } and try p.parseend_of_word()) break :blk_0 true;
4412 p.i = pos_0;4638 p.i = pos_0;
4413 break :blk_0 false;4639 break :blk_0 false;
4414 };4640 };
4415 }4641 }
4416 pub fn parseKEYWORD_else(p: *Parser) bool {4642 pub fn parseKEYWORD_else(p: *Parser) Error!bool {
4417 return blk_0: {4643 return blk_0: {
4418 const pos_0 = p.i;4644 const pos_0 = p.i;
4419 if (p.parseskip() and blk_1: {4645 if (try p.parseskip() and blk_1: {
4420 if (std.mem.startsWith(u8, p.source[p.i..], "else")) {4646 if (std.mem.startsWith(u8, p.source[p.i..], "else")) {
4421 p.i += 4;4647 p.i += 4;
4422 break :blk_1 true;4648 break :blk_1 true;
4423 }4649 }
4424 break :blk_1 false;4650 break :blk_1 false;
4425 } and p.parseend_of_word()) break :blk_0 true;4651 } and try p.parseend_of_word()) break :blk_0 true;
4426 p.i = pos_0;4652 p.i = pos_0;
4427 break :blk_0 false;4653 break :blk_0 false;
4428 };4654 };
4429 }4655 }
4430 pub fn parseKEYWORD_enum(p: *Parser) bool {4656 pub fn parseKEYWORD_enum(p: *Parser) Error!bool {
4431 return blk_0: {4657 return blk_0: {
4432 const pos_0 = p.i;4658 const pos_0 = p.i;
4433 if (p.parseskip() and blk_1: {4659 if (try p.parseskip() and blk_1: {
4434 if (std.mem.startsWith(u8, p.source[p.i..], "enum")) {4660 if (std.mem.startsWith(u8, p.source[p.i..], "enum")) {
4435 p.i += 4;4661 p.i += 4;
4436 break :blk_1 true;4662 break :blk_1 true;
4437 }4663 }
4438 break :blk_1 false;4664 break :blk_1 false;
4439 } and p.parseend_of_word()) break :blk_0 true;4665 } and try p.parseend_of_word()) break :blk_0 true;
4440 p.i = pos_0;4666 p.i = pos_0;
4441 break :blk_0 false;4667 break :blk_0 false;
4442 };4668 };
4443 }4669 }
4444 pub fn parseKEYWORD_errdefer(p: *Parser) bool {4670 pub fn parseKEYWORD_errdefer(p: *Parser) Error!bool {
4445 return blk_0: {4671 return blk_0: {
4446 const pos_0 = p.i;4672 const pos_0 = p.i;
4447 if (p.parseskip() and blk_1: {4673 if (try p.parseskip() and blk_1: {
4448 if (std.mem.startsWith(u8, p.source[p.i..], "errdefer")) {4674 if (std.mem.startsWith(u8, p.source[p.i..], "errdefer")) {
4449 p.i += 8;4675 p.i += 8;
4450 break :blk_1 true;4676 break :blk_1 true;
4451 }4677 }
4452 break :blk_1 false;4678 break :blk_1 false;
4453 } and p.parseend_of_word()) break :blk_0 true;4679 } and try p.parseend_of_word()) break :blk_0 true;
4454 p.i = pos_0;4680 p.i = pos_0;
4455 break :blk_0 false;4681 break :blk_0 false;
4456 };4682 };
4457 }4683 }
4458 pub fn parseKEYWORD_error(p: *Parser) bool {4684 pub fn parseKEYWORD_error(p: *Parser) Error!bool {
4459 return blk_0: {4685 return blk_0: {
4460 const pos_0 = p.i;4686 const pos_0 = p.i;
4461 if (p.parseskip() and blk_1: {4687 if (try p.parseskip() and blk_1: {
4462 if (std.mem.startsWith(u8, p.source[p.i..], "error")) {4688 if (std.mem.startsWith(u8, p.source[p.i..], "error")) {
4463 p.i += 5;4689 p.i += 5;
4464 break :blk_1 true;4690 break :blk_1 true;
4465 }4691 }
4466 break :blk_1 false;4692 break :blk_1 false;
4467 } and p.parseend_of_word()) break :blk_0 true;4693 } and try p.parseend_of_word()) break :blk_0 true;
4468 p.i = pos_0;4694 p.i = pos_0;
4469 break :blk_0 false;4695 break :blk_0 false;
4470 };4696 };
4471 }4697 }
4472 pub fn parseKEYWORD_export(p: *Parser) bool {4698 pub fn parseKEYWORD_export(p: *Parser) Error!bool {
4473 return blk_0: {4699 return blk_0: {
4474 const pos_0 = p.i;4700 const pos_0 = p.i;
4475 if (p.parseskip() and blk_1: {4701 if (try p.parseskip() and blk_1: {
4476 if (std.mem.startsWith(u8, p.source[p.i..], "export")) {4702 if (std.mem.startsWith(u8, p.source[p.i..], "export")) {
4477 p.i += 6;4703 p.i += 6;
4478 break :blk_1 true;4704 break :blk_1 true;
4479 }4705 }
4480 break :blk_1 false;4706 break :blk_1 false;
4481 } and p.parseend_of_word()) break :blk_0 true;4707 } and try p.parseend_of_word()) break :blk_0 true;
4482 p.i = pos_0;4708 p.i = pos_0;
4483 break :blk_0 false;4709 break :blk_0 false;
4484 };4710 };
4485 }4711 }
4486 pub fn parseKEYWORD_extern(p: *Parser) bool {4712 pub fn parseKEYWORD_extern(p: *Parser) Error!bool {
4487 return blk_0: {4713 return blk_0: {
4488 const pos_0 = p.i;4714 const pos_0 = p.i;
4489 if (p.parseskip() and blk_1: {4715 if (try p.parseskip() and blk_1: {
4490 if (std.mem.startsWith(u8, p.source[p.i..], "extern")) {4716 if (std.mem.startsWith(u8, p.source[p.i..], "extern")) {
4491 p.i += 6;4717 p.i += 6;
4492 break :blk_1 true;4718 break :blk_1 true;
4493 }4719 }
4494 break :blk_1 false;4720 break :blk_1 false;
4495 } and p.parseend_of_word()) break :blk_0 true;4721 } and try p.parseend_of_word()) break :blk_0 true;
4496 p.i = pos_0;4722 p.i = pos_0;
4497 break :blk_0 false;4723 break :blk_0 false;
4498 };4724 };
4499 }4725 }
4500 pub fn parseKEYWORD_fn(p: *Parser) bool {4726 pub fn parseKEYWORD_fn(p: *Parser) Error!bool {
4501 return blk_0: {4727 return blk_0: {
4502 const pos_0 = p.i;4728 const pos_0 = p.i;
4503 if (p.parseskip() and blk_1: {4729 if (try p.parseskip() and blk_1: {
4504 if (std.mem.startsWith(u8, p.source[p.i..], "fn")) {4730 if (std.mem.startsWith(u8, p.source[p.i..], "fn")) {
4505 p.i += 2;4731 p.i += 2;
4506 break :blk_1 true;4732 break :blk_1 true;
4507 }4733 }
4508 break :blk_1 false;4734 break :blk_1 false;
4509 } and p.parseend_of_word()) break :blk_0 true;4735 } and try p.parseend_of_word()) break :blk_0 true;
4510 p.i = pos_0;4736 p.i = pos_0;
4511 break :blk_0 false;4737 break :blk_0 false;
4512 };4738 };
4513 }4739 }
4514 pub fn parseKEYWORD_for(p: *Parser) bool {4740 pub fn parseKEYWORD_for(p: *Parser) Error!bool {
4515 return blk_0: {4741 return blk_0: {
4516 const pos_0 = p.i;4742 const pos_0 = p.i;
4517 if (p.parseskip() and blk_1: {4743 if (try p.parseskip() and blk_1: {
4518 if (std.mem.startsWith(u8, p.source[p.i..], "for")) {4744 if (std.mem.startsWith(u8, p.source[p.i..], "for")) {
4519 p.i += 3;4745 p.i += 3;
4520 break :blk_1 true;4746 break :blk_1 true;
4521 }4747 }
4522 break :blk_1 false;4748 break :blk_1 false;
4523 } and p.parseend_of_word()) break :blk_0 true;4749 } and try p.parseend_of_word()) break :blk_0 true;
4524 p.i = pos_0;4750 p.i = pos_0;
4525 break :blk_0 false;4751 break :blk_0 false;
4526 };4752 };
4527 }4753 }
4528 pub fn parseKEYWORD_if(p: *Parser) bool {4754 pub fn parseKEYWORD_if(p: *Parser) Error!bool {
4529 return blk_0: {4755 return blk_0: {
4530 const pos_0 = p.i;4756 const pos_0 = p.i;
4531 if (p.parseskip() and blk_1: {4757 if (try p.parseskip() and blk_1: {
4532 if (std.mem.startsWith(u8, p.source[p.i..], "if")) {4758 if (std.mem.startsWith(u8, p.source[p.i..], "if")) {
4533 p.i += 2;4759 p.i += 2;
4534 break :blk_1 true;4760 break :blk_1 true;
4535 }4761 }
4536 break :blk_1 false;4762 break :blk_1 false;
4537 } and p.parseend_of_word()) break :blk_0 true;4763 } and try p.parseend_of_word()) break :blk_0 true;
4538 p.i = pos_0;4764 p.i = pos_0;
4539 break :blk_0 false;4765 break :blk_0 false;
4540 };4766 };
4541 }4767 }
4542 pub fn parseKEYWORD_inline(p: *Parser) bool {4768 pub fn parseKEYWORD_inline(p: *Parser) Error!bool {
4543 return blk_0: {4769 return blk_0: {
4544 const pos_0 = p.i;4770 const pos_0 = p.i;
4545 if (p.parseskip() and blk_1: {4771 if (try p.parseskip() and blk_1: {
4546 if (std.mem.startsWith(u8, p.source[p.i..], "inline")) {4772 if (std.mem.startsWith(u8, p.source[p.i..], "inline")) {
4547 p.i += 6;4773 p.i += 6;
4548 break :blk_1 true;4774 break :blk_1 true;
4549 }4775 }
4550 break :blk_1 false;4776 break :blk_1 false;
4551 } and p.parseend_of_word()) break :blk_0 true;4777 } and try p.parseend_of_word()) break :blk_0 true;
4552 p.i = pos_0;4778 p.i = pos_0;
4553 break :blk_0 false;4779 break :blk_0 false;
4554 };4780 };
4555 }4781 }
4556 pub fn parseKEYWORD_noalias(p: *Parser) bool {4782 pub fn parseKEYWORD_noalias(p: *Parser) Error!bool {
4557 return blk_0: {4783 return blk_0: {
4558 const pos_0 = p.i;4784 const pos_0 = p.i;
4559 if (p.parseskip() and blk_1: {4785 if (try p.parseskip() and blk_1: {
4560 if (std.mem.startsWith(u8, p.source[p.i..], "noalias")) {4786 if (std.mem.startsWith(u8, p.source[p.i..], "noalias")) {
4561 p.i += 7;4787 p.i += 7;
4562 break :blk_1 true;4788 break :blk_1 true;
4563 }4789 }
4564 break :blk_1 false;4790 break :blk_1 false;
4565 } and p.parseend_of_word()) break :blk_0 true;4791 } and try p.parseend_of_word()) break :blk_0 true;
4566 p.i = pos_0;4792 p.i = pos_0;
4567 break :blk_0 false;4793 break :blk_0 false;
4568 };4794 };
4569 }4795 }
4570 pub fn parseKEYWORD_nosuspend(p: *Parser) bool {4796 pub fn parseKEYWORD_nosuspend(p: *Parser) Error!bool {
4571 return blk_0: {4797 return blk_0: {
4572 const pos_0 = p.i;4798 const pos_0 = p.i;
4573 if (p.parseskip() and blk_1: {4799 if (try p.parseskip() and blk_1: {
4574 if (std.mem.startsWith(u8, p.source[p.i..], "nosuspend")) {4800 if (std.mem.startsWith(u8, p.source[p.i..], "nosuspend")) {
4575 p.i += 9;4801 p.i += 9;
4576 break :blk_1 true;4802 break :blk_1 true;
4577 }4803 }
4578 break :blk_1 false;4804 break :blk_1 false;
4579 } and p.parseend_of_word()) break :blk_0 true;4805 } and try p.parseend_of_word()) break :blk_0 true;
4580 p.i = pos_0;4806 p.i = pos_0;
4581 break :blk_0 false;4807 break :blk_0 false;
4582 };4808 };
4583 }4809 }
4584 pub fn parseKEYWORD_noinline(p: *Parser) bool {4810 pub fn parseKEYWORD_noinline(p: *Parser) Error!bool {
4585 return blk_0: {4811 return blk_0: {
4586 const pos_0 = p.i;4812 const pos_0 = p.i;
4587 if (p.parseskip() and blk_1: {4813 if (try p.parseskip() and blk_1: {
4588 if (std.mem.startsWith(u8, p.source[p.i..], "noinline")) {4814 if (std.mem.startsWith(u8, p.source[p.i..], "noinline")) {
4589 p.i += 8;4815 p.i += 8;
4590 break :blk_1 true;4816 break :blk_1 true;
4591 }4817 }
4592 break :blk_1 false;4818 break :blk_1 false;
4593 } and p.parseend_of_word()) break :blk_0 true;4819 } and try p.parseend_of_word()) break :blk_0 true;
4594 p.i = pos_0;4820 p.i = pos_0;
4595 break :blk_0 false;4821 break :blk_0 false;
4596 };4822 };
4597 }4823 }
4598 pub fn parseKEYWORD_opaque(p: *Parser) bool {4824 pub fn parseKEYWORD_opaque(p: *Parser) Error!bool {
4599 return blk_0: {4825 return blk_0: {
4600 const pos_0 = p.i;4826 const pos_0 = p.i;
4601 if (p.parseskip() and blk_1: {4827 if (try p.parseskip() and blk_1: {
4602 if (std.mem.startsWith(u8, p.source[p.i..], "opaque")) {4828 if (std.mem.startsWith(u8, p.source[p.i..], "opaque")) {
4603 p.i += 6;4829 p.i += 6;
4604 break :blk_1 true;4830 break :blk_1 true;
4605 }4831 }
4606 break :blk_1 false;4832 break :blk_1 false;
4607 } and p.parseend_of_word()) break :blk_0 true;4833 } and try p.parseend_of_word()) break :blk_0 true;
4608 p.i = pos_0;4834 p.i = pos_0;
4609 break :blk_0 false;4835 break :blk_0 false;
4610 };4836 };
4611 }4837 }
4612 pub fn parseKEYWORD_or(p: *Parser) bool {4838 pub fn parseKEYWORD_or(p: *Parser) Error!bool {
4613 return blk_0: {4839 return blk_0: {
4614 const pos_0 = p.i;4840 const pos_0 = p.i;
4615 if (p.parseskip() and blk_1: {4841 if (try p.parseskip() and blk_1: {
4616 if (std.mem.startsWith(u8, p.source[p.i..], "or")) {4842 if (std.mem.startsWith(u8, p.source[p.i..], "or")) {
4617 p.i += 2;4843 p.i += 2;
4618 break :blk_1 true;4844 break :blk_1 true;
4619 }4845 }
4620 break :blk_1 false;4846 break :blk_1 false;
4621 } and p.parseend_of_word()) break :blk_0 true;4847 } and try p.parseend_of_word()) break :blk_0 true;
4622 p.i = pos_0;4848 p.i = pos_0;
4623 break :blk_0 false;4849 break :blk_0 false;
4624 };4850 };
4625 }4851 }
4626 pub fn parseKEYWORD_orelse(p: *Parser) bool {4852 pub fn parseKEYWORD_orelse(p: *Parser) Error!bool {
4627 return blk_0: {4853 return blk_0: {
4628 const pos_0 = p.i;4854 const pos_0 = p.i;
4629 if (p.parseskip() and blk_1: {4855 if (try p.parseskip() and blk_1: {
4630 if (std.mem.startsWith(u8, p.source[p.i..], "orelse")) {4856 if (std.mem.startsWith(u8, p.source[p.i..], "orelse")) {
4631 p.i += 6;4857 p.i += 6;
4632 break :blk_1 true;4858 break :blk_1 true;
4633 }4859 }
4634 break :blk_1 false;4860 break :blk_1 false;
4635 } and p.parseend_of_word()) break :blk_0 true;4861 } and try p.parseend_of_word()) break :blk_0 true;
4636 p.i = pos_0;4862 p.i = pos_0;
4637 break :blk_0 false;4863 break :blk_0 false;
4638 };4864 };
4639 }4865 }
4640 pub fn parseKEYWORD_packed(p: *Parser) bool {4866 pub fn parseKEYWORD_packed(p: *Parser) Error!bool {
4641 return blk_0: {4867 return blk_0: {
4642 const pos_0 = p.i;4868 const pos_0 = p.i;
4643 if (p.parseskip() and blk_1: {4869 if (try p.parseskip() and blk_1: {
4644 if (std.mem.startsWith(u8, p.source[p.i..], "packed")) {4870 if (std.mem.startsWith(u8, p.source[p.i..], "packed")) {
4645 p.i += 6;4871 p.i += 6;
4646 break :blk_1 true;4872 break :blk_1 true;
4647 }4873 }
4648 break :blk_1 false;4874 break :blk_1 false;
4649 } and p.parseend_of_word()) break :blk_0 true;4875 } and try p.parseend_of_word()) break :blk_0 true;
4650 p.i = pos_0;4876 p.i = pos_0;
4651 break :blk_0 false;4877 break :blk_0 false;
4652 };4878 };
4653 }4879 }
4654 pub fn parseKEYWORD_pub(p: *Parser) bool {4880 pub fn parseKEYWORD_pub(p: *Parser) Error!bool {
4655 return blk_0: {4881 return blk_0: {
4656 const pos_0 = p.i;4882 const pos_0 = p.i;
4657 if (p.parseskip() and blk_1: {4883 if (try p.parseskip() and blk_1: {
4658 if (std.mem.startsWith(u8, p.source[p.i..], "pub")) {4884 if (std.mem.startsWith(u8, p.source[p.i..], "pub")) {
4659 p.i += 3;4885 p.i += 3;
4660 break :blk_1 true;4886 break :blk_1 true;
4661 }4887 }
4662 break :blk_1 false;4888 break :blk_1 false;
4663 } and p.parseend_of_word()) break :blk_0 true;4889 } and try p.parseend_of_word()) break :blk_0 true;
4664 p.i = pos_0;4890 p.i = pos_0;
4665 break :blk_0 false;4891 break :blk_0 false;
4666 };4892 };
4667 }4893 }
4668 pub fn parseKEYWORD_resume(p: *Parser) bool {4894 pub fn parseKEYWORD_resume(p: *Parser) Error!bool {
4669 return blk_0: {4895 return blk_0: {
4670 const pos_0 = p.i;4896 const pos_0 = p.i;
4671 if (p.parseskip() and blk_1: {4897 if (try p.parseskip() and blk_1: {
4672 if (std.mem.startsWith(u8, p.source[p.i..], "resume")) {4898 if (std.mem.startsWith(u8, p.source[p.i..], "resume")) {
4673 p.i += 6;4899 p.i += 6;
4674 break :blk_1 true;4900 break :blk_1 true;
4675 }4901 }
4676 break :blk_1 false;4902 break :blk_1 false;
4677 } and p.parseend_of_word()) break :blk_0 true;4903 } and try p.parseend_of_word()) break :blk_0 true;
4678 p.i = pos_0;4904 p.i = pos_0;
4679 break :blk_0 false;4905 break :blk_0 false;
4680 };4906 };
4681 }4907 }
4682 pub fn parseKEYWORD_return(p: *Parser) bool {4908 pub fn parseKEYWORD_return(p: *Parser) Error!bool {
4683 return blk_0: {4909 return blk_0: {
4684 const pos_0 = p.i;4910 const pos_0 = p.i;
4685 if (p.parseskip() and blk_1: {4911 if (try p.parseskip() and blk_1: {
4686 if (std.mem.startsWith(u8, p.source[p.i..], "return")) {4912 if (std.mem.startsWith(u8, p.source[p.i..], "return")) {
4687 p.i += 6;4913 p.i += 6;
4688 break :blk_1 true;4914 break :blk_1 true;
4689 }4915 }
4690 break :blk_1 false;4916 break :blk_1 false;
4691 } and p.parseend_of_word()) break :blk_0 true;4917 } and try p.parseend_of_word()) break :blk_0 true;
4692 p.i = pos_0;4918 p.i = pos_0;
4693 break :blk_0 false;4919 break :blk_0 false;
4694 };4920 };
4695 }4921 }
4696 pub fn parseKEYWORD_linksection(p: *Parser) bool {4922 pub fn parseKEYWORD_linksection(p: *Parser) Error!bool {
4697 return blk_0: {4923 return blk_0: {
4698 const pos_0 = p.i;4924 const pos_0 = p.i;
4699 if (p.parseskip() and blk_1: {4925 if (try p.parseskip() and blk_1: {
4700 if (std.mem.startsWith(u8, p.source[p.i..], "linksection")) {4926 if (std.mem.startsWith(u8, p.source[p.i..], "linksection")) {
4701 p.i += 11;4927 p.i += 11;
4702 break :blk_1 true;4928 break :blk_1 true;
4703 }4929 }
4704 break :blk_1 false;4930 break :blk_1 false;
4705 } and p.parseend_of_word()) break :blk_0 true;4931 } and try p.parseend_of_word()) break :blk_0 true;
4706 p.i = pos_0;4932 p.i = pos_0;
4707 break :blk_0 false;4933 break :blk_0 false;
4708 };4934 };
4709 }4935 }
4710 pub fn parseKEYWORD_struct(p: *Parser) bool {4936 pub fn parseKEYWORD_struct(p: *Parser) Error!bool {
4711 return blk_0: {4937 return blk_0: {
4712 const pos_0 = p.i;4938 const pos_0 = p.i;
4713 if (p.parseskip() and blk_1: {4939 if (try p.parseskip() and blk_1: {
4714 if (std.mem.startsWith(u8, p.source[p.i..], "struct")) {4940 if (std.mem.startsWith(u8, p.source[p.i..], "struct")) {
4715 p.i += 6;4941 p.i += 6;
4716 break :blk_1 true;4942 break :blk_1 true;
4717 }4943 }
4718 break :blk_1 false;4944 break :blk_1 false;
4719 } and p.parseend_of_word()) break :blk_0 true;4945 } and try p.parseend_of_word()) break :blk_0 true;
4720 p.i = pos_0;4946 p.i = pos_0;
4721 break :blk_0 false;4947 break :blk_0 false;
4722 };4948 };
4723 }4949 }
4724 pub fn parseKEYWORD_suspend(p: *Parser) bool {4950 pub fn parseKEYWORD_suspend(p: *Parser) Error!bool {
4725 return blk_0: {4951 return blk_0: {
4726 const pos_0 = p.i;4952 const pos_0 = p.i;
4727 if (p.parseskip() and blk_1: {4953 if (try p.parseskip() and blk_1: {
4728 if (std.mem.startsWith(u8, p.source[p.i..], "suspend")) {4954 if (std.mem.startsWith(u8, p.source[p.i..], "suspend")) {
4729 p.i += 7;4955 p.i += 7;
4730 break :blk_1 true;4956 break :blk_1 true;
4731 }4957 }
4732 break :blk_1 false;4958 break :blk_1 false;
4733 } and p.parseend_of_word()) break :blk_0 true;4959 } and try p.parseend_of_word()) break :blk_0 true;
4734 p.i = pos_0;4960 p.i = pos_0;
4735 break :blk_0 false;4961 break :blk_0 false;
4736 };4962 };
4737 }4963 }
4738 pub fn parseKEYWORD_switch(p: *Parser) bool {4964 pub fn parseKEYWORD_switch(p: *Parser) Error!bool {
4739 return blk_0: {4965 return blk_0: {
4740 const pos_0 = p.i;4966 const pos_0 = p.i;
4741 if (p.parseskip() and blk_1: {4967 if (try p.parseskip() and blk_1: {
4742 if (std.mem.startsWith(u8, p.source[p.i..], "switch")) {4968 if (std.mem.startsWith(u8, p.source[p.i..], "switch")) {
4743 p.i += 6;4969 p.i += 6;
4744 break :blk_1 true;4970 break :blk_1 true;
4745 }4971 }
4746 break :blk_1 false;4972 break :blk_1 false;
4747 } and p.parseend_of_word()) break :blk_0 true;4973 } and try p.parseend_of_word()) break :blk_0 true;
4748 p.i = pos_0;4974 p.i = pos_0;
4749 break :blk_0 false;4975 break :blk_0 false;
4750 };4976 };
4751 }4977 }
4752 pub fn parseKEYWORD_test(p: *Parser) bool {4978 pub fn parseKEYWORD_test(p: *Parser) Error!bool {
4753 return blk_0: {4979 return blk_0: {
4754 const pos_0 = p.i;4980 const pos_0 = p.i;
4755 if (p.parseskip() and blk_1: {4981 if (try p.parseskip() and blk_1: {
4756 if (std.mem.startsWith(u8, p.source[p.i..], "test")) {4982 if (std.mem.startsWith(u8, p.source[p.i..], "test")) {
4757 p.i += 4;4983 p.i += 4;
4758 break :blk_1 true;4984 break :blk_1 true;
4759 }4985 }
4760 break :blk_1 false;4986 break :blk_1 false;
4761 } and p.parseend_of_word()) break :blk_0 true;4987 } and try p.parseend_of_word()) break :blk_0 true;
4762 p.i = pos_0;4988 p.i = pos_0;
4763 break :blk_0 false;4989 break :blk_0 false;
4764 };4990 };
4765 }4991 }
4766 pub fn parseKEYWORD_threadlocal(p: *Parser) bool {4992 pub fn parseKEYWORD_threadlocal(p: *Parser) Error!bool {
4767 return blk_0: {4993 return blk_0: {
4768 const pos_0 = p.i;4994 const pos_0 = p.i;
4769 if (p.parseskip() and blk_1: {4995 if (try p.parseskip() and blk_1: {
4770 if (std.mem.startsWith(u8, p.source[p.i..], "threadlocal")) {4996 if (std.mem.startsWith(u8, p.source[p.i..], "threadlocal")) {
4771 p.i += 11;4997 p.i += 11;
4772 break :blk_1 true;4998 break :blk_1 true;
4773 }4999 }
4774 break :blk_1 false;5000 break :blk_1 false;
4775 } and p.parseend_of_word()) break :blk_0 true;5001 } and try p.parseend_of_word()) break :blk_0 true;
4776 p.i = pos_0;5002 p.i = pos_0;
4777 break :blk_0 false;5003 break :blk_0 false;
4778 };5004 };
4779 }5005 }
4780 pub fn parseKEYWORD_try(p: *Parser) bool {5006 pub fn parseKEYWORD_try(p: *Parser) Error!bool {
4781 return blk_0: {5007 return blk_0: {
4782 const pos_0 = p.i;5008 const pos_0 = p.i;
4783 if (p.parseskip() and blk_1: {5009 if (try p.parseskip() and blk_1: {
4784 if (std.mem.startsWith(u8, p.source[p.i..], "try")) {5010 if (std.mem.startsWith(u8, p.source[p.i..], "try")) {
4785 p.i += 3;5011 p.i += 3;
4786 break :blk_1 true;5012 break :blk_1 true;
4787 }5013 }
4788 break :blk_1 false;5014 break :blk_1 false;
4789 } and p.parseend_of_word()) break :blk_0 true;5015 } and try p.parseend_of_word()) break :blk_0 true;
4790 p.i = pos_0;5016 p.i = pos_0;
4791 break :blk_0 false;5017 break :blk_0 false;
4792 };5018 };
4793 }5019 }
4794 pub fn parseKEYWORD_union(p: *Parser) bool {5020 pub fn parseKEYWORD_union(p: *Parser) Error!bool {
4795 return blk_0: {5021 return blk_0: {
4796 const pos_0 = p.i;5022 const pos_0 = p.i;
4797 if (p.parseskip() and blk_1: {5023 if (try p.parseskip() and blk_1: {
4798 if (std.mem.startsWith(u8, p.source[p.i..], "union")) {5024 if (std.mem.startsWith(u8, p.source[p.i..], "union")) {
4799 p.i += 5;5025 p.i += 5;
4800 break :blk_1 true;5026 break :blk_1 true;
4801 }5027 }
4802 break :blk_1 false;5028 break :blk_1 false;
4803 } and p.parseend_of_word()) break :blk_0 true;5029 } and try p.parseend_of_word()) break :blk_0 true;
4804 p.i = pos_0;5030 p.i = pos_0;
4805 break :blk_0 false;5031 break :blk_0 false;
4806 };5032 };
4807 }5033 }
4808 pub fn parseKEYWORD_unreachable(p: *Parser) bool {5034 pub fn parseKEYWORD_unreachable(p: *Parser) Error!bool {
4809 return blk_0: {5035 return blk_0: {
4810 const pos_0 = p.i;5036 const pos_0 = p.i;
4811 if (p.parseskip() and blk_1: {5037 if (try p.parseskip() and blk_1: {
4812 if (std.mem.startsWith(u8, p.source[p.i..], "unreachable")) {5038 if (std.mem.startsWith(u8, p.source[p.i..], "unreachable")) {
4813 p.i += 11;5039 p.i += 11;
4814 break :blk_1 true;5040 break :blk_1 true;
4815 }5041 }
4816 break :blk_1 false;5042 break :blk_1 false;
4817 } and p.parseend_of_word()) break :blk_0 true;5043 } and try p.parseend_of_word()) break :blk_0 true;
4818 p.i = pos_0;5044 p.i = pos_0;
4819 break :blk_0 false;5045 break :blk_0 false;
4820 };5046 };
4821 }5047 }
4822 pub fn parseKEYWORD_var(p: *Parser) bool {5048 pub fn parseKEYWORD_var(p: *Parser) Error!bool {
4823 return blk_0: {5049 return blk_0: {
4824 const pos_0 = p.i;5050 const pos_0 = p.i;
4825 if (p.parseskip() and blk_1: {5051 if (try p.parseskip() and blk_1: {
4826 if (std.mem.startsWith(u8, p.source[p.i..], "var")) {5052 if (std.mem.startsWith(u8, p.source[p.i..], "var")) {
4827 p.i += 3;5053 p.i += 3;
4828 break :blk_1 true;5054 break :blk_1 true;
4829 }5055 }
4830 break :blk_1 false;5056 break :blk_1 false;
4831 } and p.parseend_of_word()) break :blk_0 true;5057 } and try p.parseend_of_word()) break :blk_0 true;
4832 p.i = pos_0;5058 p.i = pos_0;
4833 break :blk_0 false;5059 break :blk_0 false;
4834 };5060 };
4835 }5061 }
4836 pub fn parseKEYWORD_volatile(p: *Parser) bool {5062 pub fn parseKEYWORD_volatile(p: *Parser) Error!bool {
4837 return blk_0: {5063 return blk_0: {
4838 const pos_0 = p.i;5064 const pos_0 = p.i;
4839 if (p.parseskip() and blk_1: {5065 if (try p.parseskip() and blk_1: {
4840 if (std.mem.startsWith(u8, p.source[p.i..], "volatile")) {5066 if (std.mem.startsWith(u8, p.source[p.i..], "volatile")) {
4841 p.i += 8;5067 p.i += 8;
4842 break :blk_1 true;5068 break :blk_1 true;
4843 }5069 }
4844 break :blk_1 false;5070 break :blk_1 false;
4845 } and p.parseend_of_word()) break :blk_0 true;5071 } and try p.parseend_of_word()) break :blk_0 true;
4846 p.i = pos_0;5072 p.i = pos_0;
4847 break :blk_0 false;5073 break :blk_0 false;
4848 };5074 };
4849 }5075 }
4850 pub fn parseKEYWORD_while(p: *Parser) bool {5076 pub fn parseKEYWORD_while(p: *Parser) Error!bool {
4851 return blk_0: {5077 return blk_0: {
4852 const pos_0 = p.i;5078 const pos_0 = p.i;
4853 if (p.parseskip() and blk_1: {5079 if (try p.parseskip() and blk_1: {
4854 if (std.mem.startsWith(u8, p.source[p.i..], "while")) {5080 if (std.mem.startsWith(u8, p.source[p.i..], "while")) {
4855 p.i += 5;5081 p.i += 5;
4856 break :blk_1 true;5082 break :blk_1 true;
4857 }5083 }
4858 break :blk_1 false;5084 break :blk_1 false;
4859 } and p.parseend_of_word()) break :blk_0 true;5085 } and try p.parseend_of_word()) break :blk_0 true;
4860 p.i = pos_0;5086 p.i = pos_0;
4861 break :blk_0 false;5087 break :blk_0 false;
4862 };5088 };
4863 }5089 }
4864 pub fn parsekeyword(p: *Parser) bool {5090 pub fn parsekeyword(p: *Parser) Error!bool {
4865 return blk_0: {5091 return blk_0: {
4866 const pos_0 = p.i;5092 const pos_0 = p.i;
4867 if (p.parseKEYWORD_addrspace()) break :blk_0 true;5093 if (try p.parseKEYWORD_addrspace()) break :blk_0 true;
4868 p.i = pos_0;5094 p.i = pos_0;
4869 if (p.parseKEYWORD_align()) break :blk_0 true;5095 if (try p.parseKEYWORD_align()) break :blk_0 true;
4870 p.i = pos_0;5096 p.i = pos_0;
4871 if (p.parseKEYWORD_allowzero()) break :blk_0 true;5097 if (try p.parseKEYWORD_allowzero()) break :blk_0 true;
4872 p.i = pos_0;5098 p.i = pos_0;
4873 if (p.parseKEYWORD_and()) break :blk_0 true;5099 if (try p.parseKEYWORD_and()) break :blk_0 true;
4874 p.i = pos_0;5100 p.i = pos_0;
4875 if (p.parseKEYWORD_anyframe()) break :blk_0 true;5101 if (try p.parseKEYWORD_anyframe()) break :blk_0 true;
4876 p.i = pos_0;5102 p.i = pos_0;
4877 if (p.parseKEYWORD_anytype()) break :blk_0 true;5103 if (try p.parseKEYWORD_anytype()) break :blk_0 true;
4878 p.i = pos_0;5104 p.i = pos_0;
4879 if (p.parseKEYWORD_asm()) break :blk_0 true;5105 if (try p.parseKEYWORD_asm()) break :blk_0 true;
4880 p.i = pos_0;5106 p.i = pos_0;
4881 if (p.parseKEYWORD_break()) break :blk_0 true;5107 if (try p.parseKEYWORD_break()) break :blk_0 true;
4882 p.i = pos_0;5108 p.i = pos_0;
4883 if (p.parseKEYWORD_callconv()) break :blk_0 true;5109 if (try p.parseKEYWORD_callconv()) break :blk_0 true;
4884 p.i = pos_0;5110 p.i = pos_0;
4885 if (p.parseKEYWORD_catch()) break :blk_0 true;5111 if (try p.parseKEYWORD_catch()) break :blk_0 true;
4886 p.i = pos_0;5112 p.i = pos_0;
4887 if (p.parseKEYWORD_comptime()) break :blk_0 true;5113 if (try p.parseKEYWORD_comptime()) break :blk_0 true;
4888 p.i = pos_0;5114 p.i = pos_0;
4889 if (p.parseKEYWORD_const()) break :blk_0 true;5115 if (try p.parseKEYWORD_const()) break :blk_0 true;
4890 p.i = pos_0;5116 p.i = pos_0;
4891 if (p.parseKEYWORD_continue()) break :blk_0 true;5117 if (try p.parseKEYWORD_continue()) break :blk_0 true;
4892 p.i = pos_0;5118 p.i = pos_0;
4893 if (p.parseKEYWORD_defer()) break :blk_0 true;5119 if (try p.parseKEYWORD_defer()) break :blk_0 true;
4894 p.i = pos_0;5120 p.i = pos_0;
4895 if (p.parseKEYWORD_else()) break :blk_0 true;5121 if (try p.parseKEYWORD_else()) break :blk_0 true;
4896 p.i = pos_0;5122 p.i = pos_0;
4897 if (p.parseKEYWORD_enum()) break :blk_0 true;5123 if (try p.parseKEYWORD_enum()) break :blk_0 true;
4898 p.i = pos_0;5124 p.i = pos_0;
4899 if (p.parseKEYWORD_errdefer()) break :blk_0 true;5125 if (try p.parseKEYWORD_errdefer()) break :blk_0 true;
4900 p.i = pos_0;5126 p.i = pos_0;
4901 if (p.parseKEYWORD_error()) break :blk_0 true;5127 if (try p.parseKEYWORD_error()) break :blk_0 true;
4902 p.i = pos_0;5128 p.i = pos_0;
4903 if (p.parseKEYWORD_export()) break :blk_0 true;5129 if (try p.parseKEYWORD_export()) break :blk_0 true;
4904 p.i = pos_0;5130 p.i = pos_0;
4905 if (p.parseKEYWORD_extern()) break :blk_0 true;5131 if (try p.parseKEYWORD_extern()) break :blk_0 true;
4906 p.i = pos_0;5132 p.i = pos_0;
4907 if (p.parseKEYWORD_fn()) break :blk_0 true;5133 if (try p.parseKEYWORD_fn()) break :blk_0 true;
4908 p.i = pos_0;5134 p.i = pos_0;
4909 if (p.parseKEYWORD_for()) break :blk_0 true;5135 if (try p.parseKEYWORD_for()) break :blk_0 true;
4910 p.i = pos_0;5136 p.i = pos_0;
4911 if (p.parseKEYWORD_if()) break :blk_0 true;5137 if (try p.parseKEYWORD_if()) break :blk_0 true;
4912 p.i = pos_0;5138 p.i = pos_0;
4913 if (p.parseKEYWORD_inline()) break :blk_0 true;5139 if (try p.parseKEYWORD_inline()) break :blk_0 true;
4914 p.i = pos_0;5140 p.i = pos_0;
4915 if (p.parseKEYWORD_noalias()) break :blk_0 true;5141 if (try p.parseKEYWORD_noalias()) break :blk_0 true;
4916 p.i = pos_0;5142 p.i = pos_0;
4917 if (p.parseKEYWORD_nosuspend()) break :blk_0 true;5143 if (try p.parseKEYWORD_nosuspend()) break :blk_0 true;
4918 p.i = pos_0;5144 p.i = pos_0;
4919 if (p.parseKEYWORD_noinline()) break :blk_0 true;5145 if (try p.parseKEYWORD_noinline()) break :blk_0 true;
4920 p.i = pos_0;5146 p.i = pos_0;
4921 if (p.parseKEYWORD_opaque()) break :blk_0 true;5147 if (try p.parseKEYWORD_opaque()) break :blk_0 true;
4922 p.i = pos_0;5148 p.i = pos_0;
4923 if (p.parseKEYWORD_or()) break :blk_0 true;5149 if (try p.parseKEYWORD_or()) break :blk_0 true;
4924 p.i = pos_0;5150 p.i = pos_0;
4925 if (p.parseKEYWORD_orelse()) break :blk_0 true;5151 if (try p.parseKEYWORD_orelse()) break :blk_0 true;
4926 p.i = pos_0;5152 p.i = pos_0;
4927 if (p.parseKEYWORD_packed()) break :blk_0 true;5153 if (try p.parseKEYWORD_packed()) break :blk_0 true;
4928 p.i = pos_0;5154 p.i = pos_0;
4929 if (p.parseKEYWORD_pub()) break :blk_0 true;5155 if (try p.parseKEYWORD_pub()) break :blk_0 true;
4930 p.i = pos_0;5156 p.i = pos_0;
4931 if (p.parseKEYWORD_resume()) break :blk_0 true;5157 if (try p.parseKEYWORD_resume()) break :blk_0 true;
4932 p.i = pos_0;5158 p.i = pos_0;
4933 if (p.parseKEYWORD_return()) break :blk_0 true;5159 if (try p.parseKEYWORD_return()) break :blk_0 true;
4934 p.i = pos_0;5160 p.i = pos_0;
4935 if (p.parseKEYWORD_linksection()) break :blk_0 true;5161 if (try p.parseKEYWORD_linksection()) break :blk_0 true;
4936 p.i = pos_0;5162 p.i = pos_0;
4937 if (p.parseKEYWORD_struct()) break :blk_0 true;5163 if (try p.parseKEYWORD_struct()) break :blk_0 true;
4938 p.i = pos_0;5164 p.i = pos_0;
4939 if (p.parseKEYWORD_suspend()) break :blk_0 true;5165 if (try p.parseKEYWORD_suspend()) break :blk_0 true;
4940 p.i = pos_0;5166 p.i = pos_0;
4941 if (p.parseKEYWORD_switch()) break :blk_0 true;5167 if (try p.parseKEYWORD_switch()) break :blk_0 true;
4942 p.i = pos_0;5168 p.i = pos_0;
4943 if (p.parseKEYWORD_test()) break :blk_0 true;5169 if (try p.parseKEYWORD_test()) break :blk_0 true;
4944 p.i = pos_0;5170 p.i = pos_0;
4945 if (p.parseKEYWORD_threadlocal()) break :blk_0 true;5171 if (try p.parseKEYWORD_threadlocal()) break :blk_0 true;
4946 p.i = pos_0;5172 p.i = pos_0;
4947 if (p.parseKEYWORD_try()) break :blk_0 true;5173 if (try p.parseKEYWORD_try()) break :blk_0 true;
4948 p.i = pos_0;5174 p.i = pos_0;
4949 if (p.parseKEYWORD_union()) break :blk_0 true;5175 if (try p.parseKEYWORD_union()) break :blk_0 true;
4950 p.i = pos_0;5176 p.i = pos_0;
4951 if (p.parseKEYWORD_unreachable()) break :blk_0 true;5177 if (try p.parseKEYWORD_unreachable()) break :blk_0 true;
4952 p.i = pos_0;5178 p.i = pos_0;
4953 if (p.parseKEYWORD_var()) break :blk_0 true;5179 if (try p.parseKEYWORD_var()) break :blk_0 true;
4954 p.i = pos_0;5180 p.i = pos_0;
4955 if (p.parseKEYWORD_volatile()) break :blk_0 true;5181 if (try p.parseKEYWORD_volatile()) break :blk_0 true;
4956 p.i = pos_0;5182 p.i = pos_0;
4957 if (p.parseKEYWORD_while()) break :blk_0 true;5183 if (try p.parseKEYWORD_while()) break :blk_0 true;
4958 p.i = pos_0;5184 p.i = pos_0;
4959 break :blk_0 false;5185 break :blk_0 false;
4960 };5186 };
tools/gen_parser_oracle.zig+32-10
...@@ -82,16 +82,21 @@ const Generator = struct {...@@ -82,16 +82,21 @@ const Generator = struct {
82 \\82 \\
83 \\const std = @import("std");83 \\const std = @import("std");
84 \\84 \\
85 \\const Error = error{MaxDepth};
86 \\const max_depth = 5;
87 \\
85 \\/// Returns true if the input source is in the language defined by88 \\/// Returns true if the input source is in the language defined by
86 \\/// the grammar.89 \\/// the grammar.
87 \\pub fn parse(source: []const u8) bool {90 \\/// Returns error.MaxDepth if more than `max_depth` levels of recursion/iteration are reached.
88 \\ var p: Parser = .{ .source = source, .i = 0 };91 \\pub fn parse(source: []const u8) Error!bool {
92 \\ var p: Parser = .{ .source = source, .i = 0, .expr_depth = 1 };
89 \\ return p.parseRoot();93 \\ return p.parseRoot();
90 \\}94 \\}
91 \\95 \\
92 \\const Parser = struct {96 \\const Parser = struct {
93 \\ source: []const u8,97 \\ source: []const u8,
94 \\ i: usize,98 \\ i: usize,
99 \\ expr_depth: usize,
95 \\100 \\
96 );101 );
97 for (g.p.getExtra(node.get(g.p).root)) |def| {102 for (g.p.getExtra(node.get(g.p).root)) |def| {
...@@ -104,7 +109,15 @@ const Generator = struct {...@@ -104,7 +109,15 @@ const Generator = struct {
104 const def = node.get(g.p).def;109 const def = node.get(g.p).def;
105 const id = def.id.get(g.p).id;110 const id = def.id.get(g.p).id;
106 assert(g.suffix == 0);111 assert(g.suffix == 0);
107 try g.w.print("pub fn parse{s}(p: *Parser) bool {{ return ", .{id});112 try g.w.print("pub fn parse{s}(p: *Parser) Error!bool {{", .{id});
113 if (mem.eql(u8, "Expr", id)) {
114 try g.w.print(
115 \\if (p.expr_depth >= max_depth) return error.MaxDepth;
116 \\p.expr_depth += 1;
117 \\defer p.expr_depth -= 1;
118 , .{});
119 }
120 try g.w.writeAll("return ");
108 try g.genExpr(def.expr);121 try g.genExpr(def.expr);
109 try g.w.writeAll(";}");122 try g.w.writeAll(";}");
110 }123 }
...@@ -139,7 +152,7 @@ const Generator = struct {...@@ -139,7 +152,7 @@ const Generator = struct {
139 g.suffix += 1;152 g.suffix += 1;
140 defer g.suffix -= 1;153 defer g.suffix -= 1;
141 switch (node.get(g.p)) {154 switch (node.get(g.p)) {
142 .id => |id| try g.w.print("p.parse{s}()", .{id}),155 .id => |id| try g.w.print("try p.parse{s}()", .{id}),
143 .expr => try g.genExpr(node),156 .expr => try g.genExpr(node),
144 .@"&" => |child| {157 .@"&" => |child| {
145 // XXX forbid unbounded lookahead158 // XXX forbid unbounded lookahead
...@@ -179,25 +192,34 @@ const Generator = struct {...@@ -179,25 +192,34 @@ const Generator = struct {
179 .@"*" => |child| {192 .@"*" => |child| {
180 try g.w.print(193 try g.w.print(
181 \\blk_{d}: {{194 \\blk_{d}: {{
195 \\var i_{d}: usize = 0;
182 \\while (196 \\while (
183 , .{suffix});197 , .{ suffix, suffix });
184 try g.genNode(child);198 try g.genNode(child);
185 try g.w.print(199 try g.w.print(
186 \\) {{}}200 \\) {{
201 \\ if (i_{d} > max_depth) return error.MaxDepth;
202 \\ i_{d} += 1;
203 \\}}
187 \\break :blk_{d} true; }}204 \\break :blk_{d} true; }}
188 , .{suffix});205 , .{ suffix, suffix, suffix });
189 },206 },
190 .@"+" => |child| {207 .@"+" => |child| {
191 try g.w.print(208 try g.w.print(
192 \\blk_{d}: {{209 \\blk_{d}: {{
193 \\var match_{d} = false;210 \\var match_{d} = false;
211 \\var i_{d}: usize = 0;
194 \\while (212 \\while (
195 , .{ suffix, suffix });213 , .{ suffix, suffix, suffix });
196 try g.genNode(child);214 try g.genNode(child);
197 try g.w.print(215 try g.w.print(
198 \\) {{ match_{d} = true; }}216 \\) {{
217 \\ match_{d} = true;
218 \\ if (i_{d} > max_depth) return error.MaxDepth;
219 \\ i_{d} += 1;
220 \\}}
199 \\break :blk_{d} match_{d}; }}221 \\break :blk_{d} match_{d}; }}
200 , .{ suffix, suffix, suffix });222 , .{ suffix, suffix, suffix, suffix, suffix });
201 },223 },
202 .@"." => {224 .@"." => {
203 try g.w.print(225 try g.w.print(