diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2017-01-08 09:22:40 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2017-01-08 09:22:40 (GMT) |
commit | c10af45c61a1f9b25c514f397ace16c94cc7c8df (patch) | |
tree | 71d4dacd8e33a605ca35d532fc77f582d6189d30 /src/commentscan.l | |
parent | 381d9d286dd27ce0ba14989b51011070d8583d62 (diff) | |
download | Doxygen-c10af45c61a1f9b25c514f397ace16c94cc7c8df.zip Doxygen-c10af45c61a1f9b25c514f397ace16c94cc7c8df.tar.gz Doxygen-c10af45c61a1f9b25c514f397ace16c94cc7c8df.tar.bz2 |
Bug 775493 - Usage of underscore's in parameter names
Diffstat (limited to 'src/commentscan.l')
-rw-r--r-- | src/commentscan.l | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index fad09d9..f26cabd 100644 --- a/src/commentscan.l +++ b/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); |