| 204 | } |
| 205 | |
| 206 | static void disassemble_function(const GDScriptFunction *p_func, const Vector<String> &p_lines) { |
| 207 | ERR_FAIL_NULL(p_func); |
| 208 | |
| 209 | String arg_string; |
| 210 | bool is_first_arg = true; |
| 211 | for (const PropertyInfo &arg_info : p_func->get_method_info().arguments) { |
| 212 | if (!is_first_arg) { |
| 213 | arg_string += ", "; |
| 214 | } |
| 215 | arg_string += arg_info.name; |
| 216 | is_first_arg = false; |
| 217 | } |
| 218 | if (p_func->is_vararg()) { |
| 219 | // `MethodInfo` does not support the rest parameter name. |
| 220 | arg_string += (p_func->get_argument_count() == 0) ? "...args" : ", ...args"; |
| 221 | } |
| 222 | |
| 223 | print_line(vformat("Function %s(%s)", p_func->get_name(), arg_string)); |
| 224 | #ifdef TOOLS_ENABLED |
| 225 | p_func->disassemble(p_lines); |
| 226 | #endif |
| 227 | print_line(""); |
| 228 | print_line(""); |
| 229 | } |
| 230 | |
| 231 | static void recursively_disassemble_functions(const Ref<GDScript> p_script, const Vector<String> &p_lines) { |
| 232 | print_line(vformat("Class %s", p_script->get_fully_qualified_name())); |
no test coverage detected