mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix error on parsing statement-less GDScript files,
add an empty file warning, add relevant tests.
This commit is contained in:
parent
bb0122c933
commit
e99730340b
13 changed files with 57 additions and 4 deletions
|
@ -145,6 +145,9 @@ String GDScriptWarning::get_message() const {
|
|||
case REDUNDANT_AWAIT: {
|
||||
return R"("await" keyword not needed in this case, because the expression isn't a coroutine nor a signal.)";
|
||||
}
|
||||
case EMPTY_FILE: {
|
||||
return "Empty script file.";
|
||||
}
|
||||
case WARNING_MAX:
|
||||
break; // Can't happen, but silences warning
|
||||
}
|
||||
|
@ -190,6 +193,7 @@ String GDScriptWarning::get_name_from_code(Code p_code) {
|
|||
"ASSERT_ALWAYS_TRUE",
|
||||
"ASSERT_ALWAYS_FALSE",
|
||||
"REDUNDANT_AWAIT",
|
||||
"EMPTY_FILE",
|
||||
};
|
||||
|
||||
static_assert((sizeof(names) / sizeof(*names)) == WARNING_MAX, "Amount of warning types don't match the amount of warning names.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue