From: Vladimír Vondruš Date: Mon, 29 Jan 2018 18:53:24 +0000 (+0100) Subject: doxygen: complain instead of blowing up if more \return-s are present. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=bdf1b3de6704676965db47c1504b5b191a24c737;p=blog.git doxygen: complain instead of blowing up if more \return-s are present. --- 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.
+
+