summaryrefslogtreecommitdiffstats
path: root/src/code.l
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-08-29 13:34:55 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-08-29 13:34:55 (GMT)
commit8d6c1c1cf31697fb2e03d09020e5e225d88c53cf (patch)
treeca7a0496fe0a47e4359a4df1988b9a01e77795b6 /src/code.l
parent62b368644dec14d1d916c778461f6d4d32e2182e (diff)
parentf2de7e59db40daf9efde55bba111e9f4a98ef59f (diff)
downloadDoxygen-8d6c1c1cf31697fb2e03d09020e5e225d88c53cf.zip
Doxygen-8d6c1c1cf31697fb2e03d09020e5e225d88c53cf.tar.gz
Doxygen-8d6c1c1cf31697fb2e03d09020e5e225d88c53cf.tar.bz2
Merge branch 'feature/issue_7872' of https://github.com/albert-github/doxygen into albert-github-feature/issue_7872
Diffstat (limited to 'src/code.l')
-rw-r--r--src/code.l33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/code.l b/src/code.l
index d0a583b..7709a41 100644
--- a/src/code.l
+++ b/src/code.l
@@ -650,16 +650,22 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
yyextra->code->codify(yytext);
BEGIN( SkipCPP ) ;
}
+<SkipCPP>\" {
+ yyextra->code->codify(yytext);
+ yyextra->lastStringContext=YY_START;
+ BEGIN( SkipString ) ;
+ }
<SkipCPP>. {
yyextra->code->codify(yytext);
}
-<SkipCPP>[^\n\/\\]+ {
+<SkipCPP>[^\n\/\\\"]+ {
yyextra->code->codify(yytext);
}
<SkipCPP>\\[\r]?\n {
codifyLines(yyscanner,yytext);
}
-<SkipCPP>"//" {
+<SkipCPP>"//"/[^/!] {
+ REJECT;
yyextra->code->codify(yytext);
}
<Body,FuncCall>"{" {
@@ -2004,15 +2010,25 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
yyextra->yyLineNr+=QCString(yytext).contains('\n');
}
<RemoveSpecialCComment>"*/"{B}*\n({B}*\n)*({B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n)? {
- yyextra->yyLineNr+=QCString(yytext).contains('\n');
- nextCodeLine(yyscanner);
if (yyextra->lastSpecialCContext==SkipCxxComment)
{ // force end of C++ comment here
+ yyextra->yyLineNr+=QCString(yytext).contains('\n');
+ nextCodeLine(yyscanner);
endFontClass(yyscanner);
BEGIN( yyextra->lastCContext ) ;
}
else
{
+ yyextra->yyLineNr+=QCString(yytext).contains('\n');
+ if (QCString(yytext).at(strlen(yytext)-1) == '\n')
+ {
+ yyextra->yyLineNr--;
+ unput('\n');
+ }
+ else
+ {
+ nextCodeLine(yyscanner);
+ }
BEGIN(yyextra->lastSpecialCContext);
}
}
@@ -2134,14 +2150,9 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
endFontClass(yyscanner);
}
}
-<*>"//"[!/][^\n]*\n { // strip special one-line comment
+<*>"//"[!/][^\n]*/\n { // strip special one-line comment
if (YY_START==SkipComment || YY_START==SkipString) REJECT;
- if (Config_getBool(STRIP_CODE_COMMENTS))
- {
- char c[2]; c[0]='\n'; c[1]=0;
- codifyLines(yyscanner,c);
- }
- else
+ if (!Config_getBool(STRIP_CODE_COMMENTS))
{
startFontClass(yyscanner,"comment");
codifyLines(yyscanner,yytext);