Fix parsing of unconventional Doxygen post comments for enum items.
Closes #1715
This commit is contained in:
parent
1cdeb458de
commit
24f75aa481
4 changed files with 76 additions and 2 deletions
|
|
@ -7,6 +7,10 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
|
|||
Version 4.2.0 (in progress)
|
||||
===========================
|
||||
|
||||
2022-12-03: wsfulton
|
||||
#1715 Fix syntax error parsing of unconventionally placed Doxygen post
|
||||
comments for enum items.
|
||||
|
||||
2022-12-02: wsfulton
|
||||
#624 #1021 Improved template template parameters support. Previously, specifying more
|
||||
than one simple template template parameter resulted in a parse error. Now
|
||||
|
|
|
|||
|
|
@ -95,13 +95,36 @@
|
|||
class ClassWithNestedEnum {
|
||||
public:
|
||||
/**
|
||||
* Enum description.
|
||||
* ENested description.
|
||||
*/
|
||||
typedef enum {ONE, ///< desc of one
|
||||
TWO, ///< desc of two
|
||||
THREE ///< desc of three
|
||||
} ENested;
|
||||
|
||||
/**
|
||||
* ENestedOdd description.
|
||||
*/
|
||||
typedef enum {ODD_ONE ///< desc of odd_one
|
||||
,ODD_TWO ///< desc of odd_two
|
||||
,ODD_THREE ///< desc of odd_three
|
||||
} ENestedOdd;
|
||||
|
||||
/**
|
||||
* ENestedOddPartial1 description.
|
||||
*/
|
||||
typedef enum {ODD_PARTIAL1_ONE
|
||||
,ODD_PARTIAL1_TWO ///< desc of odd_partial1_two
|
||||
,ODD_PARTIAL1_THREE ///< desc of odd_partial1_three
|
||||
} ENestedOddPartial1;
|
||||
|
||||
/**
|
||||
* ENestedOddPartial3 description.
|
||||
*/
|
||||
typedef enum {ODD_PARTIAL3_ONE ///< desc of odd_partial3_one
|
||||
,ODD_PARTIAL3_TWO ///< desc of odd_partial3_two
|
||||
,ODD_PARTIAL3_THREE
|
||||
} ENestedOddPartial3;
|
||||
};
|
||||
|
||||
/// @return This is a bad place for this tag, but it should be ignored.
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public class doxygen_misc_constructs_runme {
|
|||
"\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENested",
|
||||
" Enum description.\n" +
|
||||
" ENested description.\n" +
|
||||
"\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENested.ONE",
|
||||
|
|
@ -109,6 +109,42 @@ public class doxygen_misc_constructs_runme {
|
|||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENested.THREE",
|
||||
" desc of three\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENestedOdd",
|
||||
" ENestedOdd description.\n" +
|
||||
"\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENestedOdd.ODD_ONE",
|
||||
" desc of odd_one\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENestedOdd.ODD_TWO",
|
||||
" desc of odd_two\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENestedOdd.ODD_THREE",
|
||||
" desc of odd_three\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.StructWithReturnComment",
|
||||
" @return This is a bad place for this tag, but it should be ignored.");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENestedOddPartial1",
|
||||
" ENestedOddPartial1 description.\n" +
|
||||
"\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENestedOddPartial1.ODD_PARTIAL1_THREE",
|
||||
" desc of odd_partial1_three\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENestedOddPartial1.ODD_PARTIAL1_TWO",
|
||||
" desc of odd_partial1_two\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENestedOddPartial3",
|
||||
" ENestedOddPartial3 description.\n" +
|
||||
"\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENestedOddPartial3.ODD_PARTIAL3_ONE",
|
||||
" desc of odd_partial3_one\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENestedOddPartial3.ODD_PARTIAL3_TWO",
|
||||
" desc of odd_partial3_two\n");
|
||||
|
||||
wantedComments.put("doxygen_misc_constructs.StructWithReturnComment",
|
||||
" @return This is a bad place for this tag, but it should be ignored.");
|
||||
|
||||
|
|
|
|||
|
|
@ -6489,6 +6489,17 @@ enumlist : enumlist_item {
|
|||
}
|
||||
$$ = $1;
|
||||
}
|
||||
| enumlist_item DOXYGENPOSTSTRING COMMA enumlist {
|
||||
if ($4) {
|
||||
set_nextSibling($1, $4);
|
||||
Setattr($1,"_last",Getattr($4,"_last"));
|
||||
Setattr($4,"_last",NULL);
|
||||
} else {
|
||||
Setattr($1,"_last",$1);
|
||||
}
|
||||
set_comment($1, $2);
|
||||
$$ = $1;
|
||||
}
|
||||
| enumlist_item COMMA DOXYGENPOSTSTRING enumlist {
|
||||
if ($4) {
|
||||
set_nextSibling($1, $4);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue