Implemented support for default args - overloaded functions, optional feature 1 in my project plan. Extended testcase.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13483 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dmitry Kabak 2012-08-02 10:31:02 +00:00
commit fb3ee4fb78
6 changed files with 66 additions and 10 deletions

View file

@ -190,6 +190,7 @@ static Node *copy_node(Node *n) {
}
static void set_comment(Node *n, String *comment) {
String *name;
Parm *p;
if (!n || !comment)
return;
@ -206,6 +207,16 @@ static void set_comment(Node *n, String *comment) {
p=nextSibling(p);
}
}
/* Append same comment to every generated overload */
name = Getattr(n, "name");
if (!name)
return;
n = nextSibling(n);
while (n && Getattr(n, "name") && Strcmp(Getattr(n, "name"), name) == 0) {
Setattr(n, "DoxygenComment", comment);
n = nextSibling(n);
}
}
/* -----------------------------------------------------------------------------
@ -1586,10 +1597,6 @@ static void default_arguments(Node *n) {
if (throws) Setattr(new_function,"throws",pl);
Delete(pl);
}
/* copy doxygen comments if found */
if(Getattr(function,"DoxygenComment"))
Setattr(new_function,"DoxygenComment",Getattr(function,"DoxygenComment"));
/* copy specific attributes for global (or in a namespace) template functions - these are not templated class methods */
if (strcmp(cntype,"template") == 0) {