|
@ -187,7 +187,7 @@ protected: |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* Generate a proper function signature */ |
|
|
/* Generate a proper function signature */ |
|
|
std::string signature; |
|
|
|
|
|
|
|
|
std::string signature = "("; |
|
|
size_t type_depth = 0, char_index = 0, type_index = 0, arg_index = 0; |
|
|
size_t type_depth = 0, char_index = 0, type_index = 0, arg_index = 0; |
|
|
while (true) { |
|
|
while (true) { |
|
|
char c = text[char_index++]; |
|
|
char c = text[char_index++]; |
|
@ -204,7 +204,8 @@ protected: |
|
|
} else { |
|
|
} else { |
|
|
signature += "arg" + std::to_string(arg_index - (rec->is_method ? 1 : 0)); |
|
|
signature += "arg" + std::to_string(arg_index - (rec->is_method ? 1 : 0)); |
|
|
} |
|
|
} |
|
|
signature += ": "; |
|
|
|
|
|
|
|
|
//signature += ": "; |
|
|
|
|
|
signature += " "; |
|
|
} |
|
|
} |
|
|
++type_depth; |
|
|
++type_depth; |
|
|
} else if (c == '}') { |
|
|
} else if (c == '}') { |
|
@ -221,16 +222,20 @@ protected: |
|
|
if (!t) |
|
|
if (!t) |
|
|
pybind11_fail("Internal error while parsing type signature (1)"); |
|
|
pybind11_fail("Internal error while parsing type signature (1)"); |
|
|
if (auto tinfo = detail::get_type_info(*t)) { |
|
|
if (auto tinfo = detail::get_type_info(*t)) { |
|
|
signature += tinfo->type->tp_name; |
|
|
|
|
|
|
|
|
//signature += tinfo->type->tp_name; |
|
|
} else { |
|
|
} else { |
|
|
std::string tname(t->name()); |
|
|
|
|
|
detail::clean_type_id(tname); |
|
|
|
|
|
signature += tname; |
|
|
|
|
|
|
|
|
//std::string tname(t->name()); |
|
|
|
|
|
//detail::clean_type_id(tname); |
|
|
|
|
|
//signature += tname; |
|
|
} |
|
|
} |
|
|
} else { |
|
|
|
|
|
signature += c; |
|
|
|
|
|
|
|
|
} else if (c == ',') { |
|
|
|
|
|
if (type_depth == 0) { |
|
|
|
|
|
signature += ", "; |
|
|
|
|
|
} |
|
|
|
|
|
//signature += c; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
signature += ")"; |
|
|
if (type_depth != 0 || types[type_index] != nullptr) |
|
|
if (type_depth != 0 || types[type_index] != nullptr) |
|
|
pybind11_fail("Internal error while parsing type signature (2)"); |
|
|
pybind11_fail("Internal error while parsing type signature (2)"); |
|
|
|
|
|
|
|
|