From c5f13537285283ae8a42b55b095911f5a43ba35b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 13 Sep 2018 16:12:17 +0200 Subject: [PATCH] doxygen: don't assert also for unexpected commands inside sections. --- doxygen/dox2html5.py | 3 ++- doxygen/test/contents_unexpected_sections/File.h | 4 ++++ doxygen/test/contents_unexpected_sections/File_8h.html | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 4e092e8d..147ab19b 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -670,7 +670,8 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. # Render as
in toplevel desc if state.parsing_toplevel_desc: assert parsed.section - assert not parsed.templates and not parsed.params and not parsed.return_value and not parsed.return_values and not parsed.exceptions + if parsed.templates or parsed.params or parsed.return_value or parsed.return_values or parsed.exceptions: + logging.warning("{}: unexpected @tparam / @param / @return / @retval / @exception found inside a @section, ignoring".format(state.current)) # Top-level section has no ID or title if not out.section: out.section = ('', '', []) diff --git a/doxygen/test/contents_unexpected_sections/File.h b/doxygen/test/contents_unexpected_sections/File.h index c941b654..5c265139 100644 --- a/doxygen/test/contents_unexpected_sections/File.h +++ b/doxygen/test/contents_unexpected_sections/File.h @@ -2,6 +2,10 @@ @brief A file @return Files don't return anyhting. + +@section section A section + +@tparam huh Setions shouldn't have template params. */ /** diff --git a/doxygen/test/contents_unexpected_sections/File_8h.html b/doxygen/test/contents_unexpected_sections/File_8h.html index 4c216465..9b1fcf68 100644 --- a/doxygen/test/contents_unexpected_sections/File_8h.html +++ b/doxygen/test/contents_unexpected_sections/File_8h.html @@ -26,6 +26,7 @@

Contents

+

A section

Enums

-- 2.30.2