Merge branch 'ZackerySpytz-OCaml-module-docstring'

* ZackerySpytz-OCaml-module-docstring:
  [OCaml] Add support for the docstring option in the module directive
This commit is contained in:
William S Fulton 2019-02-09 22:02:21 +00:00
commit 5249dfefc5
3 changed files with 59 additions and 0 deletions

View file

@ -202,6 +202,7 @@ public:
* use %module(directors="1") modulename at the start of the
* interface file to enable director generation.
*/
String *mod_docstring = NULL;
{
Node *module = Getattr(n, "module");
if (module) {
@ -216,6 +217,7 @@ public:
if (Getattr(options, "sizeof")) {
generate_sizeof = 1;
}
mod_docstring = Getattr(options, "docstring");
}
}
}
@ -321,6 +323,14 @@ public:
Language::top(n);
if (mod_docstring) {
if (Len(mod_docstring)) {
Printv(f_mliout, "(** ", mod_docstring, " *)\n", NIL);
}
Delete(mod_docstring);
mod_docstring = NULL;
}
Printf(f_enum_to_int, ") | _ -> (C_int (get_int v))\n" "let _ = Callback.register \"%s_enum_to_int\" enum_to_int\n", module);
Printf(f_mlibody, "val enum_to_int : c_enum_type -> c_obj -> Swig.c_obj\n");