Blame SOURCES/doxygen-1.8.5-bz#1483569.patch

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