mirror of
https://github.com/godotengine/godot.git
synced 2025-10-27 03:34:17 +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
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue