summaryrefslogtreecommitdiffstats
path: root/src/commentscan.l
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-06-04 12:09:00 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-06-04 12:09:00 (GMT)
commit36747c438c1004e3d17282fec7c05c9feac6db97 (patch)
treef92b7dd974c15651abe5d55a738c54dbbfde77b9 /src/commentscan.l
parent54e7af6b0e7cf2063c86981c4dca7fcb8eca746a (diff)
downloadDoxygen-36747c438c1004e3d17282fec7c05c9feac6db97.zip
Doxygen-36747c438c1004e3d17282fec7c05c9feac6db97.tar.gz
Doxygen-36747c438c1004e3d17282fec7c05c9feac6db97.tar.bz2
End comment marker in \code section.
When we have an end comment in a `\code` segment in a section we can get a message like: ``` warning: found */ without matching /* while inside a \code block! Perhaps a missing \endcode? ``` in the similar situation in a `\verbatim` section this message is not given. Switching from `\code` to `\verbatim` is not an option here as in that case other "commands" can lead to problems like in a code like `$string =~ s/^\s*//;` In this patch the start `/*` and end `*/` comment markers for `\code` and `\verbatim` are completely ignored.
Diffstat (limited to 'src/commentscan.l')
-rw-r--r--src/commentscan.l15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/commentscan.l b/src/commentscan.l
index eb1629e..681afe2 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -1895,17 +1895,20 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
addOutput('\n');
}
<FormatBlock>"/*" { // start of a C-comment
- g_commentCount++;
+ if (!(blockName=="code" || blockName=="verbatim")) g_commentCount++;
addOutput(yytext);
}
<FormatBlock>"*/" { // end of a C-comment
addOutput(yytext);
- g_commentCount--;
- if (g_commentCount<0 && blockName!="verbatim")
- {
- warn(yyFileName,yyLineNr,
+ if (!(blockName=="code" || blockName=="verbatim"))
+ {
+ g_commentCount--;
+ if (g_commentCount<0)
+ {
+ warn(yyFileName,yyLineNr,
"found */ without matching /* while inside a \\%s block! Perhaps a missing \\end%s?\n",blockName.data(),blockName.data());
- }
+ }
+ }
}
<FormatBlock>. {
addOutput(*yytext);