| 61 | #define ENUM_SEPARATOR "." |
| 62 | |
| 63 | static MethodInfo info_from_utility_func(const StringName &p_function) { |
| 64 | ERR_FAIL_COND_V(!Variant::has_utility_function(p_function), MethodInfo()); |
| 65 | |
| 66 | MethodInfo info(p_function); |
| 67 | |
| 68 | if (Variant::has_utility_function_return_value(p_function)) { |
| 69 | info.return_val.type = Variant::get_utility_function_return_type(p_function); |
| 70 | if (info.return_val.type == Variant::NIL) { |
| 71 | info.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | if (Variant::is_utility_function_vararg(p_function)) { |
| 76 | info.flags |= METHOD_FLAG_VARARG; |
| 77 | } else { |
| 78 | for (int i = 0; i < Variant::get_utility_function_argument_count(p_function); i++) { |
| 79 | PropertyInfo pi; |
| 80 | #ifdef DEBUG_ENABLED |
| 81 | pi.name = Variant::get_utility_function_argument_name(p_function, i); |
| 82 | #else |
| 83 | pi.name = "arg" + itos(i + 1); |
| 84 | #endif // DEBUG_ENABLED |
| 85 | pi.type = Variant::get_utility_function_argument_type(p_function, i); |
| 86 | info.arguments.push_back(pi); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | return info; |
| 91 | } |
| 92 | |
| 93 | static GDScriptParser::DataType make_callable_type(const MethodInfo &p_info) { |
| 94 | GDScriptParser::DataType type; |
no test coverage detected