diff options
author | VolTer <mew.pur.pur@abv.bg> | 2023-02-16 04:49:42 +0100 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-03-14 13:59:03 +0100 |
commit | 5ae484c13823cc3422b5bf6d3f320e6d1cf61b80 (patch) | |
tree | 057240667d605c459c5a55ce582ea1372f20f263 /modules/gdscript | |
parent | f9bb1d3174e7ab88b738b48967972d13f53da627 (diff) |
Fix error spam when naming a func at the end of the script
(cherry picked from commit 07dd627728b71dd3ea30bab9761a847a7e0c911e)
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index c402b63f7b..00a3e41c2b 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(); |