Browse Source

create signatures without c++ types

refactoring
Sebastian Junges 8 years ago
parent
commit
ed311bdd22
  1. 21
      resources/pybind11/include/pybind11/pybind11.h
  2. 2
      src/mod_core.cpp

21
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)");

2
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

Loading…
Cancel
Save