| 8334 | } |
| 8335 | |
| 8336 | JaktInternal::DynamicArray<Jakt::parser::ParsedCapture> Jakt::parser::Parser::parse_captures() { |
| 8337 | { |
| 8338 | JaktInternal::DynamicArray<Jakt::parser::ParsedCapture> captures = DynamicArray<Jakt::parser::ParsedCapture>::create_with({}); |
| 8339 | if (this->current().__jakt_init_index() == 11 /* LSquare */){ |
| 8340 | this->index++; |
| 8341 | while (!this->eof()){ |
| 8342 | {auto&& __jakt_match_variant = this->current(); |
| 8343 | switch(__jakt_match_variant.__jakt_init_index()) { |
| 8344 | case 12 /* RSquare */:{ |
| 8345 | this->index++; |
| 8346 | break; |
| 8347 | } |
| 8348 | goto __jakt_label_51;case 37 /* Ampersand */:{ |
| 8349 | this->index++; |
| 8350 | {auto&& __jakt_match_variant = this->current(); |
| 8351 | switch(__jakt_match_variant.__jakt_init_index()) { |
| 8352 | case 87 /* Mut */:{ |
| 8353 | this->index++; |
| 8354 | Jakt::lexer::Token __jakt_tmp32 = this->current(); |
| 8355 | if (__jakt_tmp32.__jakt_init_index() == 3 /* Identifier */){ |
| 8356 | ByteString const name = __jakt_tmp32.as.Identifier.name; |
| 8357 | captures.push(Jakt::parser::ParsedCapture::ByMutableReference(name,this->current().span())); |
| 8358 | this->index++; |
| 8359 | } |
| 8360 | else { |
| 8361 | this->error(__jakt_format(StringView::from_string_literal("Expected identifier, got '{}'"sv),this->current()),this->current().span()); |
| 8362 | this->index++; |
| 8363 | } |
| 8364 | |
| 8365 | } |
| 8366 | goto __jakt_label_52;case 3 /* Identifier */: { |
| 8367 | auto&& __jakt_match_value = __jakt_match_variant.as.Identifier;ByteString const& name = __jakt_match_value.name; |
| 8368 | { |
| 8369 | captures.push(Jakt::parser::ParsedCapture::ByReference(name,this->current().span())); |
| 8370 | this->index++; |
| 8371 | } |
| 8372 | goto __jakt_label_52;};/*case end*/ |
| 8373 | default:{ |
| 8374 | this->error(__jakt_format(StringView::from_string_literal("Expected identifier or mut, got '{}'"sv),this->current()),this->current().span()); |
| 8375 | this->index++; |
| 8376 | } |
| 8377 | goto __jakt_label_52;}/*switch end*/ |
| 8378 | break;}goto __jakt_label_52; __jakt_label_52:;; |
| 8379 | } |
| 8380 | goto __jakt_label_51;case 77 /* Comptime */:{ |
| 8381 | this->index++; |
| 8382 | Jakt::lexer::Token __jakt_tmp33 = this->current(); |
| 8383 | if (__jakt_tmp33.__jakt_init_index() == 3 /* Identifier */){ |
| 8384 | ByteString const name = __jakt_tmp33.as.Identifier.name; |
| 8385 | captures.push(Jakt::parser::ParsedCapture::ByComptimeDependency(name,this->current().span())); |
| 8386 | this->index++; |
| 8387 | } |
| 8388 | else { |
| 8389 | this->error(__jakt_format(StringView::from_string_literal("Expected identifier, got '{}'"sv),this->current()),this->current().span()); |
| 8390 | this->index++; |
| 8391 | } |
| 8392 | |
| 8393 | } |
no test coverage detected