Also merge Doxygen comments for overloaded constructors in Python.
This was done for plain functions/methods but not constructors, which don't have "kind=function" attribute. Just don't check for "kind" at all, the presence of "sym:overloaded" should be good enough to indicate that it's an overloaded something. Also add a test for overloaded constructors documentation.
This commit is contained in:
parent
52bd2a1921
commit
73f6971931
3 changed files with 16 additions and 1 deletions
|
|
@ -39,6 +39,12 @@ int someVar=42;
|
||||||
class SomeAnotherClass
|
class SomeAnotherClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// First overloaded constructor.
|
||||||
|
SomeAnotherClass(int) { }
|
||||||
|
|
||||||
|
/// Second overloaded constructor.
|
||||||
|
SomeAnotherClass(const char*) { }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The class attribute comment
|
* The class attribute comment
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,15 @@ commentVerifier.check(doxygen_parsing.SomeStruct.__doc__,
|
||||||
r"""
|
r"""
|
||||||
The struct comment
|
The struct comment
|
||||||
""")
|
""")
|
||||||
|
commentVerifier.check(doxygen_parsing.SomeAnotherClass.__init__.__doc__,
|
||||||
|
r"""
|
||||||
|
*Overload 1:*
|
||||||
|
First overloaded constructor.
|
||||||
|
|
||||||
|
*Overload 2:*
|
||||||
|
Second overloaded constructor.
|
||||||
|
|
||||||
|
""")
|
||||||
commentVerifier.check(doxygen_parsing.SomeAnotherClass.classMethod.__doc__,
|
commentVerifier.check(doxygen_parsing.SomeAnotherClass.classMethod.__doc__,
|
||||||
r"""
|
r"""
|
||||||
The class method comment.
|
The class method comment.
|
||||||
|
|
|
||||||
|
|
@ -781,7 +781,7 @@ String *PyDocConverter::makeDocumentation(Node *n)
|
||||||
currentNode = n;
|
currentNode = n;
|
||||||
|
|
||||||
// for overloaded functions we must concat documentation for underlying overloads
|
// for overloaded functions we must concat documentation for underlying overloads
|
||||||
if (Checkattr(n, "kind", "function") && Getattr(n, "sym:overloaded")) {
|
if (Getattr(n, "sym:overloaded")) {
|
||||||
// rewind to the first overload
|
// rewind to the first overload
|
||||||
while (Getattr(n, "sym:previousSibling"))
|
while (Getattr(n, "sym:previousSibling"))
|
||||||
n = Getattr(n, "sym:previousSibling");
|
n = Getattr(n, "sym:previousSibling");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue