From: Vladimír Vondruš Date: Mon, 29 Jan 2018 20:15:01 +0000 (+0100) Subject: doxygen: more flexible function argument array parsing. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=c4713753d8d0dd552e9a715520f398011adcfe90;p=blog.git doxygen: more flexible function argument array parsing. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 5407fbd1..91c17db4 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -1072,8 +1072,10 @@ def parse_func(state: State, element: ET.Element): array = p.find('array') if array is not None: if name is not None: - assert param.type.endswith(')') - param.type = param.type[:-1] + name.text + ')' + array.text + if param.type.endswith(')'): + param.type = param.type[:-1] + name.text + ')' + array.text + else: + param.type = param.type + ' ' + name.text + array.text else: param.type += array.text elif name is not None: diff --git a/doxygen/test/compound_detailed/File.h b/doxygen/test/compound_detailed/File.h index 655125b3..3d3d39d7 100644 --- a/doxygen/test/compound_detailed/File.h +++ b/doxygen/test/compound_detailed/File.h @@ -99,11 +99,12 @@ namespace Foo { @param a That's a for you @param b Well, a string @param things And an array! +@param stuff Another array @return It returns! Ooooh, more text! */ -template int foo(int a, std::string b, char(&things)[5], bool, char(&)[42]); +template int foo(int a, std::string b, char(&things)[5], bool, char(&)[42], int stuff[], double[1337]); /** @brief Input and output diff --git a/doxygen/test/compound_detailed/namespaceFoo.html b/doxygen/test/compound_detailed/namespaceFoo.html index 0b58c1ae..7bc6775f 100644 --- a/doxygen/test/compound_detailed/namespaceFoo.html +++ b/doxygen/test/compound_detailed/namespaceFoo.html @@ -36,11 +36,13 @@
template<class T>
- auto foo(int a, + auto foo(int a, std::string b, char(&things)[5], bool, - char(&)[42]) -> int + char(&)[42], + int stuff[], + double[1337]) -> int
Function with everything
@@ -63,16 +65,18 @@

Function documentation

-
+

template<class T>
- int Foo::foo(int a, + int Foo::foo(int a, std::string b, char(&things)[5], bool, - char(&)[42]) + char(&)[42], + int stuff[], + double[1337])

Function with everything

@@ -101,6 +105,10 @@ + + + +
things And an array!
stuffAnother array