From: Vladimír Vondruš Date: Thu, 12 Apr 2018 14:44:01 +0000 (+0200) Subject: doxygen: safety assert so we don't miss \retval that's in weird places. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=1deb82a1a63ac64d34a8ef1e3d475ee2c9735904;p=blog.git doxygen: safety assert so we don't miss \retval that's in weird places. Missed that when implementing \retval support in 5e6d0bcaae00412c3acbd371f11ef6276af6d0b9. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index fb95c08e..0d8b5cb1 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -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