From c7ee89e74cf96323b7bf14d4c7535b6867d57868 Mon Sep 17 00:00:00 2001 From: Cris Luengo Date: Wed, 6 Jan 2021 10:22:12 -0700 Subject: [PATCH] documentation/doxygen: fix a friend class being parsed as a function. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Doxygen 1.9 no longer contains a "friend" prefix in the , causing some conditions to trip up and some asserts to trip up even worse after that. Co-authored-by: Vladimír Vondruš --- documentation/doxygen.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/documentation/doxygen.py b/documentation/doxygen.py index fb1d2c3a..824e6413 100755 --- a/documentation/doxygen.py +++ b/documentation/doxygen.py @@ -3011,8 +3011,9 @@ def parse_xml(state: State, xml: str): for memberdef in compounddef_child: # Ignore friend classes. This does not ignore friend # classes written as `friend Foo;`, those are parsed as - # variables (ugh). - if memberdef.find('type').text in ['friend class', 'friend struct', 'friend union']: + # variables (ugh). Since Doxygen 1.9 the `friend ` prefix + # is omitted. + if memberdef.find('type').text in ['class', 'struct', 'union', 'friend class', 'friend struct', 'friend union']: # Print a warning in case these are documented if (''.join(memberdef.find('briefdescription').itertext()).strip() or ''.join(memberdef.find('detaileddescription').itertext()).strip()): logging.warning("{}: doxygen is unable to cross-link {}, ignoring, sorry".format(state.current, memberdef.find('definition').text)) @@ -3062,8 +3063,9 @@ def parse_xml(state: State, xml: str): elif memberdef.attrib['kind'] == 'friend': # Ignore friend classes. This does not ignore friend # classes written as `friend Foo;`, those are parsed as - # variables (ugh). - if memberdef.find('type').text in ['friend class', 'friend struct', 'friend union'] and (memberdef.find('briefdescription').text or memberdef.find('detaileddescription').text): + # variables (ugh). Since Doxygen 1.9 the `friend ` + # prefix is omitted. + if memberdef.find('type').text in ['class', 'struct', 'union', 'friend class', 'friend struct', 'friend union'] and (memberdef.find('briefdescription').text or memberdef.find('detaileddescription').text): logging.warning("{}: doxygen is unable to cross-link {}, ignoring, sorry".format(state.current, memberdef.find('definition').text)) # Only friend functions left, hopefully, parse as a func else: -- 2.30.2