From bdf1b3de6704676965db47c1504b5b191a24c737 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 29 Jan 2018 19:53:24 +0100 Subject: [PATCH] doxygen: complain instead of blowing up if more \return-s are present. --- doxygen/dox2html5.py | 6 ++++-- doxygen/test/compound_detailed/File.h | 2 ++ .../compound_detailed/namespaceWarning.html | 19 ++++++++++++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index a8b29718..93176e85 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -476,8 +476,10 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. # Return value is separated from the text flow if i.attrib['kind'] == 'return': - assert not out.return_value - out.return_value = parse_desc(state, i) + if out.return_value: + logging.warning("{}: superfluous @return section found, ignoring: {} ".format(state.current, parse_desc(state, i))) + else: + out.return_value = parse_desc(state, i) # Ignore the RCS strings for now elif i.attrib['kind'] == 'rcs': logging.warning("{}: ignoring {} kind of ".format(state.current, i.attrib['kind'])) diff --git a/doxygen/test/compound_detailed/File.h b/doxygen/test/compound_detailed/File.h index 71cd3f1b..a3bea6da 100644 --- a/doxygen/test/compound_detailed/File.h +++ b/doxygen/test/compound_detailed/File.h @@ -177,6 +177,8 @@ enum Enum { /** @brief Wrong @param wrong This parameter is not here +@return Returns nothing. +@return Returns nothing, but second time. This is ignored. */ void bar(); diff --git a/doxygen/test/compound_detailed/namespaceWarning.html b/doxygen/test/compound_detailed/namespaceWarning.html index ab9d2ecd..86b18d5f 100644 --- a/doxygen/test/compound_detailed/namespaceWarning.html +++ b/doxygen/test/compound_detailed/namespaceWarning.html @@ -45,11 +45,28 @@

Functions

- void bar() + void bar()
Wrong.
+
+

Function documentation

+
+

+ void Warning::bar() +

+

Wrong.

+ + + + + + + +
ReturnsReturns nothing.
+
+
-- 2.30.2