1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

GDScript: Add support for variadic functions

This commit is contained in:
Danil Alexeev
2025-03-30 12:59:05 +03:00
parent 3b963ab8b6
commit ee121ef80e
33 changed files with 416 additions and 65 deletions

View File

@@ -207,6 +207,10 @@ static void disassemble_function(const GDScriptFunction *p_func, const Vector<St
arg_string += arg_info.name;
is_first_arg = false;
}
if (p_func->is_vararg()) {
// `MethodInfo` does not support the rest parameter name.
arg_string += (p_func->get_argument_count() == 0) ? "...args" : ", ...args";
}
print_line(vformat("Function %s(%s)", p_func->get_name(), arg_string));
#ifdef TOOLS_ENABLED