| ... | ... | @@ -3,59 +3,76 @@ |
| 3 | 3 | |
| 4 | 4 | const std = @import("std"); |
| 5 | 5 | |
| 6 | const Error = error{MaxDepth}; |
| 7 | const max_depth = 5; |
| 8 | |
| 6 | 9 | /// Returns true if the input source is in the language defined by |
| 7 | 10 | /// the grammar. |
| 8 | | pub fn parse(source: []const u8) bool { |
| 9 | | var p: Parser = .{ .source = source, .i = 0 }; |
| 11 | /// Returns error.MaxDepth if more than `max_depth` levels of recursion/iteration are reached. |
| 12 | pub fn parse(source: []const u8) Error!bool { |
| 13 | var p: Parser = .{ .source = source, .i = 0, .expr_depth = 1 }; |
| 10 | 14 | return p.parseRoot(); |
| 11 | 15 | } |
| 12 | 16 | |
| 13 | 17 | const Parser = struct { |
| 14 | 18 | source: []const u8, |
| 15 | 19 | i: usize, |
| 16 | | pub fn parseRoot(p: *Parser) bool { |
| 20 | expr_depth: usize, |
| 21 | pub fn parseRoot(p: *Parser) Error!bool { |
| 17 | 22 | return blk_0: { |
| 18 | 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 | 25 | p.i = pos_0; |
| 21 | 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 | 30 | return blk_0: { |
| 26 | 31 | const pos_0 = p.i; |
| 27 | | if ((p.parsecontainer_doc_comment() or true) and blk_1: { |
| 28 | | while (p.parseContainerDecl()) {} |
| 32 | if ((try p.parsecontainer_doc_comment() or true) and blk_1: { |
| 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 | 38 | break :blk_1 true; |
| 30 | 39 | } and blk_1: { |
| 31 | 40 | const pos_1 = p.i; |
| 32 | | const match_1 = p.parseContainerDeclPrefix(); |
| 41 | const match_1 = try p.parseContainerDeclPrefix(); |
| 33 | 42 | p.i = pos_1; |
| 34 | 43 | break :blk_1 !match_1; |
| 35 | 44 | } and blk_1: { |
| 45 | var i_1: usize = 0; |
| 36 | 46 | while (blk_3: { |
| 37 | 47 | const pos_3 = p.i; |
| 38 | 48 | if (blk_4: { |
| 39 | 49 | const pos_4 = p.i; |
| 40 | | const match_4 = p.parseContainerDeclPrefix(); |
| 50 | const match_4 = try p.parseContainerDeclPrefix(); |
| 41 | 51 | p.i = pos_4; |
| 42 | 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 | 54 | p.i = pos_3; |
| 45 | 55 | break :blk_3 false; |
| 46 | | }) {} |
| 56 | }) { |
| 57 | if (i_1 > max_depth) return error.MaxDepth; |
| 58 | i_1 += 1; |
| 59 | } |
| 47 | 60 | break :blk_1 true; |
| 48 | 61 | } and blk_2: { |
| 49 | 62 | const pos_2 = p.i; |
| 50 | 63 | if (blk_3: { |
| 51 | 64 | const pos_3 = p.i; |
| 52 | | const match_3 = p.parseContainerDeclPrefix(); |
| 65 | const match_3 = try p.parseContainerDeclPrefix(); |
| 53 | 66 | p.i = pos_3; |
| 54 | 67 | break :blk_3 !match_3; |
| 55 | | } and p.parseContainerField()) break :blk_2 true; |
| 68 | } and try p.parseContainerField()) break :blk_2 true; |
| 56 | 69 | p.i = pos_2; |
| 57 | 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 | 76 | break :blk_3 true; |
| 60 | 77 | }) break :blk_2 true; |
| 61 | 78 | p.i = pos_2; |
| ... | ... | @@ -65,116 +82,116 @@ const Parser = struct { |
| 65 | 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 | 86 | return blk_0: { |
| 70 | 87 | const pos_0 = p.i; |
| 71 | | if (p.parseTestDecl()) break :blk_0 true; |
| 88 | if (try p.parseTestDecl()) break :blk_0 true; |
| 72 | 89 | p.i = pos_0; |
| 73 | | if (p.parseComptimeDecl()) break :blk_0 true; |
| 90 | if (try p.parseComptimeDecl()) break :blk_0 true; |
| 74 | 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 | 93 | p.i = pos_0; |
| 77 | 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 | 98 | return blk_0: { |
| 82 | 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 | 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 | 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 | 105 | p.i = pos_0; |
| 89 | 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 | 110 | return blk_0: { |
| 94 | 111 | const pos_0 = p.i; |
| 95 | | if (p.parseKEYWORD_test() and (blk_3: { |
| 112 | if (try p.parseKEYWORD_test() and (blk_3: { |
| 96 | 113 | const pos_3 = p.i; |
| 97 | | if (p.parseSTRINGLITERALSINGLE()) break :blk_3 true; |
| 114 | if (try p.parseSTRINGLITERALSINGLE()) break :blk_3 true; |
| 98 | 115 | p.i = pos_3; |
| 99 | | if (p.parseIDENTIFIER()) break :blk_3 true; |
| 116 | if (try p.parseIDENTIFIER()) break :blk_3 true; |
| 100 | 117 | p.i = pos_3; |
| 101 | 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 | 120 | p.i = pos_0; |
| 104 | 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 | 125 | return blk_0: { |
| 109 | 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 | 128 | p.i = pos_0; |
| 112 | 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 | 133 | return blk_0: { |
| 117 | 134 | const pos_0 = p.i; |
| 118 | 135 | if ((blk_3: { |
| 119 | 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 | 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 | 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 | 142 | p.i = pos_3; |
| 126 | 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 | 145 | const pos_2 = p.i; |
| 129 | | if (p.parseSEMICOLON()) break :blk_2 true; |
| 146 | if (try p.parseSEMICOLON()) break :blk_2 true; |
| 130 | 147 | p.i = pos_2; |
| 131 | | if (p.parseBlock()) break :blk_2 true; |
| 148 | if (try p.parseBlock()) break :blk_2 true; |
| 132 | 149 | p.i = pos_2; |
| 133 | 150 | break :blk_2 false; |
| 134 | 151 | }) break :blk_0 true; |
| 135 | 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 | 154 | p.i = pos_0; |
| 138 | 155 | if ((blk_3: { |
| 139 | 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 | 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 | 160 | p.i = pos_3; |
| 144 | 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 | 163 | p.i = pos_0; |
| 147 | 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 | 168 | return blk_0: { |
| 152 | 169 | const pos_0 = p.i; |
| 153 | 170 | if ((blk_3: { |
| 154 | 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 | 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 | 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 | 177 | p.i = pos_3; |
| 161 | 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 | 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 | 182 | p.i = pos_0; |
| 166 | 183 | if ((blk_3: { |
| 167 | 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 | 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 | 188 | p.i = pos_3; |
| 172 | 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 | 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 | 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 | 195 | p.i = pos_2; |
| 179 | 196 | break :blk_2 false; |
| 180 | 197 | }) break :blk_0 true; |
| ... | ... | @@ -182,58 +199,58 @@ const Parser = struct { |
| 182 | 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 | 203 | return blk_0: { |
| 187 | 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 | 206 | p.i = pos_0; |
| 190 | 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 | 211 | return blk_0: { |
| 195 | 212 | const pos_0 = p.i; |
| 196 | 213 | if (blk_2: { |
| 197 | 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 | 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 | 218 | p.i = pos_2; |
| 202 | 219 | break :blk_2 false; |
| 203 | | } and p.parseIDENTIFIER() and (blk_3: { |
| 220 | } and try p.parseIDENTIFIER() and (blk_3: { |
| 204 | 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 | 223 | p.i = pos_3; |
| 207 | 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 | 226 | p.i = pos_0; |
| 210 | 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 | 231 | return blk_0: { |
| 215 | 232 | const pos_0 = p.i; |
| 216 | | if (p.parseVarDeclProto() and (blk_3: { |
| 233 | if (try p.parseVarDeclProto() and (blk_3: { |
| 217 | 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 | 236 | p.i = pos_3; |
| 220 | 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 | 239 | p.i = pos_0; |
| 223 | 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 | 244 | return blk_0: { |
| 228 | 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 | 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 | 249 | p.i = pos_3; |
| 233 | 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 | 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 | 254 | p.i = pos_3; |
| 238 | 255 | break :blk_3 false; |
| 239 | 256 | } or true)) break :blk_0 true; |
| ... | ... | @@ -241,68 +258,68 @@ const Parser = struct { |
| 241 | 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 | 262 | return blk_0: { |
| 246 | 263 | const pos_0 = p.i; |
| 247 | | if (p.parseStatement()) break :blk_0 true; |
| 264 | if (try p.parseStatement()) break :blk_0 true; |
| 248 | 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 | 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 | 269 | p.i = pos_0; |
| 253 | 270 | if ((blk_3: { |
| 254 | 271 | const pos_3 = p.i; |
| 255 | | if (p.parseKEYWORD_comptime() and blk_4: { |
| 272 | if (try p.parseKEYWORD_comptime() and blk_4: { |
| 256 | 273 | const pos_4 = p.i; |
| 257 | | const match_4 = p.parseBlockExprPrefix(); |
| 274 | const match_4 = try p.parseBlockExprPrefix(); |
| 258 | 275 | p.i = pos_4; |
| 259 | 276 | break :blk_4 !match_4; |
| 260 | 277 | }) break :blk_3 true; |
| 261 | 278 | p.i = pos_3; |
| 262 | 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 | 281 | p.i = pos_0; |
| 265 | 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 | 286 | return blk_0: { |
| 270 | 287 | const pos_0 = p.i; |
| 271 | | if (p.parseIfStatement()) break :blk_0 true; |
| 288 | if (try p.parseIfStatement()) break :blk_0 true; |
| 272 | 289 | p.i = pos_0; |
| 273 | | if (p.parseLabeledStatement()) break :blk_0 true; |
| 290 | if (try p.parseLabeledStatement()) break :blk_0 true; |
| 274 | 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 | 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 | 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 | 297 | p.i = pos_0; |
| 281 | 298 | if ((blk_3: { |
| 282 | 299 | const pos_3 = p.i; |
| 283 | | if (p.parseKEYWORD_comptime() and blk_4: { |
| 300 | if (try p.parseKEYWORD_comptime() and blk_4: { |
| 284 | 301 | const pos_4 = p.i; |
| 285 | | const match_4 = p.parseBlockExprPrefix(); |
| 302 | const match_4 = try p.parseBlockExprPrefix(); |
| 286 | 303 | p.i = pos_4; |
| 287 | 304 | break :blk_4 !match_4; |
| 288 | 305 | }) break :blk_3 true; |
| 289 | 306 | p.i = pos_3; |
| 290 | 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 | 309 | p.i = pos_0; |
| 293 | 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 | 314 | return blk_0: { |
| 298 | 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 | 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 | 319 | p.i = pos_2; |
| 303 | 320 | if (blk_3: { |
| 304 | 321 | const pos_3 = p.i; |
| 305 | | const match_3 = p.parseKEYWORD_else(); |
| 322 | const match_3 = try p.parseKEYWORD_else(); |
| 306 | 323 | p.i = pos_3; |
| 307 | 324 | break :blk_3 !match_3; |
| 308 | 325 | }) break :blk_2 true; |
| ... | ... | @@ -310,16 +327,16 @@ const Parser = struct { |
| 310 | 327 | break :blk_2 false; |
| 311 | 328 | }) break :blk_0 true; |
| 312 | 329 | p.i = pos_0; |
| 313 | | if (p.parseIfPrefix() and blk_1: { |
| 330 | if (try p.parseIfPrefix() and blk_1: { |
| 314 | 331 | const pos_1 = p.i; |
| 315 | | const match_1 = p.parseBlockExprPrefix(); |
| 332 | const match_1 = try p.parseBlockExprPrefix(); |
| 316 | 333 | p.i = pos_1; |
| 317 | 334 | break :blk_1 !match_1; |
| 318 | | } and p.parseAssignExpr() and blk_2: { |
| 335 | } and try p.parseAssignExpr() and blk_2: { |
| 319 | 336 | const pos_2 = p.i; |
| 320 | | if (p.parseSEMICOLON()) break :blk_2 true; |
| 337 | if (try p.parseSEMICOLON()) break :blk_2 true; |
| 321 | 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 | 340 | p.i = pos_2; |
| 324 | 341 | break :blk_2 false; |
| 325 | 342 | }) break :blk_0 true; |
| ... | ... | @@ -327,16 +344,16 @@ const Parser = struct { |
| 327 | 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 | 348 | return blk_0: { |
| 332 | 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 | 351 | const pos_2 = p.i; |
| 335 | | if (p.parseBlock()) break :blk_2 true; |
| 352 | if (try p.parseBlock()) break :blk_2 true; |
| 336 | 353 | p.i = pos_2; |
| 337 | | if (p.parseLoopStatement()) break :blk_2 true; |
| 354 | if (try p.parseLoopStatement()) break :blk_2 true; |
| 338 | 355 | p.i = pos_2; |
| 339 | | if (p.parseSwitchExpr()) break :blk_2 true; |
| 356 | if (try p.parseSwitchExpr()) break :blk_2 true; |
| 340 | 357 | p.i = pos_2; |
| 341 | 358 | break :blk_2 false; |
| 342 | 359 | }) break :blk_0 true; |
| ... | ... | @@ -344,14 +361,14 @@ const Parser = struct { |
| 344 | 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 | 365 | return blk_0: { |
| 349 | 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 | 368 | const pos_2 = p.i; |
| 352 | | if (p.parseForStatement()) break :blk_2 true; |
| 369 | if (try p.parseForStatement()) break :blk_2 true; |
| 353 | 370 | p.i = pos_2; |
| 354 | | if (p.parseWhileStatement()) break :blk_2 true; |
| 371 | if (try p.parseWhileStatement()) break :blk_2 true; |
| 355 | 372 | p.i = pos_2; |
| 356 | 373 | break :blk_2 false; |
| 357 | 374 | }) break :blk_0 true; |
| ... | ... | @@ -359,16 +376,16 @@ const Parser = struct { |
| 359 | 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 | 380 | return blk_0: { |
| 364 | 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 | 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 | 385 | p.i = pos_2; |
| 369 | 386 | if (blk_3: { |
| 370 | 387 | const pos_3 = p.i; |
| 371 | | const match_3 = p.parseKEYWORD_else(); |
| 388 | const match_3 = try p.parseKEYWORD_else(); |
| 372 | 389 | p.i = pos_3; |
| 373 | 390 | break :blk_3 !match_3; |
| 374 | 391 | }) break :blk_2 true; |
| ... | ... | @@ -376,16 +393,16 @@ const Parser = struct { |
| 376 | 393 | break :blk_2 false; |
| 377 | 394 | }) break :blk_0 true; |
| 378 | 395 | p.i = pos_0; |
| 379 | | if (p.parseForPrefix() and blk_1: { |
| 396 | if (try p.parseForPrefix() and blk_1: { |
| 380 | 397 | const pos_1 = p.i; |
| 381 | | const match_1 = p.parseBlockExprPrefix(); |
| 398 | const match_1 = try p.parseBlockExprPrefix(); |
| 382 | 399 | p.i = pos_1; |
| 383 | 400 | break :blk_1 !match_1; |
| 384 | | } and p.parseAssignExpr() and blk_2: { |
| 401 | } and try p.parseAssignExpr() and blk_2: { |
| 385 | 402 | const pos_2 = p.i; |
| 386 | | if (p.parseSEMICOLON()) break :blk_2 true; |
| 403 | if (try p.parseSEMICOLON()) break :blk_2 true; |
| 387 | 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 | 406 | p.i = pos_2; |
| 390 | 407 | break :blk_2 false; |
| 391 | 408 | }) break :blk_0 true; |
| ... | ... | @@ -393,16 +410,16 @@ const Parser = struct { |
| 393 | 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 | 414 | return blk_0: { |
| 398 | 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 | 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 | 419 | p.i = pos_2; |
| 403 | 420 | if (blk_3: { |
| 404 | 421 | const pos_3 = p.i; |
| 405 | | const match_3 = p.parseKEYWORD_else(); |
| 422 | const match_3 = try p.parseKEYWORD_else(); |
| 406 | 423 | p.i = pos_3; |
| 407 | 424 | break :blk_3 !match_3; |
| 408 | 425 | }) break :blk_2 true; |
| ... | ... | @@ -410,16 +427,16 @@ const Parser = struct { |
| 410 | 427 | break :blk_2 false; |
| 411 | 428 | }) break :blk_0 true; |
| 412 | 429 | p.i = pos_0; |
| 413 | | if (p.parseWhilePrefix() and blk_1: { |
| 430 | if (try p.parseWhilePrefix() and blk_1: { |
| 414 | 431 | const pos_1 = p.i; |
| 415 | | const match_1 = p.parseBlockExprPrefix(); |
| 432 | const match_1 = try p.parseBlockExprPrefix(); |
| 416 | 433 | p.i = pos_1; |
| 417 | 434 | break :blk_1 !match_1; |
| 418 | | } and p.parseAssignExpr() and blk_2: { |
| 435 | } and try p.parseAssignExpr() and blk_2: { |
| 419 | 436 | const pos_2 = p.i; |
| 420 | | if (p.parseSEMICOLON()) break :blk_2 true; |
| 437 | if (try p.parseSEMICOLON()) break :blk_2 true; |
| 421 | 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 | 440 | p.i = pos_2; |
| 424 | 441 | break :blk_2 false; |
| 425 | 442 | }) break :blk_0 true; |
| ... | ... | @@ -427,95 +444,102 @@ const Parser = struct { |
| 427 | 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 | 448 | return blk_0: { |
| 432 | 449 | const pos_0 = p.i; |
| 433 | | if (p.parseBlockExpr()) break :blk_0 true; |
| 450 | if (try p.parseBlockExpr()) break :blk_0 true; |
| 434 | 451 | p.i = pos_0; |
| 435 | 452 | if (blk_1: { |
| 436 | 453 | const pos_1 = p.i; |
| 437 | | const match_1 = p.parseBlockExprPrefix(); |
| 454 | const match_1 = try p.parseBlockExprPrefix(); |
| 438 | 455 | p.i = pos_1; |
| 439 | 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 | 458 | p.i = pos_0; |
| 442 | 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 | 463 | return blk_0: { |
| 447 | 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 | 466 | p.i = pos_0; |
| 450 | 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 | 471 | return blk_0: { |
| 455 | 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 | 474 | p.i = pos_0; |
| 458 | 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 | 479 | return blk_0: { |
| 463 | 480 | const pos_0 = p.i; |
| 464 | 481 | if (blk_2: { |
| 465 | 482 | const pos_2 = p.i; |
| 466 | | if (p.parseVarDeclProto()) break :blk_2 true; |
| 483 | if (try p.parseVarDeclProto()) break :blk_2 true; |
| 467 | 484 | p.i = pos_2; |
| 468 | | if (p.parseExpr()) break :blk_2 true; |
| 485 | if (try p.parseExpr()) break :blk_2 true; |
| 469 | 486 | p.i = pos_2; |
| 470 | 487 | break :blk_2 false; |
| 471 | 488 | } and blk_1: { |
| 489 | var i_1: usize = 0; |
| 472 | 490 | while (blk_3: { |
| 473 | 491 | const pos_3 = p.i; |
| 474 | | if (p.parseCOMMA() and blk_5: { |
| 492 | if (try p.parseCOMMA() and blk_5: { |
| 475 | 493 | const pos_5 = p.i; |
| 476 | | if (p.parseVarDeclProto()) break :blk_5 true; |
| 494 | if (try p.parseVarDeclProto()) break :blk_5 true; |
| 477 | 495 | p.i = pos_5; |
| 478 | | if (p.parseExpr()) break :blk_5 true; |
| 496 | if (try p.parseExpr()) break :blk_5 true; |
| 479 | 497 | p.i = pos_5; |
| 480 | 498 | break :blk_5 false; |
| 481 | 499 | }) break :blk_3 true; |
| 482 | 500 | p.i = pos_3; |
| 483 | 501 | break :blk_3 false; |
| 484 | | }) {} |
| 502 | }) { |
| 503 | if (i_1 > max_depth) return error.MaxDepth; |
| 504 | i_1 += 1; |
| 505 | } |
| 485 | 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 | 508 | p.i = pos_0; |
| 488 | 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 | 513 | return blk_0: { |
| 493 | 514 | const pos_0 = p.i; |
| 494 | | if (p.parseExpr() and blk_2: { |
| 515 | if (try p.parseExpr() and blk_2: { |
| 495 | 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 | 518 | p.i = pos_2; |
| 498 | 519 | if (blk_3: { |
| 499 | 520 | var match_3 = false; |
| 521 | var i_3: usize = 0; |
| 500 | 522 | while (blk_5: { |
| 501 | 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 | 525 | p.i = pos_5; |
| 504 | 526 | break :blk_5 false; |
| 505 | 527 | }) { |
| 506 | 528 | match_3 = true; |
| 529 | if (i_3 > max_depth) return error.MaxDepth; |
| 530 | i_3 += 1; |
| 507 | 531 | } |
| 508 | 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 | 534 | p.i = pos_2; |
| 511 | 535 | if (blk_3: { |
| 512 | 536 | const pos_3 = p.i; |
| 513 | | const match_3 = p.parseAssignOp(); |
| 537 | const match_3 = try p.parseAssignOp(); |
| 514 | 538 | p.i = pos_3; |
| 515 | 539 | break :blk_3 !match_3; |
| 516 | 540 | } and blk_3: { |
| 517 | 541 | const pos_3 = p.i; |
| 518 | | const match_3 = p.parseCOMMA(); |
| 542 | const match_3 = try p.parseCOMMA(); |
| 519 | 543 | p.i = pos_3; |
| 520 | 544 | break :blk_3 !match_3; |
| 521 | 545 | }) break :blk_2 true; |
| ... | ... | @@ -526,16 +550,16 @@ const Parser = struct { |
| 526 | 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 | 554 | return blk_0: { |
| 531 | 555 | const pos_0 = p.i; |
| 532 | | if (p.parseExpr() and blk_2: { |
| 556 | if (try p.parseExpr() and blk_2: { |
| 533 | 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 | 559 | p.i = pos_2; |
| 536 | 560 | if (blk_3: { |
| 537 | 561 | const pos_3 = p.i; |
| 538 | | const match_3 = p.parseAssignOp(); |
| 562 | const match_3 = try p.parseAssignOp(); |
| 539 | 563 | p.i = pos_3; |
| 540 | 564 | break :blk_3 !match_3; |
| 541 | 565 | }) break :blk_2 true; |
| ... | ... | @@ -546,28 +570,35 @@ const Parser = struct { |
| 546 | 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 | 577 | return blk_0: { |
| 551 | 578 | const pos_0 = p.i; |
| 552 | | if (p.parseBoolOrExpr()) break :blk_0 true; |
| 579 | if (try p.parseBoolOrExpr()) break :blk_0 true; |
| 553 | 580 | p.i = pos_0; |
| 554 | 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 | 585 | return blk_0: { |
| 559 | 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 | 589 | while (blk_3: { |
| 562 | 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 | 592 | p.i = pos_3; |
| 565 | 593 | break :blk_3 false; |
| 566 | | }) {} |
| 594 | }) { |
| 595 | if (i_1 > max_depth) return error.MaxDepth; |
| 596 | i_1 += 1; |
| 597 | } |
| 567 | 598 | break :blk_1 true; |
| 568 | 599 | } and blk_1: { |
| 569 | 600 | const pos_1 = p.i; |
| 570 | | const match_1 = p.parseOrOp(); |
| 601 | const match_1 = try p.parseOrOp(); |
| 571 | 602 | p.i = pos_1; |
| 572 | 603 | break :blk_1 !match_1; |
| 573 | 604 | }) break :blk_0 true; |
| ... | ... | @@ -575,20 +606,24 @@ const Parser = struct { |
| 575 | 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 | 610 | return blk_0: { |
| 580 | 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 | 614 | while (blk_3: { |
| 583 | 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 | 617 | p.i = pos_3; |
| 586 | 618 | break :blk_3 false; |
| 587 | | }) {} |
| 619 | }) { |
| 620 | if (i_1 > max_depth) return error.MaxDepth; |
| 621 | i_1 += 1; |
| 622 | } |
| 588 | 623 | break :blk_1 true; |
| 589 | 624 | } and blk_1: { |
| 590 | 625 | const pos_1 = p.i; |
| 591 | | const match_1 = p.parseAndOp(); |
| 626 | const match_1 = try p.parseAndOp(); |
| 592 | 627 | p.i = pos_1; |
| 593 | 628 | break :blk_1 !match_1; |
| 594 | 629 | }) break :blk_0 true; |
| ... | ... | @@ -596,16 +631,16 @@ const Parser = struct { |
| 596 | 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 | 635 | return blk_0: { |
| 601 | 636 | const pos_0 = p.i; |
| 602 | | if (p.parseBitwiseExpr() and blk_2: { |
| 637 | if (try p.parseBitwiseExpr() and blk_2: { |
| 603 | 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 | 640 | p.i = pos_2; |
| 606 | 641 | if (blk_3: { |
| 607 | 642 | const pos_3 = p.i; |
| 608 | | const match_3 = p.parseCompareOp(); |
| 643 | const match_3 = try p.parseCompareOp(); |
| 609 | 644 | p.i = pos_3; |
| 610 | 645 | break :blk_3 !match_3; |
| 611 | 646 | }) break :blk_2 true; |
| ... | ... | @@ -616,20 +651,24 @@ const Parser = struct { |
| 616 | 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 | 655 | return blk_0: { |
| 621 | 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 | 659 | while (blk_3: { |
| 624 | 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 | 662 | p.i = pos_3; |
| 627 | 663 | break :blk_3 false; |
| 628 | | }) {} |
| 664 | }) { |
| 665 | if (i_1 > max_depth) return error.MaxDepth; |
| 666 | i_1 += 1; |
| 667 | } |
| 629 | 668 | break :blk_1 true; |
| 630 | 669 | } and blk_1: { |
| 631 | 670 | const pos_1 = p.i; |
| 632 | | const match_1 = p.parseBitwiseOp(); |
| 671 | const match_1 = try p.parseBitwiseOp(); |
| 633 | 672 | p.i = pos_1; |
| 634 | 673 | break :blk_1 !match_1; |
| 635 | 674 | }) break :blk_0 true; |
| ... | ... | @@ -637,20 +676,24 @@ const Parser = struct { |
| 637 | 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 | 680 | return blk_0: { |
| 642 | 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 | 684 | while (blk_3: { |
| 645 | 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 | 687 | p.i = pos_3; |
| 648 | 688 | break :blk_3 false; |
| 649 | | }) {} |
| 689 | }) { |
| 690 | if (i_1 > max_depth) return error.MaxDepth; |
| 691 | i_1 += 1; |
| 692 | } |
| 650 | 693 | break :blk_1 true; |
| 651 | 694 | } and blk_1: { |
| 652 | 695 | const pos_1 = p.i; |
| 653 | | const match_1 = p.parseBitShiftOp(); |
| 696 | const match_1 = try p.parseBitShiftOp(); |
| 654 | 697 | p.i = pos_1; |
| 655 | 698 | break :blk_1 !match_1; |
| 656 | 699 | }) break :blk_0 true; |
| ... | ... | @@ -658,20 +701,24 @@ const Parser = struct { |
| 658 | 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 | 705 | return blk_0: { |
| 663 | 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 | 709 | while (blk_3: { |
| 666 | 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 | 712 | p.i = pos_3; |
| 669 | 713 | break :blk_3 false; |
| 670 | | }) {} |
| 714 | }) { |
| 715 | if (i_1 > max_depth) return error.MaxDepth; |
| 716 | i_1 += 1; |
| 717 | } |
| 671 | 718 | break :blk_1 true; |
| 672 | 719 | } and blk_1: { |
| 673 | 720 | const pos_1 = p.i; |
| 674 | | const match_1 = p.parseAdditionOp(); |
| 721 | const match_1 = try p.parseAdditionOp(); |
| 675 | 722 | p.i = pos_1; |
| 676 | 723 | break :blk_1 !match_1; |
| 677 | 724 | }) break :blk_0 true; |
| ... | ... | @@ -679,20 +726,24 @@ const Parser = struct { |
| 679 | 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 | 730 | return blk_0: { |
| 684 | 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 | 734 | while (blk_3: { |
| 687 | 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 | 737 | p.i = pos_3; |
| 690 | 738 | break :blk_3 false; |
| 691 | | }) {} |
| 739 | }) { |
| 740 | if (i_1 > max_depth) return error.MaxDepth; |
| 741 | i_1 += 1; |
| 742 | } |
| 692 | 743 | break :blk_1 true; |
| 693 | 744 | } and blk_1: { |
| 694 | 745 | const pos_1 = p.i; |
| 695 | | const match_1 = p.parseMultiplyOp(); |
| 746 | const match_1 = try p.parseMultiplyOp(); |
| 696 | 747 | p.i = pos_1; |
| 697 | 748 | break :blk_1 !match_1; |
| 698 | 749 | }) break :blk_0 true; |
| ... | ... | @@ -700,36 +751,40 @@ const Parser = struct { |
| 700 | 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 | 755 | return blk_0: { |
| 705 | 756 | const pos_0 = p.i; |
| 706 | 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 | 763 | break :blk_1 true; |
| 709 | 764 | } and blk_1: { |
| 710 | 765 | const pos_1 = p.i; |
| 711 | | const match_1 = p.parsePrefixOp(); |
| 766 | const match_1 = try p.parsePrefixOp(); |
| 712 | 767 | p.i = pos_1; |
| 713 | 768 | break :blk_1 !match_1; |
| 714 | | } and p.parsePrimaryExpr()) break :blk_0 true; |
| 769 | } and try p.parsePrimaryExpr()) break :blk_0 true; |
| 715 | 770 | p.i = pos_0; |
| 716 | 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 | 775 | return blk_0: { |
| 721 | 776 | const pos_0 = p.i; |
| 722 | | if (p.parseAsmExpr()) break :blk_0 true; |
| 777 | if (try p.parseAsmExpr()) break :blk_0 true; |
| 723 | 778 | p.i = pos_0; |
| 724 | | if (p.parseIfExpr()) break :blk_0 true; |
| 779 | if (try p.parseIfExpr()) break :blk_0 true; |
| 725 | 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 | 782 | const pos_2 = p.i; |
| 728 | | if (p.parseExpr()) break :blk_2 true; |
| 783 | if (try p.parseExpr()) break :blk_2 true; |
| 729 | 784 | p.i = pos_2; |
| 730 | 785 | if (blk_3: { |
| 731 | 786 | const pos_3 = p.i; |
| 732 | | const match_3 = p.parseExprPrefix(); |
| 787 | const match_3 = try p.parseExprPrefix(); |
| 733 | 788 | p.i = pos_3; |
| 734 | 789 | break :blk_3 !match_3; |
| 735 | 790 | }) break :blk_2 true; |
| ... | ... | @@ -737,17 +792,17 @@ const Parser = struct { |
| 737 | 792 | break :blk_2 false; |
| 738 | 793 | }) break :blk_0 true; |
| 739 | 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 | 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 | 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 | 800 | const pos_2 = p.i; |
| 746 | | if (p.parseExpr()) break :blk_2 true; |
| 801 | if (try p.parseExpr()) break :blk_2 true; |
| 747 | 802 | p.i = pos_2; |
| 748 | 803 | if (blk_3: { |
| 749 | 804 | const pos_3 = p.i; |
| 750 | | const match_3 = p.parseExprPrefix(); |
| 805 | const match_3 = try p.parseExprPrefix(); |
| 751 | 806 | p.i = pos_3; |
| 752 | 807 | break :blk_3 !match_3; |
| 753 | 808 | }) break :blk_2 true; |
| ... | ... | @@ -755,15 +810,15 @@ const Parser = struct { |
| 755 | 810 | break :blk_2 false; |
| 756 | 811 | }) break :blk_0 true; |
| 757 | 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 | 814 | p.i = pos_0; |
| 760 | | if (p.parseKEYWORD_return() and blk_2: { |
| 815 | if (try p.parseKEYWORD_return() and blk_2: { |
| 761 | 816 | const pos_2 = p.i; |
| 762 | | if (p.parseExpr()) break :blk_2 true; |
| 817 | if (try p.parseExpr()) break :blk_2 true; |
| 763 | 818 | p.i = pos_2; |
| 764 | 819 | if (blk_3: { |
| 765 | 820 | const pos_3 = p.i; |
| 766 | | const match_3 = p.parseExprPrefix(); |
| 821 | const match_3 = try p.parseExprPrefix(); |
| 767 | 822 | p.i = pos_3; |
| 768 | 823 | break :blk_3 !match_3; |
| 769 | 824 | }) break :blk_2 true; |
| ... | ... | @@ -771,25 +826,25 @@ const Parser = struct { |
| 771 | 826 | break :blk_2 false; |
| 772 | 827 | }) break :blk_0 true; |
| 773 | 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 | 830 | p.i = pos_0; |
| 776 | | if (p.parseBlock()) break :blk_0 true; |
| 831 | if (try p.parseBlock()) break :blk_0 true; |
| 777 | 832 | p.i = pos_0; |
| 778 | | if (p.parseCurlySuffixExpr()) break :blk_0 true; |
| 833 | if (try p.parseCurlySuffixExpr()) break :blk_0 true; |
| 779 | 834 | p.i = pos_0; |
| 780 | 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 | 839 | return blk_0: { |
| 785 | 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 | 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 | 844 | p.i = pos_2; |
| 790 | 845 | if (blk_3: { |
| 791 | 846 | const pos_3 = p.i; |
| 792 | | const match_3 = p.parseKEYWORD_else(); |
| 847 | const match_3 = try p.parseKEYWORD_else(); |
| 793 | 848 | p.i = pos_3; |
| 794 | 849 | break :blk_3 !match_3; |
| 795 | 850 | }) break :blk_2 true; |
| ... | ... | @@ -800,25 +855,29 @@ const Parser = struct { |
| 800 | 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 | 859 | return blk_0: { |
| 805 | 860 | const pos_0 = p.i; |
| 806 | | if (p.parseLBRACE() and blk_1: { |
| 807 | | while (p.parseBlockStatement()) {} |
| 861 | if (try p.parseLBRACE() and blk_1: { |
| 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 | 867 | break :blk_1 true; |
| 809 | | } and p.parseRBRACE()) break :blk_0 true; |
| 868 | } and try p.parseRBRACE()) break :blk_0 true; |
| 810 | 869 | p.i = pos_0; |
| 811 | 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 | 874 | return blk_0: { |
| 816 | 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 | 877 | const pos_2 = p.i; |
| 819 | | if (p.parseForExpr()) break :blk_2 true; |
| 878 | if (try p.parseForExpr()) break :blk_2 true; |
| 820 | 879 | p.i = pos_2; |
| 821 | | if (p.parseWhileExpr()) break :blk_2 true; |
| 880 | if (try p.parseWhileExpr()) break :blk_2 true; |
| 822 | 881 | p.i = pos_2; |
| 823 | 882 | break :blk_2 false; |
| 824 | 883 | }) break :blk_0 true; |
| ... | ... | @@ -826,16 +885,16 @@ const Parser = struct { |
| 826 | 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 | 889 | return blk_0: { |
| 831 | 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 | 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 | 894 | p.i = pos_2; |
| 836 | 895 | if (blk_3: { |
| 837 | 896 | const pos_3 = p.i; |
| 838 | | const match_3 = p.parseKEYWORD_else(); |
| 897 | const match_3 = try p.parseKEYWORD_else(); |
| 839 | 898 | p.i = pos_3; |
| 840 | 899 | break :blk_3 !match_3; |
| 841 | 900 | }) break :blk_2 true; |
| ... | ... | @@ -846,12 +905,12 @@ const Parser = struct { |
| 846 | 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 | 909 | return blk_0: { |
| 851 | 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 | 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 | 914 | p.i = pos_3; |
| 856 | 915 | break :blk_3 false; |
| 857 | 916 | } or true)) break :blk_0 true; |
| ... | ... | @@ -859,16 +918,16 @@ const Parser = struct { |
| 859 | 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 | 922 | return blk_0: { |
| 864 | 923 | const pos_0 = p.i; |
| 865 | | if (p.parseTypeExpr() and blk_2: { |
| 924 | if (try p.parseTypeExpr() and blk_2: { |
| 866 | 925 | const pos_2 = p.i; |
| 867 | | if (p.parseInitList()) break :blk_2 true; |
| 926 | if (try p.parseInitList()) break :blk_2 true; |
| 868 | 927 | p.i = pos_2; |
| 869 | 928 | if (blk_3: { |
| 870 | 929 | const pos_3 = p.i; |
| 871 | | const match_3 = p.parseLBRACE(); |
| 930 | const match_3 = try p.parseLBRACE(); |
| 872 | 931 | p.i = pos_3; |
| 873 | 932 | break :blk_3 !match_3; |
| 874 | 933 | }) break :blk_2 true; |
| ... | ... | @@ -879,60 +938,72 @@ const Parser = struct { |
| 879 | 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 | 942 | return blk_0: { |
| 884 | 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 | 946 | while (blk_3: { |
| 887 | 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 | 949 | p.i = pos_3; |
| 890 | 950 | break :blk_3 false; |
| 891 | | }) {} |
| 951 | }) { |
| 952 | if (i_1 > max_depth) return error.MaxDepth; |
| 953 | i_1 += 1; |
| 954 | } |
| 892 | 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 | 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 | 960 | while (blk_3: { |
| 897 | 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 | 963 | p.i = pos_3; |
| 900 | 964 | break :blk_3 false; |
| 901 | | }) {} |
| 965 | }) { |
| 966 | if (i_1 > max_depth) return error.MaxDepth; |
| 967 | i_1 += 1; |
| 968 | } |
| 902 | 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 | 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 | 973 | p.i = pos_0; |
| 907 | 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 | 978 | return blk_0: { |
| 912 | 979 | const pos_0 = p.i; |
| 913 | 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 | 986 | break :blk_1 true; |
| 916 | 987 | } and blk_1: { |
| 917 | 988 | const pos_1 = p.i; |
| 918 | | const match_1 = p.parsePrefixTypeOpPrefix(); |
| 989 | const match_1 = try p.parsePrefixTypeOpPrefix(); |
| 919 | 990 | p.i = pos_1; |
| 920 | 991 | break :blk_1 !match_1; |
| 921 | | } and p.parseErrorUnionExpr()) break :blk_0 true; |
| 992 | } and try p.parseErrorUnionExpr()) break :blk_0 true; |
| 922 | 993 | p.i = pos_0; |
| 923 | 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 | 998 | return blk_0: { |
| 928 | 999 | const pos_0 = p.i; |
| 929 | | if (p.parseSuffixExpr() and blk_2: { |
| 1000 | if (try p.parseSuffixExpr() and blk_2: { |
| 930 | 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 | 1003 | p.i = pos_2; |
| 933 | 1004 | if (blk_3: { |
| 934 | 1005 | const pos_3 = p.i; |
| 935 | | const match_3 = p.parseEXCLAMATIONMARK(); |
| 1006 | const match_3 = try p.parseEXCLAMATIONMARK(); |
| 936 | 1007 | p.i = pos_3; |
| 937 | 1008 | break :blk_3 !match_3; |
| 938 | 1009 | }) break :blk_2 true; |
| ... | ... | @@ -943,15 +1014,19 @@ const Parser = struct { |
| 943 | 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 | 1018 | return blk_0: { |
| 948 | 1019 | const pos_0 = p.i; |
| 949 | | if (p.parsePrimaryTypeExpr() and blk_1: { |
| 950 | | while (p.parseSuffixOp()) {} |
| 1020 | if (try p.parsePrimaryTypeExpr() and blk_1: { |
| 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 | 1026 | break :blk_1 true; |
| 952 | 1027 | } and blk_1: { |
| 953 | 1028 | const pos_1 = p.i; |
| 954 | | const match_1 = p.parseSuffixOpPrefix(); |
| 1029 | const match_1 = try p.parseSuffixOpPrefix(); |
| 955 | 1030 | p.i = pos_1; |
| 956 | 1031 | break :blk_1 !match_1; |
| 957 | 1032 | }) break :blk_0 true; |
| ... | ... | @@ -959,87 +1034,87 @@ const Parser = struct { |
| 959 | 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 | 1038 | return blk_0: { |
| 964 | 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 | 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 | 1043 | p.i = pos_0; |
| 969 | | if (p.parseContainerType()) break :blk_0 true; |
| 1044 | if (try p.parseContainerType()) break :blk_0 true; |
| 970 | 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 | 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 | 1049 | p.i = pos_0; |
| 975 | | if (p.parseErrorSetDecl()) break :blk_0 true; |
| 1050 | if (try p.parseErrorSetDecl()) break :blk_0 true; |
| 976 | 1051 | p.i = pos_0; |
| 977 | | if (p.parseFnProto()) break :blk_0 true; |
| 1052 | if (try p.parseFnProto()) break :blk_0 true; |
| 978 | 1053 | p.i = pos_0; |
| 979 | | if (p.parseGroupedExpr()) break :blk_0 true; |
| 1054 | if (try p.parseGroupedExpr()) break :blk_0 true; |
| 980 | 1055 | p.i = pos_0; |
| 981 | | if (p.parseLabeledTypeExpr()) break :blk_0 true; |
| 1056 | if (try p.parseLabeledTypeExpr()) break :blk_0 true; |
| 982 | 1057 | p.i = pos_0; |
| 983 | | if (p.parseIDENTIFIER()) break :blk_0 true; |
| 1058 | if (try p.parseIDENTIFIER()) break :blk_0 true; |
| 984 | 1059 | p.i = pos_0; |
| 985 | | if (p.parseIfTypeExpr()) break :blk_0 true; |
| 1060 | if (try p.parseIfTypeExpr()) break :blk_0 true; |
| 986 | 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 | 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 | 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 | 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 | 1069 | p.i = pos_0; |
| 995 | | if (p.parseNUMBERLITERAL()) break :blk_0 true; |
| 1070 | if (try p.parseNUMBERLITERAL()) break :blk_0 true; |
| 996 | 1071 | p.i = pos_0; |
| 997 | | if (p.parseSTRINGLITERAL()) break :blk_0 true; |
| 1072 | if (try p.parseSTRINGLITERAL()) break :blk_0 true; |
| 998 | 1073 | p.i = pos_0; |
| 999 | 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 | 1078 | return blk_0: { |
| 1004 | 1079 | const pos_0 = p.i; |
| 1005 | 1080 | if ((blk_3: { |
| 1006 | 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 | 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 | 1085 | p.i = pos_3; |
| 1011 | 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 | 1088 | p.i = pos_0; |
| 1014 | 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 | 1093 | return blk_0: { |
| 1019 | 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 | 1096 | p.i = pos_0; |
| 1022 | 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 | 1101 | return blk_0: { |
| 1027 | 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 | 1104 | p.i = pos_0; |
| 1030 | 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 | 1109 | return blk_0: { |
| 1035 | 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 | 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 | 1114 | p.i = pos_2; |
| 1040 | 1115 | if (blk_3: { |
| 1041 | 1116 | const pos_3 = p.i; |
| 1042 | | const match_3 = p.parseKEYWORD_else(); |
| 1117 | const match_3 = try p.parseKEYWORD_else(); |
| 1043 | 1118 | p.i = pos_3; |
| 1044 | 1119 | break :blk_3 !match_3; |
| 1045 | 1120 | }) break :blk_2 true; |
| ... | ... | @@ -1050,26 +1125,26 @@ const Parser = struct { |
| 1050 | 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 | 1129 | return blk_0: { |
| 1055 | 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 | 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 | 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 | 1136 | p.i = pos_0; |
| 1062 | 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 | 1141 | return blk_0: { |
| 1067 | 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 | 1144 | const pos_2 = p.i; |
| 1070 | | if (p.parseForTypeExpr()) break :blk_2 true; |
| 1145 | if (try p.parseForTypeExpr()) break :blk_2 true; |
| 1071 | 1146 | p.i = pos_2; |
| 1072 | | if (p.parseWhileTypeExpr()) break :blk_2 true; |
| 1147 | if (try p.parseWhileTypeExpr()) break :blk_2 true; |
| 1073 | 1148 | p.i = pos_2; |
| 1074 | 1149 | break :blk_2 false; |
| 1075 | 1150 | }) break :blk_0 true; |
| ... | ... | @@ -1077,16 +1152,16 @@ const Parser = struct { |
| 1077 | 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 | 1156 | return blk_0: { |
| 1082 | 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 | 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 | 1161 | p.i = pos_2; |
| 1087 | 1162 | if (blk_3: { |
| 1088 | 1163 | const pos_3 = p.i; |
| 1089 | | const match_3 = p.parseKEYWORD_else(); |
| 1164 | const match_3 = try p.parseKEYWORD_else(); |
| 1090 | 1165 | p.i = pos_3; |
| 1091 | 1166 | break :blk_3 !match_3; |
| 1092 | 1167 | }) break :blk_2 true; |
| ... | ... | @@ -1097,16 +1172,16 @@ const Parser = struct { |
| 1097 | 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 | 1176 | return blk_0: { |
| 1102 | 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 | 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 | 1181 | p.i = pos_2; |
| 1107 | 1182 | if (blk_3: { |
| 1108 | 1183 | const pos_3 = p.i; |
| 1109 | | const match_3 = p.parseKEYWORD_else(); |
| 1184 | const match_3 = try p.parseKEYWORD_else(); |
| 1110 | 1185 | p.i = pos_3; |
| 1111 | 1186 | break :blk_3 !match_3; |
| 1112 | 1187 | }) break :blk_2 true; |
| ... | ... | @@ -1117,137 +1192,137 @@ const Parser = struct { |
| 1117 | 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 | 1196 | return blk_0: { |
| 1122 | 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 | 1199 | p.i = pos_0; |
| 1125 | 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 | 1204 | return blk_0: { |
| 1130 | 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 | 1207 | p.i = pos_0; |
| 1133 | 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 | 1212 | return blk_0: { |
| 1138 | 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 | 1215 | p.i = pos_0; |
| 1141 | 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 | 1220 | return blk_0: { |
| 1146 | 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 | 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 | 1225 | p.i = pos_2; |
| 1151 | | if (p.parseIDENTIFIER()) break :blk_2 true; |
| 1226 | if (try p.parseIDENTIFIER()) break :blk_2 true; |
| 1152 | 1227 | p.i = pos_2; |
| 1153 | 1228 | break :blk_2 false; |
| 1154 | | } and p.parseRPAREN()) break :blk_0 true; |
| 1229 | } and try p.parseRPAREN()) break :blk_0 true; |
| 1155 | 1230 | p.i = pos_0; |
| 1156 | 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 | 1235 | return blk_0: { |
| 1161 | 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 | 1238 | p.i = pos_0; |
| 1164 | 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 | 1243 | return blk_0: { |
| 1169 | 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 | 1246 | p.i = pos_0; |
| 1172 | 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 | 1251 | return blk_0: { |
| 1177 | 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 | 1254 | p.i = pos_0; |
| 1180 | 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 | 1259 | return blk_0: { |
| 1185 | 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 | 1262 | p.i = pos_0; |
| 1188 | 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 | 1267 | return blk_0: { |
| 1193 | 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 | 1270 | p.i = pos_0; |
| 1196 | 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 | 1275 | return blk_0: { |
| 1201 | 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 | 1278 | p.i = pos_0; |
| 1204 | 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 | 1283 | return blk_0: { |
| 1209 | 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 | 1286 | p.i = pos_0; |
| 1212 | 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 | 1291 | return blk_0: { |
| 1217 | 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 | 1294 | p.i = pos_0; |
| 1220 | 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 | 1299 | return blk_0: { |
| 1225 | 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 | 1302 | p.i = pos_0; |
| 1228 | 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 | 1307 | return blk_0: { |
| 1233 | 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 | 1310 | p.i = pos_0; |
| 1236 | 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 | 1315 | return blk_0: { |
| 1241 | 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 | 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 | 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 | 1322 | p.i = pos_2; |
| 1248 | 1323 | if (blk_3: { |
| 1249 | 1324 | const pos_3 = p.i; |
| 1250 | | const match_3 = p.parseKEYWORD_comptime(); |
| 1325 | const match_3 = try p.parseKEYWORD_comptime(); |
| 1251 | 1326 | p.i = pos_3; |
| 1252 | 1327 | break :blk_3 !match_3; |
| 1253 | 1328 | }) break :blk_2 true; |
| ... | ... | @@ -1255,13 +1330,13 @@ const Parser = struct { |
| 1255 | 1330 | break :blk_2 false; |
| 1256 | 1331 | } and blk_2: { |
| 1257 | 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 | 1334 | p.i = pos_2; |
| 1260 | 1335 | if (blk_3: { |
| 1261 | 1336 | const pos_3 = p.i; |
| 1262 | 1337 | const match_3 = blk_5: { |
| 1263 | 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 | 1340 | p.i = pos_5; |
| 1266 | 1341 | break :blk_5 false; |
| 1267 | 1342 | }; |
| ... | ... | @@ -1270,122 +1345,130 @@ const Parser = struct { |
| 1270 | 1345 | }) break :blk_2 true; |
| 1271 | 1346 | p.i = pos_2; |
| 1272 | 1347 | break :blk_2 false; |
| 1273 | | } and p.parseParamType()) break :blk_0 true; |
| 1348 | } and try p.parseParamType()) break :blk_0 true; |
| 1274 | 1349 | p.i = pos_0; |
| 1275 | 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 | 1354 | return blk_0: { |
| 1280 | 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 | 1357 | p.i = pos_0; |
| 1283 | | if (p.parseTypeExpr()) break :blk_0 true; |
| 1358 | if (try p.parseTypeExpr()) break :blk_0 true; |
| 1284 | 1359 | p.i = pos_0; |
| 1285 | 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 | 1364 | return blk_0: { |
| 1290 | 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 | 1367 | p.i = pos_0; |
| 1293 | 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 | 1372 | return blk_0: { |
| 1298 | 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 | 1375 | p.i = pos_0; |
| 1301 | 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 | 1380 | return blk_0: { |
| 1306 | 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 | 1383 | p.i = pos_0; |
| 1309 | 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 | 1388 | return blk_0: { |
| 1314 | 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 | 1391 | p.i = pos_0; |
| 1317 | 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 | 1396 | return blk_0: { |
| 1322 | 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 | 1399 | p.i = pos_0; |
| 1325 | 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 | 1404 | return blk_0: { |
| 1330 | 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 | 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 | 1409 | p.i = pos_3; |
| 1335 | 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 | 1412 | p.i = pos_0; |
| 1338 | 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 | 1417 | return blk_0: { |
| 1343 | 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 | 1421 | while (blk_3: { |
| 1346 | 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 | 1424 | p.i = pos_3; |
| 1349 | 1425 | break :blk_3 false; |
| 1350 | | }) {} |
| 1426 | }) { |
| 1427 | if (i_1 > max_depth) return error.MaxDepth; |
| 1428 | i_1 += 1; |
| 1429 | } |
| 1351 | 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 | 1432 | p.i = pos_0; |
| 1354 | 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 | 1437 | return blk_0: { |
| 1359 | 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 | 1440 | p.i = pos_0; |
| 1362 | 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 | 1445 | return blk_0: { |
| 1367 | 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 | 1449 | while (blk_3: { |
| 1370 | 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 | 1452 | p.i = pos_3; |
| 1373 | 1453 | break :blk_3 false; |
| 1374 | | }) {} |
| 1454 | }) { |
| 1455 | if (i_1 > max_depth) return error.MaxDepth; |
| 1456 | i_1 += 1; |
| 1457 | } |
| 1375 | 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 | 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 | 1462 | p.i = pos_0; |
| 1380 | 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 | 1467 | return blk_0: { |
| 1385 | 1468 | const pos_0 = p.i; |
| 1386 | | if (p.parseExpr() and (blk_3: { |
| 1469 | if (try p.parseExpr() and (blk_3: { |
| 1387 | 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 | 1472 | p.i = pos_3; |
| 1390 | 1473 | break :blk_3 false; |
| 1391 | 1474 | } or true)) break :blk_0 true; |
| ... | ... | @@ -1393,34 +1476,38 @@ const Parser = struct { |
| 1393 | 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 | 1480 | return blk_0: { |
| 1398 | 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 | 1484 | while (blk_3: { |
| 1401 | 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 | 1487 | p.i = pos_3; |
| 1404 | 1488 | break :blk_3 false; |
| 1405 | | }) {} |
| 1489 | }) { |
| 1490 | if (i_1 > max_depth) return error.MaxDepth; |
| 1491 | i_1 += 1; |
| 1492 | } |
| 1406 | 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 | 1495 | p.i = pos_0; |
| 1409 | 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 | 1500 | return blk_0: { |
| 1414 | 1501 | const pos_0 = p.i; |
| 1415 | | if (p.parseExpr() and blk_2: { |
| 1502 | if (try p.parseExpr() and blk_2: { |
| 1416 | 1503 | const pos_2 = p.i; |
| 1417 | | if (p.parseDOT2() and blk_4: { |
| 1504 | if (try p.parseDOT2() and blk_4: { |
| 1418 | 1505 | const pos_4 = p.i; |
| 1419 | | if (p.parseExpr()) break :blk_4 true; |
| 1506 | if (try p.parseExpr()) break :blk_4 true; |
| 1420 | 1507 | p.i = pos_4; |
| 1421 | 1508 | if (blk_5: { |
| 1422 | 1509 | const pos_5 = p.i; |
| 1423 | | const match_5 = p.parseExprPrefix(); |
| 1510 | const match_5 = try p.parseExprPrefix(); |
| 1424 | 1511 | p.i = pos_5; |
| 1425 | 1512 | break :blk_5 !match_5; |
| 1426 | 1513 | }) break :blk_4 true; |
| ... | ... | @@ -1430,7 +1517,7 @@ const Parser = struct { |
| 1430 | 1517 | p.i = pos_2; |
| 1431 | 1518 | if (blk_3: { |
| 1432 | 1519 | const pos_3 = p.i; |
| 1433 | | const match_3 = p.parseDOT2(); |
| 1520 | const match_3 = try p.parseDOT2(); |
| 1434 | 1521 | p.i = pos_3; |
| 1435 | 1522 | break :blk_3 !match_3; |
| 1436 | 1523 | }) break :blk_2 true; |
| ... | ... | @@ -1441,61 +1528,61 @@ const Parser = struct { |
| 1441 | 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 | 1532 | return blk_0: { |
| 1446 | 1533 | const pos_0 = p.i; |
| 1447 | | if (p.parseASTERISKEQUAL()) break :blk_0 true; |
| 1534 | if (try p.parseASTERISKEQUAL()) break :blk_0 true; |
| 1448 | 1535 | p.i = pos_0; |
| 1449 | | if (p.parseASTERISKPIPEEQUAL()) break :blk_0 true; |
| 1536 | if (try p.parseASTERISKPIPEEQUAL()) break :blk_0 true; |
| 1450 | 1537 | p.i = pos_0; |
| 1451 | | if (p.parseSLASHEQUAL()) break :blk_0 true; |
| 1538 | if (try p.parseSLASHEQUAL()) break :blk_0 true; |
| 1452 | 1539 | p.i = pos_0; |
| 1453 | | if (p.parsePERCENTEQUAL()) break :blk_0 true; |
| 1540 | if (try p.parsePERCENTEQUAL()) break :blk_0 true; |
| 1454 | 1541 | p.i = pos_0; |
| 1455 | | if (p.parsePLUSEQUAL()) break :blk_0 true; |
| 1542 | if (try p.parsePLUSEQUAL()) break :blk_0 true; |
| 1456 | 1543 | p.i = pos_0; |
| 1457 | | if (p.parsePLUSPIPEEQUAL()) break :blk_0 true; |
| 1544 | if (try p.parsePLUSPIPEEQUAL()) break :blk_0 true; |
| 1458 | 1545 | p.i = pos_0; |
| 1459 | | if (p.parseMINUSEQUAL()) break :blk_0 true; |
| 1546 | if (try p.parseMINUSEQUAL()) break :blk_0 true; |
| 1460 | 1547 | p.i = pos_0; |
| 1461 | | if (p.parseMINUSPIPEEQUAL()) break :blk_0 true; |
| 1548 | if (try p.parseMINUSPIPEEQUAL()) break :blk_0 true; |
| 1462 | 1549 | p.i = pos_0; |
| 1463 | | if (p.parseLARROW2EQUAL()) break :blk_0 true; |
| 1550 | if (try p.parseLARROW2EQUAL()) break :blk_0 true; |
| 1464 | 1551 | p.i = pos_0; |
| 1465 | | if (p.parseLARROW2PIPEEQUAL()) break :blk_0 true; |
| 1552 | if (try p.parseLARROW2PIPEEQUAL()) break :blk_0 true; |
| 1466 | 1553 | p.i = pos_0; |
| 1467 | | if (p.parseRARROW2EQUAL()) break :blk_0 true; |
| 1554 | if (try p.parseRARROW2EQUAL()) break :blk_0 true; |
| 1468 | 1555 | p.i = pos_0; |
| 1469 | | if (p.parseAMPERSANDEQUAL()) break :blk_0 true; |
| 1556 | if (try p.parseAMPERSANDEQUAL()) break :blk_0 true; |
| 1470 | 1557 | p.i = pos_0; |
| 1471 | | if (p.parseCARETEQUAL()) break :blk_0 true; |
| 1558 | if (try p.parseCARETEQUAL()) break :blk_0 true; |
| 1472 | 1559 | p.i = pos_0; |
| 1473 | | if (p.parsePIPEEQUAL()) break :blk_0 true; |
| 1560 | if (try p.parsePIPEEQUAL()) break :blk_0 true; |
| 1474 | 1561 | p.i = pos_0; |
| 1475 | | if (p.parseASTERISKPERCENTEQUAL()) break :blk_0 true; |
| 1562 | if (try p.parseASTERISKPERCENTEQUAL()) break :blk_0 true; |
| 1476 | 1563 | p.i = pos_0; |
| 1477 | | if (p.parsePLUSPERCENTEQUAL()) break :blk_0 true; |
| 1564 | if (try p.parsePLUSPERCENTEQUAL()) break :blk_0 true; |
| 1478 | 1565 | p.i = pos_0; |
| 1479 | | if (p.parseMINUSPERCENTEQUAL()) break :blk_0 true; |
| 1566 | if (try p.parseMINUSPERCENTEQUAL()) break :blk_0 true; |
| 1480 | 1567 | p.i = pos_0; |
| 1481 | | if (p.parseEQUAL()) break :blk_0 true; |
| 1568 | if (try p.parseEQUAL()) break :blk_0 true; |
| 1482 | 1569 | p.i = pos_0; |
| 1483 | 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 | 1574 | return blk_0: { |
| 1488 | 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 | 1577 | p.i = pos_0; |
| 1491 | 1578 | if (blk_1: { |
| 1492 | 1579 | const pos_1 = p.i; |
| 1493 | | const match_1 = p.parsepre_op_white(); |
| 1580 | const match_1 = try p.parsepre_op_white(); |
| 1494 | 1581 | p.i = pos_1; |
| 1495 | 1582 | break :blk_1 !match_1; |
| 1496 | | } and p.parseKEYWORD_or() and blk_1: { |
| 1583 | } and try p.parseKEYWORD_or() and blk_1: { |
| 1497 | 1584 | const pos_1 = p.i; |
| 1498 | | const match_1 = p.parsepost_op_white(); |
| 1585 | const match_1 = try p.parsepost_op_white(); |
| 1499 | 1586 | p.i = pos_1; |
| 1500 | 1587 | break :blk_1 !match_1; |
| 1501 | 1588 | }) break :blk_0 true; |
| ... | ... | @@ -1503,19 +1590,19 @@ const Parser = struct { |
| 1503 | 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 | 1594 | return blk_0: { |
| 1508 | 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 | 1597 | p.i = pos_0; |
| 1511 | 1598 | if (blk_1: { |
| 1512 | 1599 | const pos_1 = p.i; |
| 1513 | | const match_1 = p.parsepre_op_white(); |
| 1600 | const match_1 = try p.parsepre_op_white(); |
| 1514 | 1601 | p.i = pos_1; |
| 1515 | 1602 | break :blk_1 !match_1; |
| 1516 | | } and p.parseKEYWORD_and() and blk_1: { |
| 1603 | } and try p.parseKEYWORD_and() and blk_1: { |
| 1517 | 1604 | const pos_1 = p.i; |
| 1518 | | const match_1 = p.parsepost_op_white(); |
| 1605 | const match_1 = try p.parsepost_op_white(); |
| 1519 | 1606 | p.i = pos_1; |
| 1520 | 1607 | break :blk_1 !match_1; |
| 1521 | 1608 | }) break :blk_0 true; |
| ... | ... | @@ -1523,19 +1610,19 @@ const Parser = struct { |
| 1523 | 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 | 1614 | return blk_0: { |
| 1528 | 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 | 1617 | p.i = pos_0; |
| 1531 | 1618 | if (blk_1: { |
| 1532 | 1619 | const pos_1 = p.i; |
| 1533 | | const match_1 = p.parsepre_op_white(); |
| 1620 | const match_1 = try p.parsepre_op_white(); |
| 1534 | 1621 | p.i = pos_1; |
| 1535 | 1622 | break :blk_1 !match_1; |
| 1536 | | } and p.parseCompareOpTok() and blk_1: { |
| 1623 | } and try p.parseCompareOpTok() and blk_1: { |
| 1537 | 1624 | const pos_1 = p.i; |
| 1538 | | const match_1 = p.parsepost_op_white(); |
| 1625 | const match_1 = try p.parsepost_op_white(); |
| 1539 | 1626 | p.i = pos_1; |
| 1540 | 1627 | break :blk_1 !match_1; |
| 1541 | 1628 | }) break :blk_0 true; |
| ... | ... | @@ -1543,37 +1630,37 @@ const Parser = struct { |
| 1543 | 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 | 1634 | return blk_0: { |
| 1548 | 1635 | const pos_0 = p.i; |
| 1549 | | if (p.parseEQUALEQUAL()) break :blk_0 true; |
| 1636 | if (try p.parseEQUALEQUAL()) break :blk_0 true; |
| 1550 | 1637 | p.i = pos_0; |
| 1551 | | if (p.parseEXCLAMATIONMARKEQUAL()) break :blk_0 true; |
| 1638 | if (try p.parseEXCLAMATIONMARKEQUAL()) break :blk_0 true; |
| 1552 | 1639 | p.i = pos_0; |
| 1553 | | if (p.parseLARROW()) break :blk_0 true; |
| 1640 | if (try p.parseLARROW()) break :blk_0 true; |
| 1554 | 1641 | p.i = pos_0; |
| 1555 | | if (p.parseRARROW()) break :blk_0 true; |
| 1642 | if (try p.parseRARROW()) break :blk_0 true; |
| 1556 | 1643 | p.i = pos_0; |
| 1557 | | if (p.parseLARROWEQUAL()) break :blk_0 true; |
| 1644 | if (try p.parseLARROWEQUAL()) break :blk_0 true; |
| 1558 | 1645 | p.i = pos_0; |
| 1559 | | if (p.parseRARROWEQUAL()) break :blk_0 true; |
| 1646 | if (try p.parseRARROWEQUAL()) break :blk_0 true; |
| 1560 | 1647 | p.i = pos_0; |
| 1561 | 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 | 1652 | return blk_0: { |
| 1566 | 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 | 1655 | p.i = pos_0; |
| 1569 | 1656 | if (blk_1: { |
| 1570 | 1657 | const pos_1 = p.i; |
| 1571 | | const match_1 = p.parsepre_op_white(); |
| 1658 | const match_1 = try p.parsepre_op_white(); |
| 1572 | 1659 | p.i = pos_1; |
| 1573 | 1660 | break :blk_1 !match_1; |
| 1574 | | } and p.parseBitwiseOpTok() and blk_1: { |
| 1661 | } and try p.parseBitwiseOpTok() and blk_1: { |
| 1575 | 1662 | const pos_1 = p.i; |
| 1576 | | const match_1 = p.parsepost_op_white(); |
| 1663 | const match_1 = try p.parsepost_op_white(); |
| 1577 | 1664 | p.i = pos_1; |
| 1578 | 1665 | break :blk_1 !match_1; |
| 1579 | 1666 | }) break :blk_0 true; |
| ... | ... | @@ -1581,10 +1668,10 @@ const Parser = struct { |
| 1581 | 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 | 1672 | return blk_0: { |
| 1586 | 1673 | const pos_0 = p.i; |
| 1587 | | if (p.parseAMPERSAND() and blk_1: { |
| 1674 | if (try p.parseAMPERSAND() and blk_1: { |
| 1588 | 1675 | const pos_1 = p.i; |
| 1589 | 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 | 1685 | break :blk_1 !match_1; |
| 1599 | 1686 | }) break :blk_0 true; |
| 1600 | 1687 | p.i = pos_0; |
| 1601 | | if (p.parseCARET()) break :blk_0 true; |
| 1688 | if (try p.parseCARET()) break :blk_0 true; |
| 1602 | 1689 | p.i = pos_0; |
| 1603 | | if (p.parsePIPE()) break :blk_0 true; |
| 1690 | if (try p.parsePIPE()) break :blk_0 true; |
| 1604 | 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 | 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 | 1695 | p.i = pos_0; |
| 1609 | 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 | 1700 | return blk_0: { |
| 1614 | 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 | 1703 | p.i = pos_0; |
| 1617 | 1704 | if (blk_1: { |
| 1618 | 1705 | const pos_1 = p.i; |
| 1619 | | const match_1 = p.parsepre_op_white(); |
| 1706 | const match_1 = try p.parsepre_op_white(); |
| 1620 | 1707 | p.i = pos_1; |
| 1621 | 1708 | break :blk_1 !match_1; |
| 1622 | | } and p.parseBitShiftOpTok() and blk_1: { |
| 1709 | } and try p.parseBitShiftOpTok() and blk_1: { |
| 1623 | 1710 | const pos_1 = p.i; |
| 1624 | | const match_1 = p.parsepost_op_white(); |
| 1711 | const match_1 = try p.parsepost_op_white(); |
| 1625 | 1712 | p.i = pos_1; |
| 1626 | 1713 | break :blk_1 !match_1; |
| 1627 | 1714 | }) break :blk_0 true; |
| ... | ... | @@ -1629,31 +1716,31 @@ const Parser = struct { |
| 1629 | 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 | 1720 | return blk_0: { |
| 1634 | 1721 | const pos_0 = p.i; |
| 1635 | | if (p.parseLARROW2()) break :blk_0 true; |
| 1722 | if (try p.parseLARROW2()) break :blk_0 true; |
| 1636 | 1723 | p.i = pos_0; |
| 1637 | | if (p.parseRARROW2()) break :blk_0 true; |
| 1724 | if (try p.parseRARROW2()) break :blk_0 true; |
| 1638 | 1725 | p.i = pos_0; |
| 1639 | | if (p.parseLARROW2PIPE()) break :blk_0 true; |
| 1726 | if (try p.parseLARROW2PIPE()) break :blk_0 true; |
| 1640 | 1727 | p.i = pos_0; |
| 1641 | 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 | 1732 | return blk_0: { |
| 1646 | 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 | 1735 | p.i = pos_0; |
| 1649 | 1736 | if (blk_1: { |
| 1650 | 1737 | const pos_1 = p.i; |
| 1651 | | const match_1 = p.parsepre_op_white(); |
| 1738 | const match_1 = try p.parsepre_op_white(); |
| 1652 | 1739 | p.i = pos_1; |
| 1653 | 1740 | break :blk_1 !match_1; |
| 1654 | | } and p.parseAdditionOpTok() and blk_1: { |
| 1741 | } and try p.parseAdditionOpTok() and blk_1: { |
| 1655 | 1742 | const pos_1 = p.i; |
| 1656 | | const match_1 = p.parsepost_op_white(); |
| 1743 | const match_1 = try p.parsepost_op_white(); |
| 1657 | 1744 | p.i = pos_1; |
| 1658 | 1745 | break :blk_1 !match_1; |
| 1659 | 1746 | }) break :blk_0 true; |
| ... | ... | @@ -1661,39 +1748,39 @@ const Parser = struct { |
| 1661 | 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 | 1752 | return blk_0: { |
| 1666 | 1753 | const pos_0 = p.i; |
| 1667 | | if (p.parsePLUS()) break :blk_0 true; |
| 1754 | if (try p.parsePLUS()) break :blk_0 true; |
| 1668 | 1755 | p.i = pos_0; |
| 1669 | | if (p.parseMINUS()) break :blk_0 true; |
| 1756 | if (try p.parseMINUS()) break :blk_0 true; |
| 1670 | 1757 | p.i = pos_0; |
| 1671 | | if (p.parsePLUS2()) break :blk_0 true; |
| 1758 | if (try p.parsePLUS2()) break :blk_0 true; |
| 1672 | 1759 | p.i = pos_0; |
| 1673 | | if (p.parsePLUSPERCENT()) break :blk_0 true; |
| 1760 | if (try p.parsePLUSPERCENT()) break :blk_0 true; |
| 1674 | 1761 | p.i = pos_0; |
| 1675 | | if (p.parseMINUSPERCENT()) break :blk_0 true; |
| 1762 | if (try p.parseMINUSPERCENT()) break :blk_0 true; |
| 1676 | 1763 | p.i = pos_0; |
| 1677 | | if (p.parsePLUSPIPE()) break :blk_0 true; |
| 1764 | if (try p.parsePLUSPIPE()) break :blk_0 true; |
| 1678 | 1765 | p.i = pos_0; |
| 1679 | | if (p.parseMINUSPIPE()) break :blk_0 true; |
| 1766 | if (try p.parseMINUSPIPE()) break :blk_0 true; |
| 1680 | 1767 | p.i = pos_0; |
| 1681 | 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 | 1772 | return blk_0: { |
| 1686 | 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 | 1775 | p.i = pos_0; |
| 1689 | 1776 | if (blk_1: { |
| 1690 | 1777 | const pos_1 = p.i; |
| 1691 | | const match_1 = p.parsepre_op_white(); |
| 1778 | const match_1 = try p.parsepre_op_white(); |
| 1692 | 1779 | p.i = pos_1; |
| 1693 | 1780 | break :blk_1 !match_1; |
| 1694 | | } and p.parseMultiplyOpTok() and blk_1: { |
| 1781 | } and try p.parseMultiplyOpTok() and blk_1: { |
| 1695 | 1782 | const pos_1 = p.i; |
| 1696 | | const match_1 = p.parsepost_op_white(); |
| 1783 | const match_1 = try p.parsepost_op_white(); |
| 1697 | 1784 | p.i = pos_1; |
| 1698 | 1785 | break :blk_1 !match_1; |
| 1699 | 1786 | }) break :blk_0 true; |
| ... | ... | @@ -1701,159 +1788,207 @@ const Parser = struct { |
| 1701 | 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 | 1792 | return blk_0: { |
| 1706 | 1793 | const pos_0 = p.i; |
| 1707 | | if (p.parsePIPE2()) break :blk_0 true; |
| 1794 | if (try p.parsePIPE2()) break :blk_0 true; |
| 1708 | 1795 | p.i = pos_0; |
| 1709 | | if (p.parseASTERISK()) break :blk_0 true; |
| 1796 | if (try p.parseASTERISK()) break :blk_0 true; |
| 1710 | 1797 | p.i = pos_0; |
| 1711 | | if (p.parseSLASH()) break :blk_0 true; |
| 1798 | if (try p.parseSLASH()) break :blk_0 true; |
| 1712 | 1799 | p.i = pos_0; |
| 1713 | | if (p.parsePERCENT()) break :blk_0 true; |
| 1800 | if (try p.parsePERCENT()) break :blk_0 true; |
| 1714 | 1801 | p.i = pos_0; |
| 1715 | | if (p.parseASTERISKPERCENT()) break :blk_0 true; |
| 1802 | if (try p.parseASTERISKPERCENT()) break :blk_0 true; |
| 1716 | 1803 | p.i = pos_0; |
| 1717 | | if (p.parseASTERISKPIPE()) break :blk_0 true; |
| 1804 | if (try p.parseASTERISKPIPE()) break :blk_0 true; |
| 1718 | 1805 | p.i = pos_0; |
| 1719 | 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 | 1810 | return blk_0: { |
| 1724 | 1811 | const pos_0 = p.i; |
| 1725 | | if (p.parseEXCLAMATIONMARK()) break :blk_0 true; |
| 1812 | if (try p.parseEXCLAMATIONMARK()) break :blk_0 true; |
| 1726 | 1813 | p.i = pos_0; |
| 1727 | | if (p.parseMINUS()) break :blk_0 true; |
| 1814 | if (try p.parseMINUS()) break :blk_0 true; |
| 1728 | 1815 | p.i = pos_0; |
| 1729 | | if (p.parseTILDE()) break :blk_0 true; |
| 1816 | if (try p.parseTILDE()) break :blk_0 true; |
| 1730 | 1817 | p.i = pos_0; |
| 1731 | | if (p.parseMINUSPERCENT()) break :blk_0 true; |
| 1818 | if (try p.parseMINUSPERCENT()) break :blk_0 true; |
| 1732 | 1819 | p.i = pos_0; |
| 1733 | | if (p.parseAMPERSAND()) break :blk_0 true; |
| 1820 | if (try p.parseAMPERSAND()) break :blk_0 true; |
| 1734 | 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 | 1823 | p.i = pos_0; |
| 1737 | 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 | 1828 | return blk_0: { |
| 1742 | 1829 | const pos_0 = p.i; |
| 1743 | | if (p.parseQUESTIONMARK()) break :blk_0 true; |
| 1830 | if (try p.parseQUESTIONMARK()) break :blk_0 true; |
| 1744 | 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 | 1833 | p.i = pos_0; |
| 1747 | 1834 | if (blk_2: { |
| 1748 | 1835 | const pos_2 = p.i; |
| 1749 | | if (p.parseManyPtrTypeStart()) break :blk_2 true; |
| 1836 | if (try p.parseManyPtrTypeStart()) break :blk_2 true; |
| 1750 | 1837 | p.i = pos_2; |
| 1751 | | if (p.parseSliceTypeStart()) break :blk_2 true; |
| 1838 | if (try p.parseSliceTypeStart()) break :blk_2 true; |
| 1752 | 1839 | p.i = pos_2; |
| 1753 | 1840 | break :blk_2 false; |
| 1754 | | } and p.parsePtrMods()) break :blk_0 true; |
| 1841 | } and try p.parsePtrMods()) break :blk_0 true; |
| 1755 | 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 | 1844 | p.i = pos_0; |
| 1758 | | if (p.parseArrayTypeStart()) break :blk_0 true; |
| 1845 | if (try p.parseArrayTypeStart()) break :blk_0 true; |
| 1759 | 1846 | p.i = pos_0; |
| 1760 | 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 | 1851 | return blk_0: { |
| 1765 | 1852 | const pos_0 = p.i; |
| 1766 | 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 | 1859 | break :blk_1 true; |
| 1769 | | } and (p.parseByteAlign() or true) and blk_1: { |
| 1770 | | while (p.parsePtrMod()) {} |
| 1860 | } and (try p.parseByteAlign() or true) and blk_1: { |
| 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 | 1866 | break :blk_1 true; |
| 1772 | | } and (p.parseAddrSpace() or true) and blk_1: { |
| 1773 | | while (p.parsePtrMod()) {} |
| 1867 | } and (try p.parseAddrSpace() or true) and blk_1: { |
| 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 | 1873 | break :blk_1 true; |
| 1775 | 1874 | }) break :blk_0 true; |
| 1776 | 1875 | p.i = pos_0; |
| 1777 | 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 | 1882 | break :blk_1 true; |
| 1780 | | } and (p.parseAddrSpace() or true) and blk_1: { |
| 1781 | | while (p.parsePtrMod()) {} |
| 1883 | } and (try p.parseAddrSpace() or true) and blk_1: { |
| 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 | 1889 | break :blk_1 true; |
| 1783 | | } and (p.parseByteAlign() or true) and blk_1: { |
| 1784 | | while (p.parsePtrMod()) {} |
| 1890 | } and (try p.parseByteAlign() or true) and blk_1: { |
| 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 | 1896 | break :blk_1 true; |
| 1786 | 1897 | }) break :blk_0 true; |
| 1787 | 1898 | p.i = pos_0; |
| 1788 | 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 | 1903 | return blk_0: { |
| 1793 | 1904 | const pos_0 = p.i; |
| 1794 | 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 | 1911 | break :blk_1 true; |
| 1797 | | } and (p.parseBitAlign() or true) and blk_1: { |
| 1798 | | while (p.parsePtrMod()) {} |
| 1912 | } and (try p.parseBitAlign() or true) and blk_1: { |
| 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 | 1918 | break :blk_1 true; |
| 1800 | | } and (p.parseAddrSpace() or true) and blk_1: { |
| 1801 | | while (p.parsePtrMod()) {} |
| 1919 | } and (try p.parseAddrSpace() or true) and blk_1: { |
| 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 | 1925 | break :blk_1 true; |
| 1803 | 1926 | }) break :blk_0 true; |
| 1804 | 1927 | p.i = pos_0; |
| 1805 | 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 | 1934 | break :blk_1 true; |
| 1808 | | } and (p.parseAddrSpace() or true) and blk_1: { |
| 1809 | | while (p.parsePtrMod()) {} |
| 1935 | } and (try p.parseAddrSpace() or true) and blk_1: { |
| 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 | 1941 | break :blk_1 true; |
| 1811 | | } and (p.parseBitAlign() or true) and blk_1: { |
| 1812 | | while (p.parsePtrMod()) {} |
| 1942 | } and (try p.parseBitAlign() or true) and blk_1: { |
| 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 | 1948 | break :blk_1 true; |
| 1814 | 1949 | }) break :blk_0 true; |
| 1815 | 1950 | p.i = pos_0; |
| 1816 | 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 | 1955 | return blk_0: { |
| 1821 | 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 | 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 | 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 | 1962 | p.i = pos_0; |
| 1828 | 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 | 1967 | return blk_0: { |
| 1833 | 1968 | const pos_0 = p.i; |
| 1834 | | if (p.parseQUESTIONMARK()) break :blk_0 true; |
| 1969 | if (try p.parseQUESTIONMARK()) break :blk_0 true; |
| 1835 | 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 | 1972 | p.i = pos_0; |
| 1838 | | if (p.parseLBRACKET()) break :blk_0 true; |
| 1973 | if (try p.parseLBRACKET()) break :blk_0 true; |
| 1839 | 1974 | p.i = pos_0; |
| 1840 | | if (p.parseASTERISK()) break :blk_0 true; |
| 1975 | if (try p.parseASTERISK()) break :blk_0 true; |
| 1841 | 1976 | p.i = pos_0; |
| 1842 | 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 | 1981 | return blk_0: { |
| 1847 | 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 | 1984 | const pos_3 = p.i; |
| 1850 | | if (p.parseDOT2() and blk_5: { |
| 1985 | if (try p.parseDOT2() and blk_5: { |
| 1851 | 1986 | const pos_5 = p.i; |
| 1852 | | if (p.parseExpr()) break :blk_5 true; |
| 1987 | if (try p.parseExpr()) break :blk_5 true; |
| 1853 | 1988 | p.i = pos_5; |
| 1854 | 1989 | if (blk_6: { |
| 1855 | 1990 | const pos_6 = p.i; |
| 1856 | | const match_6 = p.parseExprPrefix(); |
| 1991 | const match_6 = try p.parseExprPrefix(); |
| 1857 | 1992 | p.i = pos_6; |
| 1858 | 1993 | break :blk_6 !match_6; |
| 1859 | 1994 | }) break :blk_5 true; |
| ... | ... | @@ -1861,145 +1996,145 @@ const Parser = struct { |
| 1861 | 1996 | break :blk_5 false; |
| 1862 | 1997 | } and (blk_6: { |
| 1863 | 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 | 2000 | p.i = pos_6; |
| 1866 | 2001 | break :blk_6 false; |
| 1867 | 2002 | } or true)) break :blk_3 true; |
| 1868 | 2003 | p.i = pos_3; |
| 1869 | 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 | 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 | 2008 | p.i = pos_0; |
| 1874 | | if (p.parseDOTASTERISK()) break :blk_0 true; |
| 2009 | if (try p.parseDOTASTERISK()) break :blk_0 true; |
| 1875 | 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 | 2012 | p.i = pos_0; |
| 1878 | | if (p.parseFnCallArguments()) break :blk_0 true; |
| 2013 | if (try p.parseFnCallArguments()) break :blk_0 true; |
| 1879 | 2014 | p.i = pos_0; |
| 1880 | 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 | 2019 | return blk_0: { |
| 1885 | 2020 | const pos_0 = p.i; |
| 1886 | | if (p.parseLBRACKET()) break :blk_0 true; |
| 2021 | if (try p.parseLBRACKET()) break :blk_0 true; |
| 1887 | 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 | 2024 | p.i = pos_0; |
| 1890 | | if (p.parseDOTASTERISK()) break :blk_0 true; |
| 2025 | if (try p.parseDOTASTERISK()) break :blk_0 true; |
| 1891 | 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 | 2028 | p.i = pos_0; |
| 1894 | | if (p.parseLPAREN()) break :blk_0 true; |
| 2029 | if (try p.parseLPAREN()) break :blk_0 true; |
| 1895 | 2030 | p.i = pos_0; |
| 1896 | 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 | 2035 | return blk_0: { |
| 1901 | 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 | 2038 | p.i = pos_0; |
| 1904 | 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 | 2043 | return blk_0: { |
| 1909 | 2044 | const pos_0 = p.i; |
| 1910 | | if (p.parseLBRACKET() and (blk_3: { |
| 2045 | if (try p.parseLBRACKET() and (blk_3: { |
| 1911 | 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 | 2048 | p.i = pos_3; |
| 1914 | 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 | 2051 | p.i = pos_0; |
| 1917 | 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 | 2056 | return blk_0: { |
| 1922 | 2057 | const pos_0 = p.i; |
| 1923 | | if (p.parseASTERISK()) break :blk_0 true; |
| 2058 | if (try p.parseASTERISK()) break :blk_0 true; |
| 1924 | 2059 | p.i = pos_0; |
| 1925 | 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 | 2064 | return blk_0: { |
| 1930 | 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 | 2067 | const pos_3 = p.i; |
| 1933 | | if (p.parseLETTERC()) break :blk_3 true; |
| 2068 | if (try p.parseLETTERC()) break :blk_3 true; |
| 1934 | 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 | 2071 | p.i = pos_3; |
| 1937 | 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 | 2074 | p.i = pos_0; |
| 1940 | 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 | 2079 | return blk_0: { |
| 1945 | 2080 | const pos_0 = p.i; |
| 1946 | | if (p.parseLBRACKET() and blk_1: { |
| 2081 | if (try p.parseLBRACKET() and blk_1: { |
| 1947 | 2082 | const pos_1 = p.i; |
| 1948 | | const match_1 = p.parseASTERISK(); |
| 2083 | const match_1 = try p.parseASTERISK(); |
| 1949 | 2084 | p.i = pos_1; |
| 1950 | 2085 | break :blk_1 !match_1; |
| 1951 | | } and p.parseExpr() and (blk_3: { |
| 2086 | } and try p.parseExpr() and (blk_3: { |
| 1952 | 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 | 2089 | p.i = pos_3; |
| 1955 | 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 | 2092 | p.i = pos_0; |
| 1958 | 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 | 2097 | return blk_0: { |
| 1963 | 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 | 2100 | p.i = pos_0; |
| 1966 | 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 | 2105 | return blk_0: { |
| 1971 | 2106 | const pos_0 = p.i; |
| 1972 | | if (p.parseKEYWORD_struct() and (blk_3: { |
| 2107 | if (try p.parseKEYWORD_struct() and (blk_3: { |
| 1973 | 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 | 2110 | p.i = pos_3; |
| 1976 | 2111 | break :blk_3 false; |
| 1977 | 2112 | } or true)) break :blk_0 true; |
| 1978 | 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 | 2115 | p.i = pos_0; |
| 1981 | | if (p.parseKEYWORD_enum() and (blk_3: { |
| 2116 | if (try p.parseKEYWORD_enum() and (blk_3: { |
| 1982 | 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 | 2119 | p.i = pos_3; |
| 1985 | 2120 | break :blk_3 false; |
| 1986 | 2121 | } or true)) break :blk_0 true; |
| 1987 | 2122 | p.i = pos_0; |
| 1988 | | if (p.parseKEYWORD_union() and (blk_3: { |
| 2123 | if (try p.parseKEYWORD_union() and (blk_3: { |
| 1989 | 2124 | const pos_3 = p.i; |
| 1990 | | if (p.parseLPAREN() and blk_5: { |
| 2125 | if (try p.parseLPAREN() and blk_5: { |
| 1991 | 2126 | const pos_5 = p.i; |
| 1992 | | if (p.parseKEYWORD_enum() and (blk_8: { |
| 2127 | if (try p.parseKEYWORD_enum() and (blk_8: { |
| 1993 | 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 | 2130 | p.i = pos_8; |
| 1996 | 2131 | break :blk_8 false; |
| 1997 | 2132 | } or true)) break :blk_5 true; |
| 1998 | 2133 | p.i = pos_5; |
| 1999 | | if (p.parseExpr()) break :blk_5 true; |
| 2134 | if (try p.parseExpr()) break :blk_5 true; |
| 2000 | 2135 | p.i = pos_5; |
| 2001 | 2136 | break :blk_5 false; |
| 2002 | | } and p.parseRPAREN()) break :blk_3 true; |
| 2137 | } and try p.parseRPAREN()) break :blk_3 true; |
| 2003 | 2138 | p.i = pos_3; |
| 2004 | 2139 | break :blk_3 false; |
| 2005 | 2140 | } or true)) break :blk_0 true; |
| ... | ... | @@ -2007,41 +2142,45 @@ const Parser = struct { |
| 2007 | 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 | 2146 | return blk_0: { |
| 2012 | 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 | 2149 | p.i = pos_0; |
| 2015 | 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 | 2154 | return blk_0: { |
| 2020 | 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 | 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 | 2159 | p.i = pos_3; |
| 2025 | 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 | 2162 | p.i = pos_0; |
| 2028 | 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 | 2167 | return blk_0: { |
| 2033 | 2168 | const pos_0 = p.i; |
| 2034 | 2169 | if (blk_1: { |
| 2170 | var i_1: usize = 0; |
| 2035 | 2171 | while (blk_3: { |
| 2036 | 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 | 2174 | p.i = pos_3; |
| 2039 | 2175 | break :blk_3 false; |
| 2040 | | }) {} |
| 2176 | }) { |
| 2177 | if (i_1 > max_depth) return error.MaxDepth; |
| 2178 | i_1 += 1; |
| 2179 | } |
| 2041 | 2180 | break :blk_1 true; |
| 2042 | 2181 | } and (blk_3: { |
| 2043 | 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 | 2184 | p.i = pos_3; |
| 2046 | 2185 | break :blk_3 false; |
| 2047 | 2186 | } or true)) break :blk_0 true; |
| ... | ... | @@ -2049,70 +2188,86 @@ const Parser = struct { |
| 2049 | 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 | 2192 | return blk_0: { |
| 2054 | 2193 | const pos_0 = p.i; |
| 2055 | 2194 | if (blk_1: { |
| 2195 | var i_1: usize = 0; |
| 2056 | 2196 | while (blk_3: { |
| 2057 | 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 | 2199 | p.i = pos_3; |
| 2060 | 2200 | break :blk_3 false; |
| 2061 | | }) {} |
| 2201 | }) { |
| 2202 | if (i_1 > max_depth) return error.MaxDepth; |
| 2203 | i_1 += 1; |
| 2204 | } |
| 2062 | 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 | 2207 | p.i = pos_0; |
| 2065 | 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 | 2212 | return blk_0: { |
| 2070 | 2213 | const pos_0 = p.i; |
| 2071 | 2214 | if (blk_1: { |
| 2215 | var i_1: usize = 0; |
| 2072 | 2216 | while (blk_3: { |
| 2073 | 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 | 2219 | p.i = pos_3; |
| 2076 | 2220 | break :blk_3 false; |
| 2077 | | }) {} |
| 2221 | }) { |
| 2222 | if (i_1 > max_depth) return error.MaxDepth; |
| 2223 | i_1 += 1; |
| 2224 | } |
| 2078 | 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 | 2227 | p.i = pos_0; |
| 2081 | 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 | 2232 | return blk_0: { |
| 2086 | 2233 | const pos_0 = p.i; |
| 2087 | 2234 | if (blk_1: { |
| 2235 | var i_1: usize = 0; |
| 2088 | 2236 | while (blk_3: { |
| 2089 | 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 | 2239 | p.i = pos_3; |
| 2092 | 2240 | break :blk_3 false; |
| 2093 | | }) {} |
| 2241 | }) { |
| 2242 | if (i_1 > max_depth) return error.MaxDepth; |
| 2243 | i_1 += 1; |
| 2244 | } |
| 2094 | 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 | 2247 | p.i = pos_0; |
| 2097 | 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 | 2252 | return blk_0: { |
| 2102 | 2253 | const pos_0 = p.i; |
| 2103 | 2254 | if (blk_1: { |
| 2255 | var i_1: usize = 0; |
| 2104 | 2256 | while (blk_3: { |
| 2105 | 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 | 2259 | p.i = pos_3; |
| 2108 | 2260 | break :blk_3 false; |
| 2109 | | }) {} |
| 2261 | }) { |
| 2262 | if (i_1 > max_depth) return error.MaxDepth; |
| 2263 | i_1 += 1; |
| 2264 | } |
| 2110 | 2265 | break :blk_1 true; |
| 2111 | 2266 | } and (blk_3: { |
| 2112 | 2267 | const pos_3 = p.i; |
| 2113 | | if (p.parseParamDecl()) break :blk_3 true; |
| 2268 | if (try p.parseParamDecl()) break :blk_3 true; |
| 2114 | 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 | 2271 | p.i = pos_3; |
| 2117 | 2272 | break :blk_3 false; |
| 2118 | 2273 | } or true)) break :blk_0 true; |
| ... | ... | @@ -2120,24 +2275,28 @@ const Parser = struct { |
| 2120 | 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 | 2279 | return blk_0: { |
| 2125 | 2280 | const pos_0 = p.i; |
| 2126 | 2281 | if (blk_1: { |
| 2282 | var i_1: usize = 0; |
| 2127 | 2283 | while (blk_3: { |
| 2128 | 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 | 2286 | p.i = pos_3; |
| 2131 | 2287 | break :blk_3 false; |
| 2132 | | }) {} |
| 2288 | }) { |
| 2289 | if (i_1 > max_depth) return error.MaxDepth; |
| 2290 | i_1 += 1; |
| 2291 | } |
| 2133 | 2292 | break :blk_1 true; |
| 2134 | 2293 | } and blk_2: { |
| 2135 | 2294 | const pos_2 = p.i; |
| 2136 | | if (p.parseExpr()) break :blk_2 true; |
| 2295 | if (try p.parseExpr()) break :blk_2 true; |
| 2137 | 2296 | p.i = pos_2; |
| 2138 | 2297 | if (blk_3: { |
| 2139 | 2298 | const pos_3 = p.i; |
| 2140 | | const match_3 = p.parseExprPrefix(); |
| 2299 | const match_3 = try p.parseExprPrefix(); |
| 2141 | 2300 | p.i = pos_3; |
| 2142 | 2301 | break :blk_3 !match_3; |
| 2143 | 2302 | }) break :blk_2 true; |
| ... | ... | @@ -2148,15 +2307,15 @@ const Parser = struct { |
| 2148 | 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 | 2311 | return blk_0: { |
| 2153 | 2312 | const pos_0 = p.i; |
| 2154 | | if (p.parseASTERISK()) break :blk_0 true; |
| 2313 | if (try p.parseASTERISK()) break :blk_0 true; |
| 2155 | 2314 | p.i = pos_0; |
| 2156 | 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 | 2319 | return blk_0: { |
| 2161 | 2320 | const pos_0 = p.i; |
| 2162 | 2321 | if ((p.i == 0)) break :blk_0 true; |
| ... | ... | @@ -2164,7 +2323,7 @@ const Parser = struct { |
| 2164 | 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 | 2327 | return blk_0: { |
| 2169 | 2328 | const pos_0 = p.i; |
| 2170 | 2329 | if (blk_1: { |
| ... | ... | @@ -2183,7 +2342,7 @@ const Parser = struct { |
| 2183 | 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 | 2346 | return blk_0: { |
| 2188 | 2347 | const pos_0 = p.i; |
| 2189 | 2348 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2198,7 +2357,7 @@ const Parser = struct { |
| 2198 | 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 | 2361 | return blk_0: { |
| 2203 | 2362 | const pos_0 = p.i; |
| 2204 | 2363 | if (blk_1: { |
| ... | ... | @@ -2212,7 +2371,7 @@ const Parser = struct { |
| 2212 | 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 | 2375 | return blk_0: { |
| 2217 | 2376 | const pos_0 = p.i; |
| 2218 | 2377 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2227,7 +2386,7 @@ const Parser = struct { |
| 2227 | 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 | 2390 | return blk_0: { |
| 2232 | 2391 | const pos_0 = p.i; |
| 2233 | 2392 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2242,7 +2401,7 @@ const Parser = struct { |
| 2242 | 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 | 2405 | return blk_0: { |
| 2247 | 2406 | const pos_0 = p.i; |
| 2248 | 2407 | if (blk_1: { |
| ... | ... | @@ -2256,7 +2415,7 @@ const Parser = struct { |
| 2256 | 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 | 2419 | return blk_0: { |
| 2261 | 2420 | const pos_0 = p.i; |
| 2262 | 2421 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2271,7 +2430,7 @@ const Parser = struct { |
| 2271 | 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 | 2434 | return blk_0: { |
| 2276 | 2435 | const pos_0 = p.i; |
| 2277 | 2436 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2286,7 +2445,7 @@ const Parser = struct { |
| 2286 | 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 | 2449 | return blk_0: { |
| 2291 | 2450 | const pos_0 = p.i; |
| 2292 | 2451 | if (blk_1: { |
| ... | ... | @@ -2300,7 +2459,7 @@ const Parser = struct { |
| 2300 | 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 | 2463 | return blk_0: { |
| 2305 | 2464 | const pos_0 = p.i; |
| 2306 | 2465 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2315,7 +2474,7 @@ const Parser = struct { |
| 2315 | 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 | 2478 | return blk_0: { |
| 2320 | 2479 | const pos_0 = p.i; |
| 2321 | 2480 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2330,7 +2489,7 @@ const Parser = struct { |
| 2330 | 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 | 2493 | return blk_0: { |
| 2335 | 2494 | const pos_0 = p.i; |
| 2336 | 2495 | if (blk_1: { |
| ... | ... | @@ -2344,7 +2503,7 @@ const Parser = struct { |
| 2344 | 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 | 2507 | return blk_0: { |
| 2349 | 2508 | const pos_0 = p.i; |
| 2350 | 2509 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2359,7 +2518,7 @@ const Parser = struct { |
| 2359 | 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 | 2522 | return blk_0: { |
| 2364 | 2523 | const pos_0 = p.i; |
| 2365 | 2524 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2374,29 +2533,29 @@ const Parser = struct { |
| 2374 | 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 | 2537 | return blk_0: { |
| 2379 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 2554 | p.i = pos_0; |
| 2396 | 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 | 2559 | return blk_0: { |
| 2401 | 2560 | const pos_0 = p.i; |
| 2402 | 2561 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2411,7 +2570,7 @@ const Parser = struct { |
| 2411 | 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 | 2574 | return blk_0: { |
| 2416 | 2575 | const pos_0 = p.i; |
| 2417 | 2576 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2427,7 +2586,7 @@ const Parser = struct { |
| 2427 | 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 | 2590 | return blk_0: { |
| 2432 | 2591 | const pos_0 = p.i; |
| 2433 | 2592 | if (blk_1: { |
| ... | ... | @@ -2458,12 +2617,12 @@ const Parser = struct { |
| 2458 | 2617 | }); |
| 2459 | 2618 | p.i = pos_1; |
| 2460 | 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 | 2621 | p.i = pos_0; |
| 2463 | 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 | 2626 | return blk_0: { |
| 2468 | 2627 | const pos_0 = p.i; |
| 2469 | 2628 | if (blk_1: { |
| ... | ... | @@ -2494,32 +2653,39 @@ const Parser = struct { |
| 2494 | 2653 | }); |
| 2495 | 2654 | p.i = pos_1; |
| 2496 | 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 | 2657 | p.i = pos_0; |
| 2499 | 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 | 2662 | return blk_0: { |
| 2504 | 2663 | const pos_0 = p.i; |
| 2505 | 2664 | if (blk_1: { |
| 2506 | 2665 | var match_1 = false; |
| 2666 | var i_1: usize = 0; |
| 2507 | 2667 | while (blk_3: { |
| 2508 | 2668 | const pos_3 = p.i; |
| 2509 | | if (p.parseskip() and blk_4: { |
| 2669 | if (try p.parseskip() and blk_4: { |
| 2510 | 2670 | if (std.mem.startsWith(u8, p.source[p.i..], "//!")) { |
| 2511 | 2671 | p.i += 3; |
| 2512 | 2672 | break :blk_4 true; |
| 2513 | 2673 | } |
| 2514 | 2674 | break :blk_4 false; |
| 2515 | 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 | 2681 | break :blk_4 true; |
| 2518 | | } and p.parsenewline()) break :blk_3 true; |
| 2682 | } and try p.parsenewline()) break :blk_3 true; |
| 2519 | 2683 | p.i = pos_3; |
| 2520 | 2684 | break :blk_3 false; |
| 2521 | 2685 | }) { |
| 2522 | 2686 | match_1 = true; |
| 2687 | if (i_1 > max_depth) return error.MaxDepth; |
| 2688 | i_1 += 1; |
| 2523 | 2689 | } |
| 2524 | 2690 | break :blk_1 match_1; |
| 2525 | 2691 | }) break :blk_0 true; |
| ... | ... | @@ -2527,34 +2693,41 @@ const Parser = struct { |
| 2527 | 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 | 2697 | return blk_0: { |
| 2532 | 2698 | const pos_0 = p.i; |
| 2533 | 2699 | if (blk_2: { |
| 2534 | 2700 | const pos_2 = p.i; |
| 2535 | | if (p.parsesof()) break :blk_2 true; |
| 2701 | if (try p.parsesof()) break :blk_2 true; |
| 2536 | 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 | 2704 | p.i = pos_2; |
| 2539 | 2705 | break :blk_2 false; |
| 2540 | 2706 | } and blk_1: { |
| 2541 | 2707 | var match_1 = false; |
| 2708 | var i_1: usize = 0; |
| 2542 | 2709 | while (blk_3: { |
| 2543 | 2710 | const pos_3 = p.i; |
| 2544 | | if (p.parseskip() and blk_4: { |
| 2711 | if (try p.parseskip() and blk_4: { |
| 2545 | 2712 | if (std.mem.startsWith(u8, p.source[p.i..], "///")) { |
| 2546 | 2713 | p.i += 3; |
| 2547 | 2714 | break :blk_4 true; |
| 2548 | 2715 | } |
| 2549 | 2716 | break :blk_4 false; |
| 2550 | 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 | 2723 | break :blk_4 true; |
| 2553 | | } and p.parsenewline()) break :blk_3 true; |
| 2724 | } and try p.parsenewline()) break :blk_3 true; |
| 2554 | 2725 | p.i = pos_3; |
| 2555 | 2726 | break :blk_3 false; |
| 2556 | 2727 | }) { |
| 2557 | 2728 | match_1 = true; |
| 2729 | if (i_1 > max_depth) return error.MaxDepth; |
| 2730 | i_1 += 1; |
| 2558 | 2731 | } |
| 2559 | 2732 | break :blk_1 match_1; |
| 2560 | 2733 | }) break :blk_0 true; |
| ... | ... | @@ -2562,7 +2735,7 @@ const Parser = struct { |
| 2562 | 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 | 2739 | return blk_0: { |
| 2567 | 2740 | const pos_0 = p.i; |
| 2568 | 2741 | if (blk_1: { |
| ... | ... | @@ -2585,9 +2758,13 @@ const Parser = struct { |
| 2585 | 2758 | p.i = pos_1; |
| 2586 | 2759 | break :blk_1 !match_1; |
| 2587 | 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 | 2766 | break :blk_1 true; |
| 2590 | | } and p.parsenewline()) break :blk_0 true; |
| 2767 | } and try p.parsenewline()) break :blk_0 true; |
| 2591 | 2768 | p.i = pos_0; |
| 2592 | 2769 | if (blk_1: { |
| 2593 | 2770 | if (std.mem.startsWith(u8, p.source[p.i..], "////")) { |
| ... | ... | @@ -2596,14 +2773,18 @@ const Parser = struct { |
| 2596 | 2773 | } |
| 2597 | 2774 | break :blk_1 false; |
| 2598 | 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 | 2781 | break :blk_1 true; |
| 2601 | | } and p.parsenewline()) break :blk_0 true; |
| 2782 | } and try p.parsenewline()) break :blk_0 true; |
| 2602 | 2783 | p.i = pos_0; |
| 2603 | 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 | 2788 | return blk_0: { |
| 2608 | 2789 | const pos_0 = p.i; |
| 2609 | 2790 | if (blk_1: { |
| ... | ... | @@ -2613,14 +2794,18 @@ const Parser = struct { |
| 2613 | 2794 | } |
| 2614 | 2795 | break :blk_1 false; |
| 2615 | 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 | 2802 | break :blk_1 true; |
| 2618 | | } and p.parsenewline()) break :blk_0 true; |
| 2803 | } and try p.parsenewline()) break :blk_0 true; |
| 2619 | 2804 | p.i = pos_0; |
| 2620 | 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 | 2809 | return blk_0: { |
| 2625 | 2810 | const pos_0 = p.i; |
| 2626 | 2811 | if (blk_1: { |
| ... | ... | @@ -2643,7 +2828,7 @@ const Parser = struct { |
| 2643 | 2828 | break :blk_4 false; |
| 2644 | 2829 | }) break :blk_3 true; |
| 2645 | 2830 | p.i = pos_3; |
| 2646 | | if (p.parseeof()) break :blk_3 true; |
| 2831 | if (try p.parseeof()) break :blk_3 true; |
| 2647 | 2832 | p.i = pos_3; |
| 2648 | 2833 | break :blk_3 false; |
| 2649 | 2834 | }; |
| ... | ... | @@ -2654,10 +2839,11 @@ const Parser = struct { |
| 2654 | 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 | 2843 | return blk_0: { |
| 2659 | 2844 | const pos_0 = p.i; |
| 2660 | 2845 | if (blk_1: { |
| 2846 | var i_1: usize = 0; |
| 2661 | 2847 | while (blk_3: { |
| 2662 | 2848 | const pos_3 = p.i; |
| 2663 | 2849 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2672,20 +2858,24 @@ const Parser = struct { |
| 2672 | 2858 | else => false, |
| 2673 | 2859 | })) break :blk_3 true; |
| 2674 | 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 | 2862 | p.i = pos_3; |
| 2677 | 2863 | break :blk_3 false; |
| 2678 | | }) {} |
| 2864 | }) { |
| 2865 | if (i_1 > max_depth) return error.MaxDepth; |
| 2866 | i_1 += 1; |
| 2867 | } |
| 2679 | 2868 | break :blk_1 true; |
| 2680 | 2869 | }) break :blk_0 true; |
| 2681 | 2870 | p.i = pos_0; |
| 2682 | 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 | 2875 | return blk_0: { |
| 2687 | 2876 | const pos_0 = p.i; |
| 2688 | 2877 | if (blk_1: { |
| 2878 | var i_1: usize = 0; |
| 2689 | 2879 | while ((p.i < p.source.len and switch (p.source[p.i]) { |
| 2690 | 2880 | ' '...' ', |
| 2691 | 2881 | '\t'...'\t', |
| ... | ... | @@ -2695,7 +2885,10 @@ const Parser = struct { |
| 2695 | 2885 | break :blk_2 true; |
| 2696 | 2886 | }, |
| 2697 | 2887 | else => false, |
| 2698 | | })) {} |
| 2888 | })) { |
| 2889 | if (i_1 > max_depth) return error.MaxDepth; |
| 2890 | i_1 += 1; |
| 2891 | } |
| 2699 | 2892 | break :blk_1 true; |
| 2700 | 2893 | } and blk_2: { |
| 2701 | 2894 | const pos_2 = p.i; |
| ... | ... | @@ -2708,19 +2901,20 @@ const Parser = struct { |
| 2708 | 2901 | else => false, |
| 2709 | 2902 | })) break :blk_2 true; |
| 2710 | 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 | 2905 | p.i = pos_2; |
| 2713 | 2906 | break :blk_2 false; |
| 2714 | | } and p.parseskip()) break :blk_0 true; |
| 2907 | } and try p.parseskip()) break :blk_0 true; |
| 2715 | 2908 | p.i = pos_0; |
| 2716 | 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 | 2913 | return blk_0: { |
| 2721 | 2914 | const pos_0 = p.i; |
| 2722 | 2915 | if (blk_1: { |
| 2723 | 2916 | var match_1 = false; |
| 2917 | var i_1: usize = 0; |
| 2724 | 2918 | while (blk_3: { |
| 2725 | 2919 | const pos_3 = p.i; |
| 2726 | 2920 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2735,11 +2929,13 @@ const Parser = struct { |
| 2735 | 2929 | else => false, |
| 2736 | 2930 | })) break :blk_3 true; |
| 2737 | 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 | 2933 | p.i = pos_3; |
| 2740 | 2934 | break :blk_3 false; |
| 2741 | 2935 | }) { |
| 2742 | 2936 | match_1 = true; |
| 2937 | if (i_1 > max_depth) return error.MaxDepth; |
| 2938 | i_1 += 1; |
| 2743 | 2939 | } |
| 2744 | 2940 | break :blk_1 match_1; |
| 2745 | 2941 | }) break :blk_0 true; |
| ... | ... | @@ -2747,7 +2943,7 @@ const Parser = struct { |
| 2747 | 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 | 2947 | return blk_0: { |
| 2752 | 2948 | const pos_0 = p.i; |
| 2753 | 2949 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2760,15 +2956,15 @@ const Parser = struct { |
| 2760 | 2956 | break :blk_1 true; |
| 2761 | 2957 | }, |
| 2762 | 2958 | else => false, |
| 2763 | | }) and p.parseskip()) break :blk_0 true; |
| 2959 | }) and try p.parseskip()) break :blk_0 true; |
| 2764 | 2960 | p.i = pos_0; |
| 2765 | 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 | 2965 | return blk_0: { |
| 2770 | 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 | 2969 | => blk_1: { |
| 2774 | 2970 | p.i += 1; |
| ... | ... | @@ -2776,7 +2972,11 @@ const Parser = struct { |
| 2776 | 2972 | }, |
| 2777 | 2973 | else => false, |
| 2778 | 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 | 2980 | break :blk_1 true; |
| 2781 | 2981 | } and (p.i < p.source.len and switch (p.source[p.i]) { |
| 2782 | 2982 | '\''...'\'', |
| ... | ... | @@ -2790,7 +2990,7 @@ const Parser = struct { |
| 2790 | 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 | 2994 | return blk_0: { |
| 2795 | 2995 | const pos_0 = p.i; |
| 2796 | 2996 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2812,10 +3012,10 @@ const Parser = struct { |
| 2812 | 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 | 3016 | return blk_0: { |
| 2817 | 3017 | const pos_0 = p.i; |
| 2818 | | if (p.parsedigit()) break :blk_0 true; |
| 3018 | if (try p.parsedigit()) break :blk_0 true; |
| 2819 | 3019 | p.i = pos_0; |
| 2820 | 3020 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| 2821 | 3021 | 'e'...'e', |
| ... | ... | @@ -2832,10 +3032,10 @@ const Parser = struct { |
| 2832 | 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 | 3036 | return blk_0: { |
| 2837 | 3037 | const pos_0 = p.i; |
| 2838 | | if (p.parsedigit()) break :blk_0 true; |
| 3038 | if (try p.parsedigit()) break :blk_0 true; |
| 2839 | 3039 | p.i = pos_0; |
| 2840 | 3040 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| 2841 | 3041 | 'e'...'e', |
| ... | ... | @@ -2860,10 +3060,10 @@ const Parser = struct { |
| 2860 | 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 | 3064 | return blk_0: { |
| 2865 | 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 | 3067 | '0'...'9', |
| 2868 | 3068 | => blk_1: { |
| 2869 | 3069 | p.i += 1; |
| ... | ... | @@ -2871,7 +3071,11 @@ const Parser = struct { |
| 2871 | 3071 | }, |
| 2872 | 3072 | else => false, |
| 2873 | 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 | 3079 | break :blk_1 true; |
| 2876 | 3080 | } and blk_1: { |
| 2877 | 3081 | if (std.mem.startsWith(u8, p.source[p.i..], ".")) { |
| ... | ... | @@ -2881,13 +3085,16 @@ const Parser = struct { |
| 2881 | 3085 | break :blk_1 false; |
| 2882 | 3086 | } and blk_1: { |
| 2883 | 3087 | var match_1 = false; |
| 2884 | | while (p.parsedigit_float()) { |
| 3088 | var i_1: usize = 0; |
| 3089 | while (try p.parsedigit_float()) { |
| 2885 | 3090 | match_1 = true; |
| 3091 | if (i_1 > max_depth) return error.MaxDepth; |
| 3092 | i_1 += 1; |
| 2886 | 3093 | } |
| 2887 | 3094 | break :blk_1 match_1; |
| 2888 | 3095 | }) break :blk_0 true; |
| 2889 | 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 | 3098 | '0'...'9', |
| 2892 | 3099 | => blk_1: { |
| 2893 | 3100 | p.i += 1; |
| ... | ... | @@ -2895,14 +3102,18 @@ const Parser = struct { |
| 2895 | 3102 | }, |
| 2896 | 3103 | else => false, |
| 2897 | 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 | 3110 | break :blk_1 true; |
| 2900 | 3111 | }) break :blk_0 true; |
| 2901 | 3112 | p.i = pos_0; |
| 2902 | 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 | 3117 | return blk_0: { |
| 2907 | 3118 | const pos_0 = p.i; |
| 2908 | 3119 | if ((p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2913,7 +3124,11 @@ const Parser = struct { |
| 2913 | 3124 | }, |
| 2914 | 3125 | else => false, |
| 2915 | 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 | 3132 | break :blk_1 true; |
| 2918 | 3133 | } and (p.i < p.source.len and switch (p.source[p.i]) { |
| 2919 | 3134 | '"'...'"', |
| ... | ... | @@ -2927,28 +3142,31 @@ const Parser = struct { |
| 2927 | 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 | 3146 | return blk_0: { |
| 2932 | 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 | 3149 | p.i = pos_0; |
| 2935 | 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 | 3154 | return blk_0: { |
| 2940 | 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 | 3157 | p.i = pos_0; |
| 2943 | 3158 | if (blk_1: { |
| 2944 | 3159 | var match_1 = false; |
| 3160 | var i_1: usize = 0; |
| 2945 | 3161 | while (blk_3: { |
| 2946 | 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 | 3164 | p.i = pos_3; |
| 2949 | 3165 | break :blk_3 false; |
| 2950 | 3166 | }) { |
| 2951 | 3167 | match_1 = true; |
| 3168 | if (i_1 > max_depth) return error.MaxDepth; |
| 3169 | i_1 += 1; |
| 2952 | 3170 | } |
| 2953 | 3171 | break :blk_1 match_1; |
| 2954 | 3172 | }) break :blk_0 true; |
| ... | ... | @@ -2956,12 +3174,12 @@ const Parser = struct { |
| 2956 | 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 | 3178 | return blk_0: { |
| 2961 | 3179 | const pos_0 = p.i; |
| 2962 | | if (p.parseskip() and blk_1: { |
| 3180 | if (try p.parseskip() and blk_1: { |
| 2963 | 3181 | const pos_1 = p.i; |
| 2964 | | const match_1 = p.parsekeyword(); |
| 3182 | const match_1 = try p.parsekeyword(); |
| 2965 | 3183 | p.i = pos_1; |
| 2966 | 3184 | break :blk_1 !match_1; |
| 2967 | 3185 | } and (p.i < p.source.len and switch (p.source[p.i]) { |
| ... | ... | @@ -2974,6 +3192,7 @@ const Parser = struct { |
| 2974 | 3192 | }, |
| 2975 | 3193 | else => false, |
| 2976 | 3194 | }) and blk_1: { |
| 3195 | var i_1: usize = 0; |
| 2977 | 3196 | while ((p.i < p.source.len and switch (p.source[p.i]) { |
| 2978 | 3197 | 'A'...'Z', |
| 2979 | 3198 | 'a'...'z', |
| ... | ... | @@ -2984,25 +3203,28 @@ const Parser = struct { |
| 2984 | 3203 | break :blk_2 true; |
| 2985 | 3204 | }, |
| 2986 | 3205 | else => false, |
| 2987 | | })) {} |
| 3206 | })) { |
| 3207 | if (i_1 > max_depth) return error.MaxDepth; |
| 3208 | i_1 += 1; |
| 3209 | } |
| 2988 | 3210 | break :blk_1 true; |
| 2989 | 3211 | }) break :blk_0 true; |
| 2990 | 3212 | p.i = pos_0; |
| 2991 | | if (p.parseskip() and blk_1: { |
| 3213 | if (try p.parseskip() and blk_1: { |
| 2992 | 3214 | if (std.mem.startsWith(u8, p.source[p.i..], "@")) { |
| 2993 | 3215 | p.i += 1; |
| 2994 | 3216 | break :blk_1 true; |
| 2995 | 3217 | } |
| 2996 | 3218 | break :blk_1 false; |
| 2997 | | } and p.parsestring()) break :blk_0 true; |
| 3219 | } and try p.parsestring()) break :blk_0 true; |
| 2998 | 3220 | p.i = pos_0; |
| 2999 | 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 | 3225 | return blk_0: { |
| 3004 | 3226 | const pos_0 = p.i; |
| 3005 | | if (p.parseskip() and blk_1: { |
| 3227 | if (try p.parseskip() and blk_1: { |
| 3006 | 3228 | if (std.mem.startsWith(u8, p.source[p.i..], "@")) { |
| 3007 | 3229 | p.i += 1; |
| 3008 | 3230 | break :blk_1 true; |
| ... | ... | @@ -3018,6 +3240,7 @@ const Parser = struct { |
| 3018 | 3240 | }, |
| 3019 | 3241 | else => false, |
| 3020 | 3242 | }) and blk_1: { |
| 3243 | var i_1: usize = 0; |
| 3021 | 3244 | while ((p.i < p.source.len and switch (p.source[p.i]) { |
| 3022 | 3245 | 'A'...'Z', |
| 3023 | 3246 | 'a'...'z', |
| ... | ... | @@ -3028,17 +3251,20 @@ const Parser = struct { |
| 3028 | 3251 | break :blk_2 true; |
| 3029 | 3252 | }, |
| 3030 | 3253 | else => false, |
| 3031 | | })) {} |
| 3254 | })) { |
| 3255 | if (i_1 > max_depth) return error.MaxDepth; |
| 3256 | i_1 += 1; |
| 3257 | } |
| 3032 | 3258 | break :blk_1 true; |
| 3033 | 3259 | }) break :blk_0 true; |
| 3034 | 3260 | p.i = pos_0; |
| 3035 | 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 | 3265 | return blk_0: { |
| 3040 | 3266 | const pos_0 = p.i; |
| 3041 | | if (p.parseskip() and blk_1: { |
| 3267 | if (try p.parseskip() and blk_1: { |
| 3042 | 3268 | if (std.mem.startsWith(u8, p.source[p.i..], "&")) { |
| 3043 | 3269 | p.i += 1; |
| 3044 | 3270 | break :blk_1 true; |
| ... | ... | @@ -3061,10 +3287,10 @@ const Parser = struct { |
| 3061 | 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 | 3291 | return blk_0: { |
| 3066 | 3292 | const pos_0 = p.i; |
| 3067 | | if (p.parseskip() and blk_1: { |
| 3293 | if (try p.parseskip() and blk_1: { |
| 3068 | 3294 | if (std.mem.startsWith(u8, p.source[p.i..], "&=")) { |
| 3069 | 3295 | p.i += 2; |
| 3070 | 3296 | break :blk_1 true; |
| ... | ... | @@ -3075,10 +3301,10 @@ const Parser = struct { |
| 3075 | 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 | 3305 | return blk_0: { |
| 3080 | 3306 | const pos_0 = p.i; |
| 3081 | | if (p.parseskip() and blk_1: { |
| 3307 | if (try p.parseskip() and blk_1: { |
| 3082 | 3308 | if (std.mem.startsWith(u8, p.source[p.i..], "*")) { |
| 3083 | 3309 | p.i += 1; |
| 3084 | 3310 | break :blk_1 true; |
| ... | ... | @@ -3103,10 +3329,10 @@ const Parser = struct { |
| 3103 | 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 | 3333 | return blk_0: { |
| 3108 | 3334 | const pos_0 = p.i; |
| 3109 | | if (p.parseskip() and blk_1: { |
| 3335 | if (try p.parseskip() and blk_1: { |
| 3110 | 3336 | if (std.mem.startsWith(u8, p.source[p.i..], "*=")) { |
| 3111 | 3337 | p.i += 2; |
| 3112 | 3338 | break :blk_1 true; |
| ... | ... | @@ -3117,10 +3343,10 @@ const Parser = struct { |
| 3117 | 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 | 3347 | return blk_0: { |
| 3122 | 3348 | const pos_0 = p.i; |
| 3123 | | if (p.parseskip() and blk_1: { |
| 3349 | if (try p.parseskip() and blk_1: { |
| 3124 | 3350 | if (std.mem.startsWith(u8, p.source[p.i..], "*%")) { |
| 3125 | 3351 | p.i += 2; |
| 3126 | 3352 | break :blk_1 true; |
| ... | ... | @@ -3143,10 +3369,10 @@ const Parser = struct { |
| 3143 | 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 | 3373 | return blk_0: { |
| 3148 | 3374 | const pos_0 = p.i; |
| 3149 | | if (p.parseskip() and blk_1: { |
| 3375 | if (try p.parseskip() and blk_1: { |
| 3150 | 3376 | if (std.mem.startsWith(u8, p.source[p.i..], "*%=")) { |
| 3151 | 3377 | p.i += 3; |
| 3152 | 3378 | break :blk_1 true; |
| ... | ... | @@ -3157,10 +3383,10 @@ const Parser = struct { |
| 3157 | 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 | 3387 | return blk_0: { |
| 3162 | 3388 | const pos_0 = p.i; |
| 3163 | | if (p.parseskip() and blk_1: { |
| 3389 | if (try p.parseskip() and blk_1: { |
| 3164 | 3390 | if (std.mem.startsWith(u8, p.source[p.i..], "*|")) { |
| 3165 | 3391 | p.i += 2; |
| 3166 | 3392 | break :blk_1 true; |
| ... | ... | @@ -3183,10 +3409,10 @@ const Parser = struct { |
| 3183 | 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 | 3413 | return blk_0: { |
| 3188 | 3414 | const pos_0 = p.i; |
| 3189 | | if (p.parseskip() and blk_1: { |
| 3415 | if (try p.parseskip() and blk_1: { |
| 3190 | 3416 | if (std.mem.startsWith(u8, p.source[p.i..], "*|=")) { |
| 3191 | 3417 | p.i += 3; |
| 3192 | 3418 | break :blk_1 true; |
| ... | ... | @@ -3197,10 +3423,10 @@ const Parser = struct { |
| 3197 | 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 | 3427 | return blk_0: { |
| 3202 | 3428 | const pos_0 = p.i; |
| 3203 | | if (p.parseskip() and blk_1: { |
| 3429 | if (try p.parseskip() and blk_1: { |
| 3204 | 3430 | if (std.mem.startsWith(u8, p.source[p.i..], "^")) { |
| 3205 | 3431 | p.i += 1; |
| 3206 | 3432 | break :blk_1 true; |
| ... | ... | @@ -3223,10 +3449,10 @@ const Parser = struct { |
| 3223 | 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 | 3453 | return blk_0: { |
| 3228 | 3454 | const pos_0 = p.i; |
| 3229 | | if (p.parseskip() and blk_1: { |
| 3455 | if (try p.parseskip() and blk_1: { |
| 3230 | 3456 | if (std.mem.startsWith(u8, p.source[p.i..], "^=")) { |
| 3231 | 3457 | p.i += 2; |
| 3232 | 3458 | break :blk_1 true; |
| ... | ... | @@ -3237,10 +3463,10 @@ const Parser = struct { |
| 3237 | 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 | 3467 | return blk_0: { |
| 3242 | 3468 | const pos_0 = p.i; |
| 3243 | | if (p.parseskip() and blk_1: { |
| 3469 | if (try p.parseskip() and blk_1: { |
| 3244 | 3470 | if (std.mem.startsWith(u8, p.source[p.i..], ":")) { |
| 3245 | 3471 | p.i += 1; |
| 3246 | 3472 | break :blk_1 true; |
| ... | ... | @@ -3251,10 +3477,10 @@ const Parser = struct { |
| 3251 | 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 | 3481 | return blk_0: { |
| 3256 | 3482 | const pos_0 = p.i; |
| 3257 | | if (p.parseskip() and blk_1: { |
| 3483 | if (try p.parseskip() and blk_1: { |
| 3258 | 3484 | if (std.mem.startsWith(u8, p.source[p.i..], ",")) { |
| 3259 | 3485 | p.i += 1; |
| 3260 | 3486 | break :blk_1 true; |
| ... | ... | @@ -3265,10 +3491,10 @@ const Parser = struct { |
| 3265 | 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 | 3495 | return blk_0: { |
| 3270 | 3496 | const pos_0 = p.i; |
| 3271 | | if (p.parseskip() and blk_1: { |
| 3497 | if (try p.parseskip() and blk_1: { |
| 3272 | 3498 | if (std.mem.startsWith(u8, p.source[p.i..], ".")) { |
| 3273 | 3499 | p.i += 1; |
| 3274 | 3500 | break :blk_1 true; |
| ... | ... | @@ -3292,10 +3518,10 @@ const Parser = struct { |
| 3292 | 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 | 3522 | return blk_0: { |
| 3297 | 3523 | const pos_0 = p.i; |
| 3298 | | if (p.parseskip() and blk_1: { |
| 3524 | if (try p.parseskip() and blk_1: { |
| 3299 | 3525 | if (std.mem.startsWith(u8, p.source[p.i..], "..")) { |
| 3300 | 3526 | p.i += 2; |
| 3301 | 3527 | break :blk_1 true; |
| ... | ... | @@ -3318,10 +3544,10 @@ const Parser = struct { |
| 3318 | 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 | 3548 | return blk_0: { |
| 3323 | 3549 | const pos_0 = p.i; |
| 3324 | | if (p.parseskip() and blk_1: { |
| 3550 | if (try p.parseskip() and blk_1: { |
| 3325 | 3551 | if (std.mem.startsWith(u8, p.source[p.i..], "...")) { |
| 3326 | 3552 | p.i += 3; |
| 3327 | 3553 | break :blk_1 true; |
| ... | ... | @@ -3332,10 +3558,10 @@ const Parser = struct { |
| 3332 | 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 | 3562 | return blk_0: { |
| 3337 | 3563 | const pos_0 = p.i; |
| 3338 | | if (p.parseskip() and blk_1: { |
| 3564 | if (try p.parseskip() and blk_1: { |
| 3339 | 3565 | if (std.mem.startsWith(u8, p.source[p.i..], ".*")) { |
| 3340 | 3566 | p.i += 2; |
| 3341 | 3567 | break :blk_1 true; |
| ... | ... | @@ -3346,10 +3572,10 @@ const Parser = struct { |
| 3346 | 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 | 3576 | return blk_0: { |
| 3351 | 3577 | const pos_0 = p.i; |
| 3352 | | if (p.parseskip() and blk_1: { |
| 3578 | if (try p.parseskip() and blk_1: { |
| 3353 | 3579 | if (std.mem.startsWith(u8, p.source[p.i..], "=")) { |
| 3354 | 3580 | p.i += 1; |
| 3355 | 3581 | break :blk_1 true; |
| ... | ... | @@ -3373,10 +3599,10 @@ const Parser = struct { |
| 3373 | 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 | 3603 | return blk_0: { |
| 3378 | 3604 | const pos_0 = p.i; |
| 3379 | | if (p.parseskip() and blk_1: { |
| 3605 | if (try p.parseskip() and blk_1: { |
| 3380 | 3606 | if (std.mem.startsWith(u8, p.source[p.i..], "==")) { |
| 3381 | 3607 | p.i += 2; |
| 3382 | 3608 | break :blk_1 true; |
| ... | ... | @@ -3387,10 +3613,10 @@ const Parser = struct { |
| 3387 | 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 | 3617 | return blk_0: { |
| 3392 | 3618 | const pos_0 = p.i; |
| 3393 | | if (p.parseskip() and blk_1: { |
| 3619 | if (try p.parseskip() and blk_1: { |
| 3394 | 3620 | if (std.mem.startsWith(u8, p.source[p.i..], "=>")) { |
| 3395 | 3621 | p.i += 2; |
| 3396 | 3622 | break :blk_1 true; |
| ... | ... | @@ -3401,10 +3627,10 @@ const Parser = struct { |
| 3401 | 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 | 3631 | return blk_0: { |
| 3406 | 3632 | const pos_0 = p.i; |
| 3407 | | if (p.parseskip() and blk_1: { |
| 3633 | if (try p.parseskip() and blk_1: { |
| 3408 | 3634 | if (std.mem.startsWith(u8, p.source[p.i..], "!")) { |
| 3409 | 3635 | p.i += 1; |
| 3410 | 3636 | break :blk_1 true; |
| ... | ... | @@ -3427,10 +3653,10 @@ const Parser = struct { |
| 3427 | 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 | 3657 | return blk_0: { |
| 3432 | 3658 | const pos_0 = p.i; |
| 3433 | | if (p.parseskip() and blk_1: { |
| 3659 | if (try p.parseskip() and blk_1: { |
| 3434 | 3660 | if (std.mem.startsWith(u8, p.source[p.i..], "!=")) { |
| 3435 | 3661 | p.i += 2; |
| 3436 | 3662 | break :blk_1 true; |
| ... | ... | @@ -3441,10 +3667,10 @@ const Parser = struct { |
| 3441 | 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 | 3671 | return blk_0: { |
| 3446 | 3672 | const pos_0 = p.i; |
| 3447 | | if (p.parseskip() and blk_1: { |
| 3673 | if (try p.parseskip() and blk_1: { |
| 3448 | 3674 | if (std.mem.startsWith(u8, p.source[p.i..], "<")) { |
| 3449 | 3675 | p.i += 1; |
| 3450 | 3676 | break :blk_1 true; |
| ... | ... | @@ -3468,10 +3694,10 @@ const Parser = struct { |
| 3468 | 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 | 3698 | return blk_0: { |
| 3473 | 3699 | const pos_0 = p.i; |
| 3474 | | if (p.parseskip() and blk_1: { |
| 3700 | if (try p.parseskip() and blk_1: { |
| 3475 | 3701 | if (std.mem.startsWith(u8, p.source[p.i..], "<<")) { |
| 3476 | 3702 | p.i += 2; |
| 3477 | 3703 | break :blk_1 true; |
| ... | ... | @@ -3495,10 +3721,10 @@ const Parser = struct { |
| 3495 | 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 | 3725 | return blk_0: { |
| 3500 | 3726 | const pos_0 = p.i; |
| 3501 | | if (p.parseskip() and blk_1: { |
| 3727 | if (try p.parseskip() and blk_1: { |
| 3502 | 3728 | if (std.mem.startsWith(u8, p.source[p.i..], "<<=")) { |
| 3503 | 3729 | p.i += 3; |
| 3504 | 3730 | break :blk_1 true; |
| ... | ... | @@ -3509,10 +3735,10 @@ const Parser = struct { |
| 3509 | 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 | 3739 | return blk_0: { |
| 3514 | 3740 | const pos_0 = p.i; |
| 3515 | | if (p.parseskip() and blk_1: { |
| 3741 | if (try p.parseskip() and blk_1: { |
| 3516 | 3742 | if (std.mem.startsWith(u8, p.source[p.i..], "<<|")) { |
| 3517 | 3743 | p.i += 3; |
| 3518 | 3744 | break :blk_1 true; |
| ... | ... | @@ -3535,10 +3761,10 @@ const Parser = struct { |
| 3535 | 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 | 3765 | return blk_0: { |
| 3540 | 3766 | const pos_0 = p.i; |
| 3541 | | if (p.parseskip() and blk_1: { |
| 3767 | if (try p.parseskip() and blk_1: { |
| 3542 | 3768 | if (std.mem.startsWith(u8, p.source[p.i..], "<<|=")) { |
| 3543 | 3769 | p.i += 4; |
| 3544 | 3770 | break :blk_1 true; |
| ... | ... | @@ -3549,10 +3775,10 @@ const Parser = struct { |
| 3549 | 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 | 3779 | return blk_0: { |
| 3554 | 3780 | const pos_0 = p.i; |
| 3555 | | if (p.parseskip() and blk_1: { |
| 3781 | if (try p.parseskip() and blk_1: { |
| 3556 | 3782 | if (std.mem.startsWith(u8, p.source[p.i..], "<=")) { |
| 3557 | 3783 | p.i += 2; |
| 3558 | 3784 | break :blk_1 true; |
| ... | ... | @@ -3563,10 +3789,10 @@ const Parser = struct { |
| 3563 | 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 | 3793 | return blk_0: { |
| 3568 | 3794 | const pos_0 = p.i; |
| 3569 | | if (p.parseskip() and blk_1: { |
| 3795 | if (try p.parseskip() and blk_1: { |
| 3570 | 3796 | if (std.mem.startsWith(u8, p.source[p.i..], "{")) { |
| 3571 | 3797 | p.i += 1; |
| 3572 | 3798 | break :blk_1 true; |
| ... | ... | @@ -3577,10 +3803,10 @@ const Parser = struct { |
| 3577 | 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 | 3807 | return blk_0: { |
| 3582 | 3808 | const pos_0 = p.i; |
| 3583 | | if (p.parseskip() and blk_1: { |
| 3809 | if (try p.parseskip() and blk_1: { |
| 3584 | 3810 | if (std.mem.startsWith(u8, p.source[p.i..], "[")) { |
| 3585 | 3811 | p.i += 1; |
| 3586 | 3812 | break :blk_1 true; |
| ... | ... | @@ -3591,10 +3817,10 @@ const Parser = struct { |
| 3591 | 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 | 3821 | return blk_0: { |
| 3596 | 3822 | const pos_0 = p.i; |
| 3597 | | if (p.parseskip() and blk_1: { |
| 3823 | if (try p.parseskip() and blk_1: { |
| 3598 | 3824 | if (std.mem.startsWith(u8, p.source[p.i..], "(")) { |
| 3599 | 3825 | p.i += 1; |
| 3600 | 3826 | break :blk_1 true; |
| ... | ... | @@ -3605,10 +3831,10 @@ const Parser = struct { |
| 3605 | 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 | 3835 | return blk_0: { |
| 3610 | 3836 | const pos_0 = p.i; |
| 3611 | | if (p.parseskip() and blk_1: { |
| 3837 | if (try p.parseskip() and blk_1: { |
| 3612 | 3838 | if (std.mem.startsWith(u8, p.source[p.i..], "-")) { |
| 3613 | 3839 | p.i += 1; |
| 3614 | 3840 | break :blk_1 true; |
| ... | ... | @@ -3634,10 +3860,10 @@ const Parser = struct { |
| 3634 | 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 | 3864 | return blk_0: { |
| 3639 | 3865 | const pos_0 = p.i; |
| 3640 | | if (p.parseskip() and blk_1: { |
| 3866 | if (try p.parseskip() and blk_1: { |
| 3641 | 3867 | if (std.mem.startsWith(u8, p.source[p.i..], "-=")) { |
| 3642 | 3868 | p.i += 2; |
| 3643 | 3869 | break :blk_1 true; |
| ... | ... | @@ -3648,10 +3874,10 @@ const Parser = struct { |
| 3648 | 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 | 3878 | return blk_0: { |
| 3653 | 3879 | const pos_0 = p.i; |
| 3654 | | if (p.parseskip() and blk_1: { |
| 3880 | if (try p.parseskip() and blk_1: { |
| 3655 | 3881 | if (std.mem.startsWith(u8, p.source[p.i..], "-%")) { |
| 3656 | 3882 | p.i += 2; |
| 3657 | 3883 | break :blk_1 true; |
| ... | ... | @@ -3674,10 +3900,10 @@ const Parser = struct { |
| 3674 | 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 | 3904 | return blk_0: { |
| 3679 | 3905 | const pos_0 = p.i; |
| 3680 | | if (p.parseskip() and blk_1: { |
| 3906 | if (try p.parseskip() and blk_1: { |
| 3681 | 3907 | if (std.mem.startsWith(u8, p.source[p.i..], "-%=")) { |
| 3682 | 3908 | p.i += 3; |
| 3683 | 3909 | break :blk_1 true; |
| ... | ... | @@ -3688,10 +3914,10 @@ const Parser = struct { |
| 3688 | 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 | 3918 | return blk_0: { |
| 3693 | 3919 | const pos_0 = p.i; |
| 3694 | | if (p.parseskip() and blk_1: { |
| 3920 | if (try p.parseskip() and blk_1: { |
| 3695 | 3921 | if (std.mem.startsWith(u8, p.source[p.i..], "-|")) { |
| 3696 | 3922 | p.i += 2; |
| 3697 | 3923 | break :blk_1 true; |
| ... | ... | @@ -3714,10 +3940,10 @@ const Parser = struct { |
| 3714 | 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 | 3944 | return blk_0: { |
| 3719 | 3945 | const pos_0 = p.i; |
| 3720 | | if (p.parseskip() and blk_1: { |
| 3946 | if (try p.parseskip() and blk_1: { |
| 3721 | 3947 | if (std.mem.startsWith(u8, p.source[p.i..], "-|=")) { |
| 3722 | 3948 | p.i += 3; |
| 3723 | 3949 | break :blk_1 true; |
| ... | ... | @@ -3728,10 +3954,10 @@ const Parser = struct { |
| 3728 | 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 | 3958 | return blk_0: { |
| 3733 | 3959 | const pos_0 = p.i; |
| 3734 | | if (p.parseskip() and blk_1: { |
| 3960 | if (try p.parseskip() and blk_1: { |
| 3735 | 3961 | if (std.mem.startsWith(u8, p.source[p.i..], "->")) { |
| 3736 | 3962 | p.i += 2; |
| 3737 | 3963 | break :blk_1 true; |
| ... | ... | @@ -3742,10 +3968,10 @@ const Parser = struct { |
| 3742 | 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 | 3972 | return blk_0: { |
| 3747 | 3973 | const pos_0 = p.i; |
| 3748 | | if (p.parseskip() and blk_1: { |
| 3974 | if (try p.parseskip() and blk_1: { |
| 3749 | 3975 | if (std.mem.startsWith(u8, p.source[p.i..], "%")) { |
| 3750 | 3976 | p.i += 1; |
| 3751 | 3977 | break :blk_1 true; |
| ... | ... | @@ -3768,10 +3994,10 @@ const Parser = struct { |
| 3768 | 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 | 3998 | return blk_0: { |
| 3773 | 3999 | const pos_0 = p.i; |
| 3774 | | if (p.parseskip() and blk_1: { |
| 4000 | if (try p.parseskip() and blk_1: { |
| 3775 | 4001 | if (std.mem.startsWith(u8, p.source[p.i..], "%=")) { |
| 3776 | 4002 | p.i += 2; |
| 3777 | 4003 | break :blk_1 true; |
| ... | ... | @@ -3782,10 +4008,10 @@ const Parser = struct { |
| 3782 | 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 | 4012 | return blk_0: { |
| 3787 | 4013 | const pos_0 = p.i; |
| 3788 | | if (p.parseskip() and blk_1: { |
| 4014 | if (try p.parseskip() and blk_1: { |
| 3789 | 4015 | if (std.mem.startsWith(u8, p.source[p.i..], "|")) { |
| 3790 | 4016 | p.i += 1; |
| 3791 | 4017 | break :blk_1 true; |
| ... | ... | @@ -3809,10 +4035,10 @@ const Parser = struct { |
| 3809 | 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 | 4039 | return blk_0: { |
| 3814 | 4040 | const pos_0 = p.i; |
| 3815 | | if (p.parseskip() and blk_1: { |
| 4041 | if (try p.parseskip() and blk_1: { |
| 3816 | 4042 | if (std.mem.startsWith(u8, p.source[p.i..], "||")) { |
| 3817 | 4043 | p.i += 2; |
| 3818 | 4044 | break :blk_1 true; |
| ... | ... | @@ -3823,10 +4049,10 @@ const Parser = struct { |
| 3823 | 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 | 4053 | return blk_0: { |
| 3828 | 4054 | const pos_0 = p.i; |
| 3829 | | if (p.parseskip() and blk_1: { |
| 4055 | if (try p.parseskip() and blk_1: { |
| 3830 | 4056 | if (std.mem.startsWith(u8, p.source[p.i..], "|=")) { |
| 3831 | 4057 | p.i += 2; |
| 3832 | 4058 | break :blk_1 true; |
| ... | ... | @@ -3837,10 +4063,10 @@ const Parser = struct { |
| 3837 | 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 | 4067 | return blk_0: { |
| 3842 | 4068 | const pos_0 = p.i; |
| 3843 | | if (p.parseskip() and blk_1: { |
| 4069 | if (try p.parseskip() and blk_1: { |
| 3844 | 4070 | if (std.mem.startsWith(u8, p.source[p.i..], "+")) { |
| 3845 | 4071 | p.i += 1; |
| 3846 | 4072 | break :blk_1 true; |
| ... | ... | @@ -3866,10 +4092,10 @@ const Parser = struct { |
| 3866 | 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 | 4096 | return blk_0: { |
| 3871 | 4097 | const pos_0 = p.i; |
| 3872 | | if (p.parseskip() and blk_1: { |
| 4098 | if (try p.parseskip() and blk_1: { |
| 3873 | 4099 | if (std.mem.startsWith(u8, p.source[p.i..], "++")) { |
| 3874 | 4100 | p.i += 2; |
| 3875 | 4101 | break :blk_1 true; |
| ... | ... | @@ -3880,10 +4106,10 @@ const Parser = struct { |
| 3880 | 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 | 4110 | return blk_0: { |
| 3885 | 4111 | const pos_0 = p.i; |
| 3886 | | if (p.parseskip() and blk_1: { |
| 4112 | if (try p.parseskip() and blk_1: { |
| 3887 | 4113 | if (std.mem.startsWith(u8, p.source[p.i..], "+=")) { |
| 3888 | 4114 | p.i += 2; |
| 3889 | 4115 | break :blk_1 true; |
| ... | ... | @@ -3894,10 +4120,10 @@ const Parser = struct { |
| 3894 | 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 | 4124 | return blk_0: { |
| 3899 | 4125 | const pos_0 = p.i; |
| 3900 | | if (p.parseskip() and blk_1: { |
| 4126 | if (try p.parseskip() and blk_1: { |
| 3901 | 4127 | if (std.mem.startsWith(u8, p.source[p.i..], "+%")) { |
| 3902 | 4128 | p.i += 2; |
| 3903 | 4129 | break :blk_1 true; |
| ... | ... | @@ -3920,10 +4146,10 @@ const Parser = struct { |
| 3920 | 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 | 4150 | return blk_0: { |
| 3925 | 4151 | const pos_0 = p.i; |
| 3926 | | if (p.parseskip() and blk_1: { |
| 4152 | if (try p.parseskip() and blk_1: { |
| 3927 | 4153 | if (std.mem.startsWith(u8, p.source[p.i..], "+%=")) { |
| 3928 | 4154 | p.i += 3; |
| 3929 | 4155 | break :blk_1 true; |
| ... | ... | @@ -3934,10 +4160,10 @@ const Parser = struct { |
| 3934 | 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 | 4164 | return blk_0: { |
| 3939 | 4165 | const pos_0 = p.i; |
| 3940 | | if (p.parseskip() and blk_1: { |
| 4166 | if (try p.parseskip() and blk_1: { |
| 3941 | 4167 | if (std.mem.startsWith(u8, p.source[p.i..], "+|")) { |
| 3942 | 4168 | p.i += 2; |
| 3943 | 4169 | break :blk_1 true; |
| ... | ... | @@ -3960,10 +4186,10 @@ const Parser = struct { |
| 3960 | 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 | 4190 | return blk_0: { |
| 3965 | 4191 | const pos_0 = p.i; |
| 3966 | | if (p.parseskip() and blk_1: { |
| 4192 | if (try p.parseskip() and blk_1: { |
| 3967 | 4193 | if (std.mem.startsWith(u8, p.source[p.i..], "+|=")) { |
| 3968 | 4194 | p.i += 3; |
| 3969 | 4195 | break :blk_1 true; |
| ... | ... | @@ -3974,10 +4200,10 @@ const Parser = struct { |
| 3974 | 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 | 4204 | return blk_0: { |
| 3979 | 4205 | const pos_0 = p.i; |
| 3980 | | if (p.parseskip() and blk_1: { |
| 4206 | if (try p.parseskip() and blk_1: { |
| 3981 | 4207 | if (std.mem.startsWith(u8, p.source[p.i..], "c")) { |
| 3982 | 4208 | p.i += 1; |
| 3983 | 4209 | break :blk_1 true; |
| ... | ... | @@ -3988,10 +4214,10 @@ const Parser = struct { |
| 3988 | 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 | 4218 | return blk_0: { |
| 3993 | 4219 | const pos_0 = p.i; |
| 3994 | | if (p.parseskip() and blk_1: { |
| 4220 | if (try p.parseskip() and blk_1: { |
| 3995 | 4221 | if (std.mem.startsWith(u8, p.source[p.i..], "?")) { |
| 3996 | 4222 | p.i += 1; |
| 3997 | 4223 | break :blk_1 true; |
| ... | ... | @@ -4002,10 +4228,10 @@ const Parser = struct { |
| 4002 | 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 | 4232 | return blk_0: { |
| 4007 | 4233 | const pos_0 = p.i; |
| 4008 | | if (p.parseskip() and blk_1: { |
| 4234 | if (try p.parseskip() and blk_1: { |
| 4009 | 4235 | if (std.mem.startsWith(u8, p.source[p.i..], ">")) { |
| 4010 | 4236 | p.i += 1; |
| 4011 | 4237 | break :blk_1 true; |
| ... | ... | @@ -4029,10 +4255,10 @@ const Parser = struct { |
| 4029 | 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 | 4259 | return blk_0: { |
| 4034 | 4260 | const pos_0 = p.i; |
| 4035 | | if (p.parseskip() and blk_1: { |
| 4261 | if (try p.parseskip() and blk_1: { |
| 4036 | 4262 | if (std.mem.startsWith(u8, p.source[p.i..], ">>")) { |
| 4037 | 4263 | p.i += 2; |
| 4038 | 4264 | break :blk_1 true; |
| ... | ... | @@ -4055,10 +4281,10 @@ const Parser = struct { |
| 4055 | 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 | 4285 | return blk_0: { |
| 4060 | 4286 | const pos_0 = p.i; |
| 4061 | | if (p.parseskip() and blk_1: { |
| 4287 | if (try p.parseskip() and blk_1: { |
| 4062 | 4288 | if (std.mem.startsWith(u8, p.source[p.i..], ">>=")) { |
| 4063 | 4289 | p.i += 3; |
| 4064 | 4290 | break :blk_1 true; |
| ... | ... | @@ -4069,10 +4295,10 @@ const Parser = struct { |
| 4069 | 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 | 4299 | return blk_0: { |
| 4074 | 4300 | const pos_0 = p.i; |
| 4075 | | if (p.parseskip() and blk_1: { |
| 4301 | if (try p.parseskip() and blk_1: { |
| 4076 | 4302 | if (std.mem.startsWith(u8, p.source[p.i..], ">=")) { |
| 4077 | 4303 | p.i += 2; |
| 4078 | 4304 | break :blk_1 true; |
| ... | ... | @@ -4083,10 +4309,10 @@ const Parser = struct { |
| 4083 | 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 | 4313 | return blk_0: { |
| 4088 | 4314 | const pos_0 = p.i; |
| 4089 | | if (p.parseskip() and blk_1: { |
| 4315 | if (try p.parseskip() and blk_1: { |
| 4090 | 4316 | if (std.mem.startsWith(u8, p.source[p.i..], "}")) { |
| 4091 | 4317 | p.i += 1; |
| 4092 | 4318 | break :blk_1 true; |
| ... | ... | @@ -4097,10 +4323,10 @@ const Parser = struct { |
| 4097 | 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 | 4327 | return blk_0: { |
| 4102 | 4328 | const pos_0 = p.i; |
| 4103 | | if (p.parseskip() and blk_1: { |
| 4329 | if (try p.parseskip() and blk_1: { |
| 4104 | 4330 | if (std.mem.startsWith(u8, p.source[p.i..], "]")) { |
| 4105 | 4331 | p.i += 1; |
| 4106 | 4332 | break :blk_1 true; |
| ... | ... | @@ -4111,10 +4337,10 @@ const Parser = struct { |
| 4111 | 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 | 4341 | return blk_0: { |
| 4116 | 4342 | const pos_0 = p.i; |
| 4117 | | if (p.parseskip() and blk_1: { |
| 4343 | if (try p.parseskip() and blk_1: { |
| 4118 | 4344 | if (std.mem.startsWith(u8, p.source[p.i..], ")")) { |
| 4119 | 4345 | p.i += 1; |
| 4120 | 4346 | break :blk_1 true; |
| ... | ... | @@ -4125,10 +4351,10 @@ const Parser = struct { |
| 4125 | 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 | 4355 | return blk_0: { |
| 4130 | 4356 | const pos_0 = p.i; |
| 4131 | | if (p.parseskip() and blk_1: { |
| 4357 | if (try p.parseskip() and blk_1: { |
| 4132 | 4358 | if (std.mem.startsWith(u8, p.source[p.i..], ";")) { |
| 4133 | 4359 | p.i += 1; |
| 4134 | 4360 | break :blk_1 true; |
| ... | ... | @@ -4139,10 +4365,10 @@ const Parser = struct { |
| 4139 | 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 | 4369 | return blk_0: { |
| 4144 | 4370 | const pos_0 = p.i; |
| 4145 | | if (p.parseskip() and blk_1: { |
| 4371 | if (try p.parseskip() and blk_1: { |
| 4146 | 4372 | if (std.mem.startsWith(u8, p.source[p.i..], "/")) { |
| 4147 | 4373 | p.i += 1; |
| 4148 | 4374 | break :blk_1 true; |
| ... | ... | @@ -4166,10 +4392,10 @@ const Parser = struct { |
| 4166 | 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 | 4396 | return blk_0: { |
| 4171 | 4397 | const pos_0 = p.i; |
| 4172 | | if (p.parseskip() and blk_1: { |
| 4398 | if (try p.parseskip() and blk_1: { |
| 4173 | 4399 | if (std.mem.startsWith(u8, p.source[p.i..], "/=")) { |
| 4174 | 4400 | p.i += 2; |
| 4175 | 4401 | break :blk_1 true; |
| ... | ... | @@ -4180,10 +4406,10 @@ const Parser = struct { |
| 4180 | 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 | 4410 | return blk_0: { |
| 4185 | 4411 | const pos_0 = p.i; |
| 4186 | | if (p.parseskip() and blk_1: { |
| 4412 | if (try p.parseskip() and blk_1: { |
| 4187 | 4413 | if (std.mem.startsWith(u8, p.source[p.i..], "~")) { |
| 4188 | 4414 | p.i += 1; |
| 4189 | 4415 | break :blk_1 true; |
| ... | ... | @@ -4194,7 +4420,7 @@ const Parser = struct { |
| 4194 | 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 | 4424 | return blk_0: { |
| 4199 | 4425 | const pos_0 = p.i; |
| 4200 | 4426 | if (blk_1: { |
| ... | ... | @@ -4217,744 +4443,744 @@ const Parser = struct { |
| 4217 | 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 | 4447 | return blk_0: { |
| 4222 | 4448 | const pos_0 = p.i; |
| 4223 | | if (p.parseskip() and blk_1: { |
| 4449 | if (try p.parseskip() and blk_1: { |
| 4224 | 4450 | if (std.mem.startsWith(u8, p.source[p.i..], "addrspace")) { |
| 4225 | 4451 | p.i += 9; |
| 4226 | 4452 | break :blk_1 true; |
| 4227 | 4453 | } |
| 4228 | 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 | 4456 | p.i = pos_0; |
| 4231 | 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 | 4461 | return blk_0: { |
| 4236 | 4462 | const pos_0 = p.i; |
| 4237 | | if (p.parseskip() and blk_1: { |
| 4463 | if (try p.parseskip() and blk_1: { |
| 4238 | 4464 | if (std.mem.startsWith(u8, p.source[p.i..], "align")) { |
| 4239 | 4465 | p.i += 5; |
| 4240 | 4466 | break :blk_1 true; |
| 4241 | 4467 | } |
| 4242 | 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 | 4470 | p.i = pos_0; |
| 4245 | 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 | 4475 | return blk_0: { |
| 4250 | 4476 | const pos_0 = p.i; |
| 4251 | | if (p.parseskip() and blk_1: { |
| 4477 | if (try p.parseskip() and blk_1: { |
| 4252 | 4478 | if (std.mem.startsWith(u8, p.source[p.i..], "allowzero")) { |
| 4253 | 4479 | p.i += 9; |
| 4254 | 4480 | break :blk_1 true; |
| 4255 | 4481 | } |
| 4256 | 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 | 4484 | p.i = pos_0; |
| 4259 | 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 | 4489 | return blk_0: { |
| 4264 | 4490 | const pos_0 = p.i; |
| 4265 | | if (p.parseskip() and blk_1: { |
| 4491 | if (try p.parseskip() and blk_1: { |
| 4266 | 4492 | if (std.mem.startsWith(u8, p.source[p.i..], "and")) { |
| 4267 | 4493 | p.i += 3; |
| 4268 | 4494 | break :blk_1 true; |
| 4269 | 4495 | } |
| 4270 | 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 | 4498 | p.i = pos_0; |
| 4273 | 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 | 4503 | return blk_0: { |
| 4278 | 4504 | const pos_0 = p.i; |
| 4279 | | if (p.parseskip() and blk_1: { |
| 4505 | if (try p.parseskip() and blk_1: { |
| 4280 | 4506 | if (std.mem.startsWith(u8, p.source[p.i..], "anyframe")) { |
| 4281 | 4507 | p.i += 8; |
| 4282 | 4508 | break :blk_1 true; |
| 4283 | 4509 | } |
| 4284 | 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 | 4512 | p.i = pos_0; |
| 4287 | 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 | 4517 | return blk_0: { |
| 4292 | 4518 | const pos_0 = p.i; |
| 4293 | | if (p.parseskip() and blk_1: { |
| 4519 | if (try p.parseskip() and blk_1: { |
| 4294 | 4520 | if (std.mem.startsWith(u8, p.source[p.i..], "anytype")) { |
| 4295 | 4521 | p.i += 7; |
| 4296 | 4522 | break :blk_1 true; |
| 4297 | 4523 | } |
| 4298 | 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 | 4526 | p.i = pos_0; |
| 4301 | 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 | 4531 | return blk_0: { |
| 4306 | 4532 | const pos_0 = p.i; |
| 4307 | | if (p.parseskip() and blk_1: { |
| 4533 | if (try p.parseskip() and blk_1: { |
| 4308 | 4534 | if (std.mem.startsWith(u8, p.source[p.i..], "asm")) { |
| 4309 | 4535 | p.i += 3; |
| 4310 | 4536 | break :blk_1 true; |
| 4311 | 4537 | } |
| 4312 | 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 | 4540 | p.i = pos_0; |
| 4315 | 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 | 4545 | return blk_0: { |
| 4320 | 4546 | const pos_0 = p.i; |
| 4321 | | if (p.parseskip() and blk_1: { |
| 4547 | if (try p.parseskip() and blk_1: { |
| 4322 | 4548 | if (std.mem.startsWith(u8, p.source[p.i..], "break")) { |
| 4323 | 4549 | p.i += 5; |
| 4324 | 4550 | break :blk_1 true; |
| 4325 | 4551 | } |
| 4326 | 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 | 4554 | p.i = pos_0; |
| 4329 | 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 | 4559 | return blk_0: { |
| 4334 | 4560 | const pos_0 = p.i; |
| 4335 | | if (p.parseskip() and blk_1: { |
| 4561 | if (try p.parseskip() and blk_1: { |
| 4336 | 4562 | if (std.mem.startsWith(u8, p.source[p.i..], "callconv")) { |
| 4337 | 4563 | p.i += 8; |
| 4338 | 4564 | break :blk_1 true; |
| 4339 | 4565 | } |
| 4340 | 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 | 4568 | p.i = pos_0; |
| 4343 | 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 | 4573 | return blk_0: { |
| 4348 | 4574 | const pos_0 = p.i; |
| 4349 | | if (p.parseskip() and blk_1: { |
| 4575 | if (try p.parseskip() and blk_1: { |
| 4350 | 4576 | if (std.mem.startsWith(u8, p.source[p.i..], "catch")) { |
| 4351 | 4577 | p.i += 5; |
| 4352 | 4578 | break :blk_1 true; |
| 4353 | 4579 | } |
| 4354 | 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 | 4582 | p.i = pos_0; |
| 4357 | 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 | 4587 | return blk_0: { |
| 4362 | 4588 | const pos_0 = p.i; |
| 4363 | | if (p.parseskip() and blk_1: { |
| 4589 | if (try p.parseskip() and blk_1: { |
| 4364 | 4590 | if (std.mem.startsWith(u8, p.source[p.i..], "comptime")) { |
| 4365 | 4591 | p.i += 8; |
| 4366 | 4592 | break :blk_1 true; |
| 4367 | 4593 | } |
| 4368 | 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 | 4596 | p.i = pos_0; |
| 4371 | 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 | 4601 | return blk_0: { |
| 4376 | 4602 | const pos_0 = p.i; |
| 4377 | | if (p.parseskip() and blk_1: { |
| 4603 | if (try p.parseskip() and blk_1: { |
| 4378 | 4604 | if (std.mem.startsWith(u8, p.source[p.i..], "const")) { |
| 4379 | 4605 | p.i += 5; |
| 4380 | 4606 | break :blk_1 true; |
| 4381 | 4607 | } |
| 4382 | 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 | 4610 | p.i = pos_0; |
| 4385 | 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 | 4615 | return blk_0: { |
| 4390 | 4616 | const pos_0 = p.i; |
| 4391 | | if (p.parseskip() and blk_1: { |
| 4617 | if (try p.parseskip() and blk_1: { |
| 4392 | 4618 | if (std.mem.startsWith(u8, p.source[p.i..], "continue")) { |
| 4393 | 4619 | p.i += 8; |
| 4394 | 4620 | break :blk_1 true; |
| 4395 | 4621 | } |
| 4396 | 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 | 4624 | p.i = pos_0; |
| 4399 | 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 | 4629 | return blk_0: { |
| 4404 | 4630 | const pos_0 = p.i; |
| 4405 | | if (p.parseskip() and blk_1: { |
| 4631 | if (try p.parseskip() and blk_1: { |
| 4406 | 4632 | if (std.mem.startsWith(u8, p.source[p.i..], "defer")) { |
| 4407 | 4633 | p.i += 5; |
| 4408 | 4634 | break :blk_1 true; |
| 4409 | 4635 | } |
| 4410 | 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 | 4638 | p.i = pos_0; |
| 4413 | 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 | 4643 | return blk_0: { |
| 4418 | 4644 | const pos_0 = p.i; |
| 4419 | | if (p.parseskip() and blk_1: { |
| 4645 | if (try p.parseskip() and blk_1: { |
| 4420 | 4646 | if (std.mem.startsWith(u8, p.source[p.i..], "else")) { |
| 4421 | 4647 | p.i += 4; |
| 4422 | 4648 | break :blk_1 true; |
| 4423 | 4649 | } |
| 4424 | 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 | 4652 | p.i = pos_0; |
| 4427 | 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 | 4657 | return blk_0: { |
| 4432 | 4658 | const pos_0 = p.i; |
| 4433 | | if (p.parseskip() and blk_1: { |
| 4659 | if (try p.parseskip() and blk_1: { |
| 4434 | 4660 | if (std.mem.startsWith(u8, p.source[p.i..], "enum")) { |
| 4435 | 4661 | p.i += 4; |
| 4436 | 4662 | break :blk_1 true; |
| 4437 | 4663 | } |
| 4438 | 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 | 4666 | p.i = pos_0; |
| 4441 | 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 | 4671 | return blk_0: { |
| 4446 | 4672 | const pos_0 = p.i; |
| 4447 | | if (p.parseskip() and blk_1: { |
| 4673 | if (try p.parseskip() and blk_1: { |
| 4448 | 4674 | if (std.mem.startsWith(u8, p.source[p.i..], "errdefer")) { |
| 4449 | 4675 | p.i += 8; |
| 4450 | 4676 | break :blk_1 true; |
| 4451 | 4677 | } |
| 4452 | 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 | 4680 | p.i = pos_0; |
| 4455 | 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 | 4685 | return blk_0: { |
| 4460 | 4686 | const pos_0 = p.i; |
| 4461 | | if (p.parseskip() and blk_1: { |
| 4687 | if (try p.parseskip() and blk_1: { |
| 4462 | 4688 | if (std.mem.startsWith(u8, p.source[p.i..], "error")) { |
| 4463 | 4689 | p.i += 5; |
| 4464 | 4690 | break :blk_1 true; |
| 4465 | 4691 | } |
| 4466 | 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 | 4694 | p.i = pos_0; |
| 4469 | 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 | 4699 | return blk_0: { |
| 4474 | 4700 | const pos_0 = p.i; |
| 4475 | | if (p.parseskip() and blk_1: { |
| 4701 | if (try p.parseskip() and blk_1: { |
| 4476 | 4702 | if (std.mem.startsWith(u8, p.source[p.i..], "export")) { |
| 4477 | 4703 | p.i += 6; |
| 4478 | 4704 | break :blk_1 true; |
| 4479 | 4705 | } |
| 4480 | 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 | 4708 | p.i = pos_0; |
| 4483 | 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 | 4713 | return blk_0: { |
| 4488 | 4714 | const pos_0 = p.i; |
| 4489 | | if (p.parseskip() and blk_1: { |
| 4715 | if (try p.parseskip() and blk_1: { |
| 4490 | 4716 | if (std.mem.startsWith(u8, p.source[p.i..], "extern")) { |
| 4491 | 4717 | p.i += 6; |
| 4492 | 4718 | break :blk_1 true; |
| 4493 | 4719 | } |
| 4494 | 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 | 4722 | p.i = pos_0; |
| 4497 | 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 | 4727 | return blk_0: { |
| 4502 | 4728 | const pos_0 = p.i; |
| 4503 | | if (p.parseskip() and blk_1: { |
| 4729 | if (try p.parseskip() and blk_1: { |
| 4504 | 4730 | if (std.mem.startsWith(u8, p.source[p.i..], "fn")) { |
| 4505 | 4731 | p.i += 2; |
| 4506 | 4732 | break :blk_1 true; |
| 4507 | 4733 | } |
| 4508 | 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 | 4736 | p.i = pos_0; |
| 4511 | 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 | 4741 | return blk_0: { |
| 4516 | 4742 | const pos_0 = p.i; |
| 4517 | | if (p.parseskip() and blk_1: { |
| 4743 | if (try p.parseskip() and blk_1: { |
| 4518 | 4744 | if (std.mem.startsWith(u8, p.source[p.i..], "for")) { |
| 4519 | 4745 | p.i += 3; |
| 4520 | 4746 | break :blk_1 true; |
| 4521 | 4747 | } |
| 4522 | 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 | 4750 | p.i = pos_0; |
| 4525 | 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 | 4755 | return blk_0: { |
| 4530 | 4756 | const pos_0 = p.i; |
| 4531 | | if (p.parseskip() and blk_1: { |
| 4757 | if (try p.parseskip() and blk_1: { |
| 4532 | 4758 | if (std.mem.startsWith(u8, p.source[p.i..], "if")) { |
| 4533 | 4759 | p.i += 2; |
| 4534 | 4760 | break :blk_1 true; |
| 4535 | 4761 | } |
| 4536 | 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 | 4764 | p.i = pos_0; |
| 4539 | 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 | 4769 | return blk_0: { |
| 4544 | 4770 | const pos_0 = p.i; |
| 4545 | | if (p.parseskip() and blk_1: { |
| 4771 | if (try p.parseskip() and blk_1: { |
| 4546 | 4772 | if (std.mem.startsWith(u8, p.source[p.i..], "inline")) { |
| 4547 | 4773 | p.i += 6; |
| 4548 | 4774 | break :blk_1 true; |
| 4549 | 4775 | } |
| 4550 | 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 | 4778 | p.i = pos_0; |
| 4553 | 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 | 4783 | return blk_0: { |
| 4558 | 4784 | const pos_0 = p.i; |
| 4559 | | if (p.parseskip() and blk_1: { |
| 4785 | if (try p.parseskip() and blk_1: { |
| 4560 | 4786 | if (std.mem.startsWith(u8, p.source[p.i..], "noalias")) { |
| 4561 | 4787 | p.i += 7; |
| 4562 | 4788 | break :blk_1 true; |
| 4563 | 4789 | } |
| 4564 | 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 | 4792 | p.i = pos_0; |
| 4567 | 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 | 4797 | return blk_0: { |
| 4572 | 4798 | const pos_0 = p.i; |
| 4573 | | if (p.parseskip() and blk_1: { |
| 4799 | if (try p.parseskip() and blk_1: { |
| 4574 | 4800 | if (std.mem.startsWith(u8, p.source[p.i..], "nosuspend")) { |
| 4575 | 4801 | p.i += 9; |
| 4576 | 4802 | break :blk_1 true; |
| 4577 | 4803 | } |
| 4578 | 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 | 4806 | p.i = pos_0; |
| 4581 | 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 | 4811 | return blk_0: { |
| 4586 | 4812 | const pos_0 = p.i; |
| 4587 | | if (p.parseskip() and blk_1: { |
| 4813 | if (try p.parseskip() and blk_1: { |
| 4588 | 4814 | if (std.mem.startsWith(u8, p.source[p.i..], "noinline")) { |
| 4589 | 4815 | p.i += 8; |
| 4590 | 4816 | break :blk_1 true; |
| 4591 | 4817 | } |
| 4592 | 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 | 4820 | p.i = pos_0; |
| 4595 | 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 | 4825 | return blk_0: { |
| 4600 | 4826 | const pos_0 = p.i; |
| 4601 | | if (p.parseskip() and blk_1: { |
| 4827 | if (try p.parseskip() and blk_1: { |
| 4602 | 4828 | if (std.mem.startsWith(u8, p.source[p.i..], "opaque")) { |
| 4603 | 4829 | p.i += 6; |
| 4604 | 4830 | break :blk_1 true; |
| 4605 | 4831 | } |
| 4606 | 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 | 4834 | p.i = pos_0; |
| 4609 | 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 | 4839 | return blk_0: { |
| 4614 | 4840 | const pos_0 = p.i; |
| 4615 | | if (p.parseskip() and blk_1: { |
| 4841 | if (try p.parseskip() and blk_1: { |
| 4616 | 4842 | if (std.mem.startsWith(u8, p.source[p.i..], "or")) { |
| 4617 | 4843 | p.i += 2; |
| 4618 | 4844 | break :blk_1 true; |
| 4619 | 4845 | } |
| 4620 | 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 | 4848 | p.i = pos_0; |
| 4623 | 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 | 4853 | return blk_0: { |
| 4628 | 4854 | const pos_0 = p.i; |
| 4629 | | if (p.parseskip() and blk_1: { |
| 4855 | if (try p.parseskip() and blk_1: { |
| 4630 | 4856 | if (std.mem.startsWith(u8, p.source[p.i..], "orelse")) { |
| 4631 | 4857 | p.i += 6; |
| 4632 | 4858 | break :blk_1 true; |
| 4633 | 4859 | } |
| 4634 | 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 | 4862 | p.i = pos_0; |
| 4637 | 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 | 4867 | return blk_0: { |
| 4642 | 4868 | const pos_0 = p.i; |
| 4643 | | if (p.parseskip() and blk_1: { |
| 4869 | if (try p.parseskip() and blk_1: { |
| 4644 | 4870 | if (std.mem.startsWith(u8, p.source[p.i..], "packed")) { |
| 4645 | 4871 | p.i += 6; |
| 4646 | 4872 | break :blk_1 true; |
| 4647 | 4873 | } |
| 4648 | 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 | 4876 | p.i = pos_0; |
| 4651 | 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 | 4881 | return blk_0: { |
| 4656 | 4882 | const pos_0 = p.i; |
| 4657 | | if (p.parseskip() and blk_1: { |
| 4883 | if (try p.parseskip() and blk_1: { |
| 4658 | 4884 | if (std.mem.startsWith(u8, p.source[p.i..], "pub")) { |
| 4659 | 4885 | p.i += 3; |
| 4660 | 4886 | break :blk_1 true; |
| 4661 | 4887 | } |
| 4662 | 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 | 4890 | p.i = pos_0; |
| 4665 | 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 | 4895 | return blk_0: { |
| 4670 | 4896 | const pos_0 = p.i; |
| 4671 | | if (p.parseskip() and blk_1: { |
| 4897 | if (try p.parseskip() and blk_1: { |
| 4672 | 4898 | if (std.mem.startsWith(u8, p.source[p.i..], "resume")) { |
| 4673 | 4899 | p.i += 6; |
| 4674 | 4900 | break :blk_1 true; |
| 4675 | 4901 | } |
| 4676 | 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 | 4904 | p.i = pos_0; |
| 4679 | 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 | 4909 | return blk_0: { |
| 4684 | 4910 | const pos_0 = p.i; |
| 4685 | | if (p.parseskip() and blk_1: { |
| 4911 | if (try p.parseskip() and blk_1: { |
| 4686 | 4912 | if (std.mem.startsWith(u8, p.source[p.i..], "return")) { |
| 4687 | 4913 | p.i += 6; |
| 4688 | 4914 | break :blk_1 true; |
| 4689 | 4915 | } |
| 4690 | 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 | 4918 | p.i = pos_0; |
| 4693 | 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 | 4923 | return blk_0: { |
| 4698 | 4924 | const pos_0 = p.i; |
| 4699 | | if (p.parseskip() and blk_1: { |
| 4925 | if (try p.parseskip() and blk_1: { |
| 4700 | 4926 | if (std.mem.startsWith(u8, p.source[p.i..], "linksection")) { |
| 4701 | 4927 | p.i += 11; |
| 4702 | 4928 | break :blk_1 true; |
| 4703 | 4929 | } |
| 4704 | 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 | 4932 | p.i = pos_0; |
| 4707 | 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 | 4937 | return blk_0: { |
| 4712 | 4938 | const pos_0 = p.i; |
| 4713 | | if (p.parseskip() and blk_1: { |
| 4939 | if (try p.parseskip() and blk_1: { |
| 4714 | 4940 | if (std.mem.startsWith(u8, p.source[p.i..], "struct")) { |
| 4715 | 4941 | p.i += 6; |
| 4716 | 4942 | break :blk_1 true; |
| 4717 | 4943 | } |
| 4718 | 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 | 4946 | p.i = pos_0; |
| 4721 | 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 | 4951 | return blk_0: { |
| 4726 | 4952 | const pos_0 = p.i; |
| 4727 | | if (p.parseskip() and blk_1: { |
| 4953 | if (try p.parseskip() and blk_1: { |
| 4728 | 4954 | if (std.mem.startsWith(u8, p.source[p.i..], "suspend")) { |
| 4729 | 4955 | p.i += 7; |
| 4730 | 4956 | break :blk_1 true; |
| 4731 | 4957 | } |
| 4732 | 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 | 4960 | p.i = pos_0; |
| 4735 | 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 | 4965 | return blk_0: { |
| 4740 | 4966 | const pos_0 = p.i; |
| 4741 | | if (p.parseskip() and blk_1: { |
| 4967 | if (try p.parseskip() and blk_1: { |
| 4742 | 4968 | if (std.mem.startsWith(u8, p.source[p.i..], "switch")) { |
| 4743 | 4969 | p.i += 6; |
| 4744 | 4970 | break :blk_1 true; |
| 4745 | 4971 | } |
| 4746 | 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 | 4974 | p.i = pos_0; |
| 4749 | 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 | 4979 | return blk_0: { |
| 4754 | 4980 | const pos_0 = p.i; |
| 4755 | | if (p.parseskip() and blk_1: { |
| 4981 | if (try p.parseskip() and blk_1: { |
| 4756 | 4982 | if (std.mem.startsWith(u8, p.source[p.i..], "test")) { |
| 4757 | 4983 | p.i += 4; |
| 4758 | 4984 | break :blk_1 true; |
| 4759 | 4985 | } |
| 4760 | 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 | 4988 | p.i = pos_0; |
| 4763 | 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 | 4993 | return blk_0: { |
| 4768 | 4994 | const pos_0 = p.i; |
| 4769 | | if (p.parseskip() and blk_1: { |
| 4995 | if (try p.parseskip() and blk_1: { |
| 4770 | 4996 | if (std.mem.startsWith(u8, p.source[p.i..], "threadlocal")) { |
| 4771 | 4997 | p.i += 11; |
| 4772 | 4998 | break :blk_1 true; |
| 4773 | 4999 | } |
| 4774 | 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 | 5002 | p.i = pos_0; |
| 4777 | 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 | 5007 | return blk_0: { |
| 4782 | 5008 | const pos_0 = p.i; |
| 4783 | | if (p.parseskip() and blk_1: { |
| 5009 | if (try p.parseskip() and blk_1: { |
| 4784 | 5010 | if (std.mem.startsWith(u8, p.source[p.i..], "try")) { |
| 4785 | 5011 | p.i += 3; |
| 4786 | 5012 | break :blk_1 true; |
| 4787 | 5013 | } |
| 4788 | 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 | 5016 | p.i = pos_0; |
| 4791 | 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 | 5021 | return blk_0: { |
| 4796 | 5022 | const pos_0 = p.i; |
| 4797 | | if (p.parseskip() and blk_1: { |
| 5023 | if (try p.parseskip() and blk_1: { |
| 4798 | 5024 | if (std.mem.startsWith(u8, p.source[p.i..], "union")) { |
| 4799 | 5025 | p.i += 5; |
| 4800 | 5026 | break :blk_1 true; |
| 4801 | 5027 | } |
| 4802 | 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 | 5030 | p.i = pos_0; |
| 4805 | 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 | 5035 | return blk_0: { |
| 4810 | 5036 | const pos_0 = p.i; |
| 4811 | | if (p.parseskip() and blk_1: { |
| 5037 | if (try p.parseskip() and blk_1: { |
| 4812 | 5038 | if (std.mem.startsWith(u8, p.source[p.i..], "unreachable")) { |
| 4813 | 5039 | p.i += 11; |
| 4814 | 5040 | break :blk_1 true; |
| 4815 | 5041 | } |
| 4816 | 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 | 5044 | p.i = pos_0; |
| 4819 | 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 | 5049 | return blk_0: { |
| 4824 | 5050 | const pos_0 = p.i; |
| 4825 | | if (p.parseskip() and blk_1: { |
| 5051 | if (try p.parseskip() and blk_1: { |
| 4826 | 5052 | if (std.mem.startsWith(u8, p.source[p.i..], "var")) { |
| 4827 | 5053 | p.i += 3; |
| 4828 | 5054 | break :blk_1 true; |
| 4829 | 5055 | } |
| 4830 | 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 | 5058 | p.i = pos_0; |
| 4833 | 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 | 5063 | return blk_0: { |
| 4838 | 5064 | const pos_0 = p.i; |
| 4839 | | if (p.parseskip() and blk_1: { |
| 5065 | if (try p.parseskip() and blk_1: { |
| 4840 | 5066 | if (std.mem.startsWith(u8, p.source[p.i..], "volatile")) { |
| 4841 | 5067 | p.i += 8; |
| 4842 | 5068 | break :blk_1 true; |
| 4843 | 5069 | } |
| 4844 | 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 | 5072 | p.i = pos_0; |
| 4847 | 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 | 5077 | return blk_0: { |
| 4852 | 5078 | const pos_0 = p.i; |
| 4853 | | if (p.parseskip() and blk_1: { |
| 5079 | if (try p.parseskip() and blk_1: { |
| 4854 | 5080 | if (std.mem.startsWith(u8, p.source[p.i..], "while")) { |
| 4855 | 5081 | p.i += 5; |
| 4856 | 5082 | break :blk_1 true; |
| 4857 | 5083 | } |
| 4858 | 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 | 5086 | p.i = pos_0; |
| 4861 | 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 | 5091 | return blk_0: { |
| 4866 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 5184 | p.i = pos_0; |
| 4959 | 5185 | break :blk_0 false; |
| 4960 | 5186 | }; |