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

Method end_statement

modules/gdscript/gdscript_parser.cpp:584–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

582}
583
584void GDScriptParser::end_statement(const String &p_context) {
585 bool found = false;
586 while (is_statement_end() && !is_at_end()) {
587 // Remove sequential newlines/semicolons.
588 if (is_statement_end_token()) {
589 // Only consume if this is an actual token.
590 advance();
591 } else if (lambda_ended) {
592 lambda_ended = false; // Consume this "token".
593 found = true;
594 break;
595 } else {
596 if (!found) {
597 lambda_ended = true; // Mark the lambda as done since we found something else to end the statement.
598 found = true;
599 }
600 break;
601 }
602
603 found = true;
604 }
605 if (!found && !is_at_end()) {
606 push_error(vformat(R"(Expected end of statement after %s, found "%s" instead.)", p_context, current.get_name()));
607 }
608}
609
610void GDScriptParser::parse_program() {
611 head = alloc_node<ClassNode>();

Callers

nothing calls this directly

Calls 2

vformatFunction · 0.85
get_nameMethod · 0.45

Tested by

no test coverage detected