Permalink
Browse files

Bug 775493 - Usage of underscore's in parameter names

  • Loading branch information...
Dimitri van Heesch
Dimitri van Heesch committed Jan 8, 2017
1 parent 381d9d2 commit c10af45c61a1f9b25c514f397ace16c94cc7c8df
Showing with 45 additions and 2 deletions.
  1. +45 −2 src/commentscan.l
@@ -125,6 +125,8 @@ static bool handleCopyBrief(const QCString &);
static bool handleCopyDetails(const QCString &);
static bool handleParBlock(const QCString &);
static bool handleEndParBlock(const QCString &);
static bool handleParam(const QCString &);
static bool handleRetval(const QCString &);
typedef bool (*DocCmdFunc)(const QCString &name);
@@ -247,7 +249,7 @@ static DocCmdMap docCmdMap[] =
{ "line", 0, TRUE },
{ "note", 0, TRUE },
{ "par", 0, TRUE },
{ "param", 0, TRUE },
{ "param", &handleParam, TRUE },
{ "tparam", 0, TRUE },
{ "post", 0, TRUE },
{ "pre", 0, TRUE },
@@ -257,7 +259,7 @@ static DocCmdMap docCmdMap[] =
{ "return", 0, TRUE },
{ "returns", 0, TRUE },
{ "exception", 0, TRUE },
{ "retval", 0, TRUE },
{ "retval", &handleRetval, TRUE },
{ "sa", 0, TRUE },
{ "see", 0, TRUE },
{ "since", 0, TRUE },
@@ -971,6 +973,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
%x XRefItemParam2
%x XRefItemParam3
%x FileDocArg1
%x ParamArg1
%x EnumDocArg1
%x NameSpaceDocArg1
%x PackageDocArg1
@@ -1564,6 +1567,30 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
BEGIN( Comment );
}
/* --------- handle arguments of the param command ------------ */
<ParamArg1>{ID}/{B}*"," {
if (yytext[0]=='_' && Config_getBool(MARKDOWN_SUPPORT))
{
addOutput('\\');
}
addOutput(yytext);
}
<ParamArg1>"," {
addOutput(" , ");
}
<ParamArg1>{ID} {
if (yytext[0]=='_' && Config_getBool(MARKDOWN_SUPPORT))
{
addOutput('\\');
}
addOutput(yytext);
BEGIN( Comment );
}
<ParamArg1>. {
unput(yytext[0]);
BEGIN( Comment );
}
/* --------- handle arguments of the file/dir/example command ------------ */
<FileDocArg1>{DOCNL} { // no file name specfied
@@ -2400,6 +2427,22 @@ static bool handleFile(const QCString &)
return stop;
}
static bool handleParam(const QCString &)
{
// we need process param and retval arguments to escape leading underscores in case of
// markdown processing, see bug775493
addOutput("@param ");
BEGIN( ParamArg1 );
return FALSE;
}
static bool handleRetval(const QCString &)
{
addOutput("@retval ");
BEGIN( ParamArg1 );
return FALSE;
}
static bool handleDir(const QCString &)
{
bool stop=makeStructuralIndicator(Entry::DIRDOC_SEC);

0 comments on commit c10af45

Please sign in to comment.