MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / advance

Method advance

modules/gdscript/gdscript_parser.cpp:482–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480}
481
482GDScriptTokenizer::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
502bool GDScriptParser::match(GDScriptTokenizer::Token::Type p_token_type) {
503 if (!check(p_token_type)) {

Callers

nothing calls this directly

Calls 1

scanMethod · 0.45

Tested by

no test coverage detected