Browse Source

GDScript: Fix error message for Lua-style dictionary

AleryBerry 2 years ago
parent
commit
0550f3682b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      modules/gdscript/gdscript_parser.cpp

+ 2 - 2
modules/gdscript/gdscript_parser.cpp

@@ -2731,12 +2731,12 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_dictionary(ExpressionNode
 			switch (dictionary->style) {
 			switch (dictionary->style) {
 				case DictionaryNode::LUA_TABLE:
 				case DictionaryNode::LUA_TABLE:
 					if (key != nullptr && key->type != Node::IDENTIFIER && key->type != Node::LITERAL) {
 					if (key != nullptr && key->type != Node::IDENTIFIER && key->type != Node::LITERAL) {
-						push_error("Expected identifier or string as LUA-style dictionary key.");
+						push_error(R"(Expected identifier or string as Lua-style dictionary key (e.g "{ key = value }").)");
 						advance();
 						advance();
 						break;
 						break;
 					}
 					}
 					if (key != nullptr && key->type == Node::LITERAL && static_cast<LiteralNode *>(key)->value.get_type() != Variant::STRING) {
 					if (key != nullptr && key->type == Node::LITERAL && static_cast<LiteralNode *>(key)->value.get_type() != Variant::STRING) {
-						push_error("Expected identifier or string as LUA-style dictionary key.");
+						push_error(R"(Expected identifier or string as Lua-style dictionary key (e.g "{ key = value }").)");
 						advance();
 						advance();
 						break;
 						break;
 					}
 					}