chiark / gitweb /
doxygen: safety assert so we don't miss \retval that's in weird places.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 12 Apr 2018 14:44:01 +0000 (16:44 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 12 Apr 2018 20:15:39 +0000 (22:15 +0200)
Missed that when implementing \retval support in
5e6d0bcaae00412c3acbd371f11ef6276af6d0b9.

doxygen/dox2html5.py

index fb95c08e76c7ca2d7dd9c8b472973e0a0f599e24..0d8b5cb1397fef560a9686b7714bb1f2668e158a 100755 (executable)
@@ -1257,7 +1257,7 @@ def parse_desc(state: State, element: ET.Element) -> str:
 
     # Verify that we didn't ignore any important info by accident
     parsed = parse_desc_internal(state, element)
-    assert not parsed.templates and not parsed.params and not parsed.return_value
+    assert not parsed.templates and not parsed.params and not parsed.return_value and not parsed.return_values
     assert not parsed.section # might be problematic
     return parsed.parsed
 
@@ -1266,7 +1266,7 @@ def parse_desc_keywords(state: State, element: ET.Element) -> str:
 
     # Verify that we didn't ignore any important info by accident
     parsed = parse_desc_internal(state, element)
-    assert not parsed.templates and not parsed.params and not parsed.return_value
+    assert not parsed.templates and not parsed.params and not parsed.return_value and not parsed.return_values
     assert not parsed.section # might be problematic
     return parsed.parsed, parsed.search_keywords, parsed.search_enum_values_as_keywords
 
@@ -1274,14 +1274,14 @@ def parse_enum_desc(state: State, element: ET.Element) -> str:
     # Verify that we didn't ignore any important info by accident
     parsed = parse_desc_internal(state, element.find('detaileddescription'))
     parsed.parsed += parse_desc(state, element.find('inbodydescription'))
-    assert not parsed.templates and not parsed.params and not parsed.return_value
+    assert not parsed.templates and not parsed.params and not parsed.return_value and not parsed.return_values
     assert not parsed.section # might be problematic
     return (parsed.parsed, parsed.search_keywords, parsed.search_enum_values_as_keywords, parsed.is_deprecated)
 
 def parse_enum_value_desc(state: State, element: ET.Element) -> str:
     # Verify that we didn't ignore any important info by accident
     parsed = parse_desc_internal(state, element.find('detaileddescription'))
-    assert not parsed.templates and not parsed.params and not parsed.return_value
+    assert not parsed.templates and not parsed.params and not parsed.return_value and not parsed.return_values
     assert not parsed.section # might be problematic
     return (parsed.parsed, parsed.search_keywords, parsed.is_deprecated)
 
@@ -1289,14 +1289,14 @@ def parse_var_desc(state: State, element: ET.Element) -> str:
     # Verify that we didn't ignore any important info by accident
     parsed = parse_desc_internal(state, element.find('detaileddescription'))
     parsed.parsed += parse_desc(state, element.find('inbodydescription'))
-    assert not parsed.templates and not parsed.params and not parsed.return_value
+    assert not parsed.templates and not parsed.params and not parsed.return_value and not parsed.return_values
     assert not parsed.section # might be problematic
     return (parsed.parsed, parsed.search_keywords, parsed.is_deprecated)
 
 def parse_toplevel_desc(state: State, element: ET.Element):
     # Verify that we didn't ignore any important info by accident
     parsed = parse_desc_internal(state, element)
-    assert not parsed.return_value
+    assert not parsed.return_value and not parsed.return_values
     if parsed.params:
         logging.warning("{}: use @tparam instead of @param for documenting class templates, @param is ignored".format(state.current))
     return (parsed.parsed, parsed.templates, parsed.section[2] if parsed.section else '', parsed.footer_navigation, parsed.example_navigation, parsed.search_keywords, parsed.is_deprecated)
@@ -1305,7 +1305,7 @@ def parse_typedef_desc(state: State, element: ET.Element):
     # Verify that we didn't ignore any important info by accident
     parsed = parse_desc_internal(state, element.find('detaileddescription'))
     parsed.parsed += parse_desc(state, element.find('inbodydescription'))
-    assert not parsed.params and not parsed.return_value
+    assert not parsed.params and not parsed.return_value and not parsed.return_values
     assert not parsed.section # might be problematic
     return (parsed.parsed, parsed.templates, parsed.search_keywords, parsed.is_deprecated)
 
@@ -1321,6 +1321,7 @@ def parse_define_desc(state: State, element: ET.Element):
     parsed = parse_desc_internal(state, element.find('detaileddescription'))
     parsed.parsed += parse_desc(state, element.find('inbodydescription'))
     assert not parsed.templates
+    assert not parsed.return_values # might be problematic?
     assert not parsed.section # might be problematic
     return (parsed.parsed, parsed.params, parsed.return_value, parsed.search_keywords, parsed.is_deprecated)
 
@@ -1329,7 +1330,7 @@ def parse_inline_desc(state: State, element: ET.Element) -> str:
 
     # Verify that we didn't ignore any important info by accident
     parsed = parse_desc_internal(state, element, trim=False)
-    assert not parsed.templates and not parsed.params and not parsed.return_value
+    assert not parsed.templates and not parsed.params and not parsed.return_value and not parsed.return_values
     assert not parsed.section
     return parsed.parsed