Jelajahi Sumber

Fix crash when parsing Dictionary

kobewi 4 tahun lalu
induk
melakukan
e0572f7ef7
1 mengubah file dengan 3 tambahan dan 1 penghapusan
  1. 3 1
      modules/gdscript/gdscript_parser.cpp

+ 3 - 1
modules/gdscript/gdscript_parser.cpp

@@ -2480,7 +2480,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_dictionary(ExpressionNode
 			switch (dictionary->style) {
 				case DictionaryNode::LUA_TABLE:
 					if (key != nullptr && key->type != Node::IDENTIFIER) {
-						push_error("Expected identifier as dictionary key.");
+						push_error("Expected identifier as LUA-style dictionary key.");
+						advance();
+						break;
 					}
 					if (!match(GDScriptTokenizer::Token::EQUAL)) {
 						if (match(GDScriptTokenizer::Token::COLON)) {