chiark / gitweb /
documentation/doxygen: fix anonymous enum parsing with 1.9.7+.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 10 Sep 2024 10:07:15 +0000 (12:07 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Tue, 10 Sep 2024 10:07:15 +0000 (12:07 +0200)
documentation/doxygen.py

index f9d644cfb164f1b0b7982be6429dfb5cc8658bac..bb5c1f60dd6234a1247b8c3f9589c4ebada9c74c 100755 (executable)
@@ -1856,7 +1856,11 @@ def parse_enum(state: State, element: ET.Element):
     state.current_definition_url_base, enum.base_url, enum.id, enum.include, enum.has_details = parse_id_and_include(state, element)
     enum.type = parse_type(state, element.find('type'))
     enum.name = element.find('name').text
-    if enum.name.startswith('@'): enum.name = '(anonymous)'
+    # Doxygen < 1.9.7 puts a generated name into the XML, starting with @,
+    # newer versions strip those away, leading to an empty name
+    # https://github.com/doxygen/doxygen/commit/a18e4c76ed6415893800c7d77a2f798614fb638b
+    if not enum.name or enum.name.startswith('@'):
+        enum.name = '(anonymous)'
     enum.brief = parse_desc(state, element.find('briefdescription'))
     enum.description, search_keywords, search_enum_values_as_keywords, enum.deprecated, enum.since = parse_enum_desc(state, element)
     enum.is_protected = element.attrib['prot'] == 'protected'