Ruby add support for docstring option in %module()
This was already documented but not actually implemented.
This commit is contained in:
parent
8b9a6d3c24
commit
c63562744b
1 changed files with 10 additions and 0 deletions
|
|
@ -1011,6 +1011,8 @@ public:
|
|||
|
||||
virtual int top(Node *n) {
|
||||
|
||||
String *mod_docstring = NULL;
|
||||
|
||||
/**
|
||||
* See if any Ruby module options have been specified as options
|
||||
* to the %module directive.
|
||||
|
|
@ -1032,6 +1034,7 @@ public:
|
|||
multipleInheritance = true;
|
||||
director_multiple_inheritance = 1;
|
||||
}
|
||||
mod_docstring = Getattr(options, "docstring");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1146,6 +1149,13 @@ public:
|
|||
|
||||
Printf(f_header, "#define SWIG_init Init_%s\n", feature);
|
||||
Printf(f_header, "#define SWIG_name \"%s\"\n\n", module);
|
||||
|
||||
if (mod_docstring && Len(mod_docstring)) {
|
||||
Printf(f_header, "/*\n Document-module: %s\n\n%s\n*/\n", module, mod_docstring);
|
||||
Delete(mod_docstring);
|
||||
mod_docstring = NULL;
|
||||
}
|
||||
|
||||
Printf(f_header, "static VALUE %s;\n", modvar);
|
||||
|
||||
/* Start generating the initialization function */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue