summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorVolTer <mew.pur.pur@abv.bg>2023-02-16 04:49:42 +0100
committerVolTer <mew.pur.pur@abv.bg>2023-03-07 23:42:40 +0100
commit07dd627728b71dd3ea30bab9761a847a7e0c911e (patch)
treea052153c32dec2e5f0c68967ca2fd60385b147d4 /modules
parentf2aae8fa5c2e9d9323832fb43c8446c2e518d698 (diff)
downloadredot-engine-07dd627728b71dd3ea30bab9761a847a7e0c911e.tar.gz
Fix error spam when naming a func at the end of the script
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gdscript_parser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index b5cb5a4680..a6e1f6d537 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/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();