You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +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:
@@ -164,6 +164,15 @@ const char *GDScriptTokenizer::Token::get_name() const {
|
||||
return token_names[type];
|
||||
}
|
||||
|
||||
String GDScriptTokenizer::Token::get_debug_name() const {
|
||||
switch (type) {
|
||||
case IDENTIFIER:
|
||||
return vformat(R"(identifier "%s")", source);
|
||||
default:
|
||||
return vformat(R"("%s")", get_name());
|
||||
}
|
||||
}
|
||||
|
||||
bool GDScriptTokenizer::Token::can_precede_bin_op() const {
|
||||
switch (type) {
|
||||
case IDENTIFIER:
|
||||
|
||||
Reference in New Issue
Block a user