MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / disassemble_function

Function disassemble_function

modules/gdscript/tests/test_gdscript.cpp:206–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206static 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
231static 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()));

Callers 1

Calls 7

print_lineFunction · 0.85
vformatFunction · 0.85
disassembleMethod · 0.80
get_method_infoMethod · 0.45
is_varargMethod · 0.45
get_argument_countMethod · 0.45
get_nameMethod · 0.45

Tested by

no test coverage detected