mirror of
https://github.com/godotengine/godot.git
synced 2025-10-23 18:03:35 +00:00
Improve GDScript "unexpected token in class body" parser error
This parser error was misleading. Fixes: 1. Now points at correct line 2. For identifiers, prints out `Identifier "%s"`
This commit is contained in:
parent
893bbdfde8
commit
13fcb05e7b
5 changed files with 20 additions and 1 deletions
|
@ -1060,8 +1060,8 @@ void GDScriptParser::parse_class_body(bool p_is_multiline) {
|
|||
default:
|
||||
// Display a completion with identifiers.
|
||||
make_completion_context(COMPLETION_IDENTIFIER, nullptr);
|
||||
push_error(vformat(R"(Unexpected "%s" in class body.)", current.get_name()));
|
||||
advance();
|
||||
push_error(vformat(R"(Unexpected %s in class body.)", previous.get_debug_name()));
|
||||
break;
|
||||
}
|
||||
if (token.type != GDScriptTokenizer::Token::STATIC) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue