Blame doxygen-1.8.13-#775493.patch

Than Ngo 1fdd96
diff --git a/src/commentscan.l b/src/commentscan.l
Than Ngo 1fdd96
index fad09d9..f26cabd 100644
Than Ngo 1fdd96
--- a/src/commentscan.l
Than Ngo 1fdd96
+++ b/src/commentscan.l
Than Ngo 1fdd96
@@ -125,6 +125,8 @@ static bool handleCopyBrief(const QCString &);
Than Ngo 1fdd96
 static bool handleCopyDetails(const QCString &);
Than Ngo 1fdd96
 static bool handleParBlock(const QCString &);
Than Ngo 1fdd96
 static bool handleEndParBlock(const QCString &);
Than Ngo 1fdd96
+static bool handleParam(const QCString &);
Than Ngo 1fdd96
+static bool handleRetval(const QCString &);
Than Ngo 1fdd96
 
Than Ngo 1fdd96
 typedef bool (*DocCmdFunc)(const QCString &name);
Than Ngo 1fdd96
 
Than Ngo 1fdd96
@@ -247,7 +249,7 @@ static DocCmdMap docCmdMap[] =
Than Ngo 1fdd96
   { "line",            0,                       TRUE  },
Than Ngo 1fdd96
   { "note",            0,                       TRUE  },
Than Ngo 1fdd96
   { "par",             0,                       TRUE  },
Than Ngo 1fdd96
-  { "param",           0,                       TRUE  },
Than Ngo 1fdd96
+  { "param",           &handleParam,            TRUE  },
Than Ngo 1fdd96
   { "tparam",          0,                       TRUE  },
Than Ngo 1fdd96
   { "post",            0,                       TRUE  },
Than Ngo 1fdd96
   { "pre",             0,                       TRUE  },
Than Ngo 1fdd96
@@ -257,7 +259,7 @@ static DocCmdMap docCmdMap[] =
Than Ngo 1fdd96
   { "return",          0,                       TRUE  },
Than Ngo 1fdd96
   { "returns",         0,                       TRUE  },
Than Ngo 1fdd96
   { "exception",       0,                       TRUE  },
Than Ngo 1fdd96
-  { "retval",          0,                       TRUE  },
Than Ngo 1fdd96
+  { "retval",          &handleRetval,           TRUE  },
Than Ngo 1fdd96
   { "sa",              0,                       TRUE  },
Than Ngo 1fdd96
   { "see",             0,                       TRUE  },
Than Ngo 1fdd96
   { "since",           0,                       TRUE  },
Than Ngo 1fdd96
@@ -971,6 +973,7 @@ RCSTAG    "$"{ID}":"[^\n$]+"$"
Than Ngo 1fdd96
 %x      XRefItemParam2
Than Ngo 1fdd96
 %x      XRefItemParam3
Than Ngo 1fdd96
 %x      FileDocArg1
Than Ngo 1fdd96
+%x      ParamArg1
Than Ngo 1fdd96
 %x	EnumDocArg1
Than Ngo 1fdd96
 %x	NameSpaceDocArg1
Than Ngo 1fdd96
 %x	PackageDocArg1
Than Ngo 1fdd96
@@ -1564,6 +1567,30 @@ RCSTAG    "$"{ID}":"[^\n$]+"$"
Than Ngo 1fdd96
 					  BEGIN( Comment );
Than Ngo 1fdd96
 					}
Than Ngo 1fdd96
 
Than Ngo 1fdd96
+  /* --------- handle arguments of the param command ------------ */
Than Ngo 1fdd96
+<ParamArg1>{ID}/{B}*","                 {
Than Ngo 1fdd96
+                                          if (yytext[0]=='_' && Config_getBool(MARKDOWN_SUPPORT))
Than Ngo 1fdd96
+                                          {
Than Ngo 1fdd96
+                                            addOutput('\\');
Than Ngo 1fdd96
+                                          }
Than Ngo 1fdd96
+                                          addOutput(yytext);
Than Ngo 1fdd96
+                                        }
Than Ngo 1fdd96
+<ParamArg1>","                          {
Than Ngo 1fdd96
+                                          addOutput(" , ");
Than Ngo 1fdd96
+                                        }
Than Ngo 1fdd96
+<ParamArg1>{ID}                         {
Than Ngo 1fdd96
+                                          if (yytext[0]=='_' && Config_getBool(MARKDOWN_SUPPORT))
Than Ngo 1fdd96
+                                          {
Than Ngo 1fdd96
+                                            addOutput('\\');
Than Ngo 1fdd96
+                                          }
Than Ngo 1fdd96
+                                          addOutput(yytext);
Than Ngo 1fdd96
+                                          BEGIN( Comment );
Than Ngo 1fdd96
+                                        }
Than Ngo 1fdd96
+<ParamArg1>.                            {
Than Ngo 1fdd96
+                                          unput(yytext[0]);
Than Ngo 1fdd96
+                                          BEGIN( Comment );
Than Ngo 1fdd96
+                                        }
Than Ngo 1fdd96
+
Than Ngo 1fdd96
   /* --------- handle arguments of the file/dir/example command ------------ */
Than Ngo 1fdd96
 
Than Ngo 1fdd96
 <FileDocArg1>{DOCNL}			{ // no file name specfied
Than Ngo 1fdd96
@@ -2400,6 +2427,22 @@ static bool handleFile(const QCString &)
Than Ngo 1fdd96
   return stop;
Than Ngo 1fdd96
 }
Than Ngo 1fdd96
 
Than Ngo 1fdd96
+static bool handleParam(const QCString &)
Than Ngo 1fdd96
+{
Than Ngo 1fdd96
+  // we need process param and retval arguments to escape leading underscores in case of
Than Ngo 1fdd96
+  // markdown processing, see bug775493
Than Ngo 1fdd96
+  addOutput("@param ");
Than Ngo 1fdd96
+  BEGIN( ParamArg1 );
Than Ngo 1fdd96
+  return FALSE;
Than Ngo 1fdd96
+}
Than Ngo 1fdd96
+
Than Ngo 1fdd96
+static bool handleRetval(const QCString &)
Than Ngo 1fdd96
+{
Than Ngo 1fdd96
+  addOutput("@retval ");
Than Ngo 1fdd96
+  BEGIN( ParamArg1 );
Than Ngo 1fdd96
+  return FALSE;
Than Ngo 1fdd96
+}
Than Ngo 1fdd96
+
Than Ngo 1fdd96
 static bool handleDir(const QCString &)
Than Ngo 1fdd96
 {
Than Ngo 1fdd96
   bool stop=makeStructuralIndicator(Entry::DIRDOC_SEC);