| 480 | } |
| 481 | |
| 482 | GDScriptTokenizer::Token GDScriptParser::advance() { |
| 483 | lambda_ended = false; // Empty marker since we're past the end in any case. |
| 484 | |
| 485 | if (current.type == GDScriptTokenizer::Token::TK_EOF) { |
| 486 | ERR_FAIL_COND_V_MSG(current.type == GDScriptTokenizer::Token::TK_EOF, current, "GDScript parser bug: Trying to advance past the end of stream."); |
| 487 | } |
| 488 | previous = current; |
| 489 | current = tokenizer->scan(); |
| 490 | while (current.type == GDScriptTokenizer::Token::ERROR) { |
| 491 | push_error(current.literal); |
| 492 | current = tokenizer->scan(); |
| 493 | } |
| 494 | if (previous.type != GDScriptTokenizer::Token::DEDENT) { // `DEDENT` belongs to the next non-empty line. |
| 495 | for (Node *n : nodes_in_progress) { |
| 496 | update_extents(n); |
| 497 | } |
| 498 | } |
| 499 | return previous; |
| 500 | } |
| 501 | |
| 502 | bool GDScriptParser::match(GDScriptTokenizer::Token::Type p_token_type) { |
| 503 | if (!check(p_token_type)) { |