chiark / gitweb /
doxygen: don't assert also for unexpected commands inside sections.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 13 Sep 2018 14:12:17 +0000 (16:12 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 13 Sep 2018 14:12:17 +0000 (16:12 +0200)
doxygen/dox2html5.py
doxygen/test/contents_unexpected_sections/File.h
doxygen/test/contents_unexpected_sections/File_8h.html

index 4e092e8d86cee990268d6d72f1f62123e2cd12ed..147ab19bfc7769e5a96782ffa1970dbd8e49d686 100755 (executable)
@@ -670,7 +670,8 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
             # Render as <section> 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 = ('', '', [])
index c941b654167f365908c5da6ea219fc83b34d97ec..5c26513984d28d281a6f11214483f92fb20d6d96 100644 (file)
@@ -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.
 */
 
 /**
index 4c216465c9414282ae15d3f548da30280d325368..9b1fcf68722e3c7d9d720c50d0eedb2a2b055bea 100644 (file)
@@ -26,6 +26,7 @@
         <div class="m-block m-default">
           <h3>Contents</h3>
           <ul>
+            <li><a href="#section">A section</a></li>
             <li>
               Reference
               <ul>
@@ -37,6 +38,7 @@
             </li>
           </ul>
         </div>
+<section id="section"><h2><a href="#section">A section</a></h2></section>
         <section id="enum-members">
           <h2><a href="#enum-members">Enums</a></h2>
           <dl class="m-dox">