Merge branch 'Issue-1632'

* Issue-1632:
  Minor workaround in doxygen_basic_translate_style3 test
  Add new test doxygen_basic_translate_style3.i
  Fix for newline handling in doxygen "///" style comments
This commit is contained in:
William S Fulton 2020-01-16 07:19:29 +00:00
commit 55d36e3fd3
5 changed files with 306 additions and 0 deletions

View file

@ -433,6 +433,19 @@ static int yylook(void) {
Scanner_locator(scan, cmt);
}
if (scan_doxygen_comments) { /* else just skip this node, to avoid crashes in parser module*/
int slashStyle = 0; /* Flag for "///" style doxygen comments */
if (strncmp(loc, "///", 3) == 0) {
slashStyle = 1;
if (Len(cmt) == 3) {
/* Modify to make length=4 to ensure that the empty comment does
get processed to preserve the newlines in the original
comments. */
cmt = NewStringf("%s ", cmt);
loc = Char(cmt);
}
}
/* Check for all possible Doxygen comment start markers while ignoring
comments starting with a row of asterisks or slashes just as
Doxygen itself does. Also skip empty comment (slash-star-star-slash),
@ -462,6 +475,13 @@ static int yylook(void) {
Setline(yylval.str, Scanner_start_line(scan));
Setfile(yylval.str, Scanner_file(scan));
} else {
if (slashStyle) {
/* Add a newline to the end of each doxygen "///" comment,
since they are processed individually, unlike the
slash-star style, which gets processed as a block with
newlines included. */
Append(yylval.str, "\n");
}
Append(yylval.str, str);
}