Jelajahi Sumber

Fix error spam when naming a func at the end of the script

VolTer 2 tahun lalu
induk
melakukan
07dd627728
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      modules/gdscript/gdscript_parser.cpp

+ 1 - 1
modules/gdscript/gdscript_parser.cpp

@@ -1521,7 +1521,7 @@ GDScriptParser::SuiteNode *GDScriptParser::parse_suite(const String &p_context,
 	int error_count = 0;
 
 	do {
-		if (!multiline && previous.type == GDScriptTokenizer::Token::SEMICOLON && check(GDScriptTokenizer::Token::NEWLINE)) {
+		if (is_at_end() || (!multiline && previous.type == GDScriptTokenizer::Token::SEMICOLON && check(GDScriptTokenizer::Token::NEWLINE))) {
 			break;
 		}
 		Node *statement = parse_statement();