summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-08-29 19:42:19 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-08-29 19:42:19 (GMT)
commita53e985ab30ce7f8515d6e39c371879c9f6167c9 (patch)
treeb347017b84d96ebd8e0bd382fcb4a137233a8358
parent62b368644dec14d1d916c778461f6d4d32e2182e (diff)
parentf011af81523bd44dc4c446df6e2976d9c1786609 (diff)
downloadDoxygen-a53e985ab30ce7f8515d6e39c371879c9f6167c9.zip
Doxygen-a53e985ab30ce7f8515d6e39c371879c9f6167c9.tar.gz
Doxygen-a53e985ab30ce7f8515d6e39c371879c9f6167c9.tar.bz2
Merge branch 'albert-github-feature/issue_7872'
-rw-r--r--src/code.l39
-rw-r--r--src/pre.l2
2 files changed, 26 insertions, 15 deletions
diff --git a/src/code.l b/src/code.l
index d0a583b..003a1c5 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 (yytext[yyleng-1]=='\n')
+ {
+ yyextra->yyLineNr--;
+ unput('\n');
+ }
+ else
+ {
+ nextCodeLine(yyscanner);
+ }
BEGIN(yyextra->lastSpecialCContext);
}
}
@@ -2033,7 +2049,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
if (YY_START==SkipCPP) REJECT;
if (Config_getBool(STRIP_CODE_COMMENTS))
{
- yyextra->yyLineNr+=((QCString)yytext).contains('\n');
+ yyextra->yyLineNr+=QCString(yytext).contains('\n');
nextCodeLine(yyscanner);
}
else
@@ -2048,10 +2064,10 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN( yyextra->lastCContext ) ;
}
}
-<SkipCPP>\n/.*\n {
+<SkipCPP>\n/.*\n {
endFontClass(yyscanner);
- codifyLines(yyscanner,yytext);
BEGIN( yyextra->lastSkipCppContext ) ;
+ unput('\n');
}
<*>\n{B}*"//@"[{}].*\n { // remove one-line group marker
if (Config_getBool(STRIP_CODE_COMMENTS))
@@ -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);
diff --git a/src/pre.l b/src/pre.l
index e36d1ec..d4ac400 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -1502,7 +1502,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
}
<SkipDoubleQuote>"//"[/]? { yyextra->defText += yytext; yyextra->defLitText+=yytext; }
-<SkipDoubleQuote>"/*" { yyextra->defText += yytext; yyextra->defLitText+=yytext; }
+<SkipDoubleQuote>"/*"[*]? { yyextra->defText += yytext; yyextra->defLitText+=yytext; }
<SkipDoubleQuote>\" {
yyextra->defText += *yytext; yyextra->defLitText+=yytext;
BEGIN(DefineText);