Fix syntax error for misplaced Doxygen comment after struct/class member.

Fix syntax error using Doxygen member groups syntax, "///*}", when used after
final struct/class member.

Issue #1636
This commit is contained in:
William S Fulton 2022-12-06 07:56:03 +00:00
parent dc04564023
commit 8a24c19d26
6 changed files with 45 additions and 1 deletions

View File

@ -7,6 +7,11 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.2.0 (in progress)
===========================
2022-12-06: wsfulton
#1636 Fix syntax error for misplaced Doxygen comment after struct/class member.
Fix syntax error using Doxygen member groups syntax, "///*}", when used after
final struct/class member.
2022-12-05: wsfulton
#2023 Fix garbled Doxygen post comments in parameter lists.
Fix syntax error parsing a trailing Doxygen comment in parameter lists.

View File

@ -176,6 +176,13 @@
*/
void showList() { }
/** Incorrectly documented members, these should be post document comments, Github issue #1636 */
struct IncorrectlyDocumentedMembers
{
int aaaa; //! really for bbbb value
int bbbb; //! not for bbbb value, is quietly ignored by Doxygen and SWIG
};
#include "doxygen_misc_constructs.h"
%}

View File

@ -133,6 +133,16 @@ struct SomeAnotherStruct
}
};
struct Foo1636
{
///@{
/// groupmember1 description
int groupmember1;
/// groupmember2 description
int groupmember2;
///@}
};
struct Foo1750
{
/// @name Group name

View File

@ -199,6 +199,16 @@ public class doxygen_misc_constructs_runme {
" <br>\n" +
" And this is not a list item any more.\n" +
"");
wantedComments.put("doxygen_misc_constructs.IncorrectlyDocumentedMembers",
" Incorrectly documented members, these should be post document comments, Github issue #1636");
wantedComments.put("doxygen_misc_constructs.IncorrectlyDocumentedMembers.setBbbb(int)",
" really for bbbb value");
wantedComments.put("doxygen_misc_constructs.IncorrectlyDocumentedMembers.getBbbb()",
" really for bbbb value");
wantedComments.put("doxygen_misc_constructs.doxygen_misc_constructs.isNoSpaceValidA()",
" This comment without space after '*' is valid in Doxygen.\n" +
"\n" +

View File

@ -132,6 +132,14 @@ public class doxygen_parsing_runme {
wantedComments.put("doxygen_parsing.doxygen_parsingConstants.CONSTANT_VALUE",
"The constant comment \n" +
"");
wantedComments.put("doxygen_parsing.Foo1636.getGroupmember1()",
"groupmember1 description");
wantedComments.put("doxygen_parsing.Foo1636.setGroupmember1(int)",
"groupmember1 description");
wantedComments.put("doxygen_parsing.Foo1636.getGroupmember2()",
"groupmember2 description");
wantedComments.put("doxygen_parsing.Foo1636.setGroupmember2(int)",
"groupmember2 description");
wantedComments.put("doxygen_parsing.Foo1750.getA()",
"");
wantedComments.put("doxygen_parsing.Foo1750.getB()",

View File

@ -4668,7 +4668,11 @@ cpp_members : cpp_member cpp_members {
} else {
$$ = $2;
}
}
}
| cpp_member DOXYGENSTRING {
/* Misplaced doxygen string after a member, quietly ignore, like Doxygen does */
$$ = $1;
}
| EXTEND LBRACE {
extendmode = 1;
if (cplus_mode != CPLUS_PUBLIC) {