|
|
4fb3b7 |
diff -up doxygen-1.8.5/src/scanner.l.than doxygen-1.8.5/src/scanner.l
|
|
|
4fb3b7 |
--- doxygen-1.8.5/src/scanner.l.than 2017-08-21 18:24:54.220442124 +0200
|
|
|
4fb3b7 |
+++ doxygen-1.8.5/src/scanner.l 2017-08-21 18:25:01.241178886 +0200
|
|
|
4fb3b7 |
@@ -191,6 +191,7 @@ static QCString g_delimiter;
|
|
|
4fb3b7 |
static int g_column;
|
|
|
4fb3b7 |
|
|
|
4fb3b7 |
static int g_fencedSize=0;
|
|
|
4fb3b7 |
+static bool g_nestedComment=0;
|
|
|
4fb3b7 |
|
|
|
4fb3b7 |
//-----------------------------------------------------------------------------
|
|
|
4fb3b7 |
|
|
|
4fb3b7 |
@@ -6155,23 +6156,27 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSI
|
|
|
4fb3b7 |
docBlockName.at(1)='}';
|
|
|
4fb3b7 |
}
|
|
|
4fb3b7 |
g_fencedSize=0;
|
|
|
4fb3b7 |
+ g_nestedComment=FALSE;
|
|
|
4fb3b7 |
BEGIN(DocCopyBlock);
|
|
|
4fb3b7 |
}
|
|
|
4fb3b7 |
<DocBlock>"<"{PRE}">" {
|
|
|
4fb3b7 |
docBlock+=yytext;
|
|
|
4fb3b7 |
docBlockName="";
|
|
|
4fb3b7 |
g_fencedSize=0;
|
|
|
4fb3b7 |
+ g_nestedComment=FALSE;
|
|
|
4fb3b7 |
BEGIN(DocCopyBlock);
|
|
|
4fb3b7 |
}
|
|
|
4fb3b7 |
<DocBlock>{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"dot"|"code")/[^a-z_A-Z0-9] { // verbatim command (which could contain nested comments!)
|
|
|
4fb3b7 |
docBlock+=yytext;
|
|
|
4fb3b7 |
docBlockName=&yytext[1];
|
|
|
4fb3b7 |
g_fencedSize=0;
|
|
|
4fb3b7 |
+ g_nestedComment=FALSE;
|
|
|
4fb3b7 |
BEGIN(DocCopyBlock);
|
|
|
4fb3b7 |
}
|
|
|
4fb3b7 |
<DocBlock>"~~~"[~]* {
|
|
|
4fb3b7 |
docBlock+=yytext;
|
|
|
4fb3b7 |
g_fencedSize=yyleng;
|
|
|
4fb3b7 |
+ g_nestedComment=FALSE;
|
|
|
4fb3b7 |
BEGIN(DocCopyBlock);
|
|
|
4fb3b7 |
}
|
|
|
4fb3b7 |
<DocBlock>{B}*"" {
|
|
|
4fb3b7 |
@@ -6179,6 +6184,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSI
|
|
|
4fb3b7 |
{
|
|
|
4fb3b7 |
docBlock+=yytext;
|
|
|
4fb3b7 |
docBlockName="";
|
|
|
4fb3b7 |
+ g_nestedComment=FALSE;
|
|
|
4fb3b7 |
BEGIN(DocCopyBlock);
|
|
|
4fb3b7 |
}
|
|
|
4fb3b7 |
else
|
|
|
4fb3b7 |
@@ -6240,12 +6246,32 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSI
|
|
|
4fb3b7 |
docBlock+=indent;
|
|
|
4fb3b7 |
}
|
|
|
4fb3b7 |
}
|
|
|
4fb3b7 |
-<DocCopyBlock>^{B}*+"*"/{BN}* { // start of a comment line
|
|
|
4fb3b7 |
+<DocCopyBlock>^{B}*"*"+/{BN}+"*"{BN}* { // start of a comment line with two *'s
|
|
|
4fb3b7 |
if (docBlockName=="code")
|
|
|
4fb3b7 |
{
|
|
|
4fb3b7 |
QCString indent;
|
|
|
4fb3b7 |
- indent.fill(' ',computeIndent(yytext,0)-1);
|
|
|
4fb3b7 |
- docBlock+=indent+"*";
|
|
|
4fb3b7 |
+ indent.fill(' ',computeIndent(yytext,0));
|
|
|
4fb3b7 |
+ docBlock+=indent;
|
|
|
4fb3b7 |
+ }
|
|
|
4fb3b7 |
+ else
|
|
|
4fb3b7 |
+ {
|
|
|
4fb3b7 |
+ REJECT;
|
|
|
4fb3b7 |
+ }
|
|
|
4fb3b7 |
+ }
|
|
|
4fb3b7 |
+<DocCopyBlock>^{B}*"*"+/{BN}* { // start of a comment line with one *
|
|
|
4fb3b7 |
+ if (docBlockName=="code")
|
|
|
4fb3b7 |
+ {
|
|
|
4fb3b7 |
+ QCString indent;
|
|
|
4fb3b7 |
+ if (g_nestedComment) // keep * it is part of the code
|
|
|
4fb3b7 |
+ {
|
|
|
4fb3b7 |
+ indent.fill(' ',computeIndent(yytext,-1));
|
|
|
4fb3b7 |
+ docBlock+=indent+"*";
|
|
|
4fb3b7 |
+ }
|
|
|
4fb3b7 |
+ else // remove * it is part of the comment block
|
|
|
4fb3b7 |
+ {
|
|
|
4fb3b7 |
+ indent.fill(' ',computeIndent(yytext,0));
|
|
|
4fb3b7 |
+ docBlock+=indent;
|
|
|
4fb3b7 |
+ }
|
|
|
4fb3b7 |
}
|
|
|
4fb3b7 |
else
|
|
|
4fb3b7 |
{
|
|
|
4fb3b7 |
@@ -6263,6 +6289,14 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSI
|
|
|
4fb3b7 |
docBlock+=yytext;
|
|
|
4fb3b7 |
}
|
|
|
4fb3b7 |
<DocCopyBlock>"/*"|"*/"|"//" {
|
|
|
4fb3b7 |
+ if (yytext[1]=='*')
|
|
|
4fb3b7 |
+ {
|
|
|
4fb3b7 |
+ g_nestedComment=TRUE;
|
|
|
4fb3b7 |
+ }
|
|
|
4fb3b7 |
+ else if (yytext[0]=='*')
|
|
|
4fb3b7 |
+ {
|
|
|
4fb3b7 |
+ g_nestedComment=FALSE;
|
|
|
4fb3b7 |
+ }
|
|
|
4fb3b7 |
docBlock+=yytext;
|
|
|
4fb3b7 |
}
|
|
|
4fb3b7 |
<DocCopyBlock>\n { // newline
|