From ed311bdd225c30f6e99c841b970f57fb147d7d53 Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Tue, 17 Jan 2017 18:54:51 +0100 Subject: [PATCH] create signatures without c++ types --- .../pybind11/include/pybind11/pybind11.h | 21 ++++++++++++------- src/mod_core.cpp | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/resources/pybind11/include/pybind11/pybind11.h b/resources/pybind11/include/pybind11/pybind11.h index 1db9efb..76cad21 100755 --- a/resources/pybind11/include/pybind11/pybind11.h +++ b/resources/pybind11/include/pybind11/pybind11.h @@ -187,7 +187,7 @@ protected: } /* 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; while (true) { char c = text[char_index++]; @@ -204,7 +204,8 @@ protected: } else { signature += "arg" + std::to_string(arg_index - (rec->is_method ? 1 : 0)); } - signature += ": "; + //signature += ": "; + signature += " "; } ++type_depth; } else if (c == '}') { @@ -221,16 +222,20 @@ protected: if (!t) pybind11_fail("Internal error while parsing type signature (1)"); if (auto tinfo = detail::get_type_info(*t)) { - signature += tinfo->type->tp_name; + //signature += tinfo->type->tp_name; } 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) pybind11_fail("Internal error while parsing type signature (2)"); diff --git a/src/mod_core.cpp b/src/mod_core.cpp index 122439b..a3c0ae0 100644 --- a/src/mod_core.cpp +++ b/src/mod_core.cpp @@ -11,7 +11,7 @@ PYBIND11_PLUGIN(core) { #ifdef STORMPY_DISABLE_SIGNATURE_DOC py::options options; - options.disable_function_signatures(); +// options.disable_function_signatures(); #endif