summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-01-15 14:04:24 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-01-15 14:04:24 (GMT)
commit9c44f500a8305ba6603875e49bc682f721fafa1d (patch)
tree60c3dfa13bba9422b3ff224bffdf4321cc4bacbb /src
parent6a1b3708a6bc240cea79b3191b0dafacb014fdb6 (diff)
downloadDoxygen-9c44f500a8305ba6603875e49bc682f721fafa1d.zip
Doxygen-9c44f500a8305ba6603875e49bc682f721fafa1d.tar.gz
Doxygen-9c44f500a8305ba6603875e49bc682f721fafa1d.tar.bz2
issue #6764 Incorrect parsing of C enum comments defined using a macro
When in a `/*` comment skip till end of the comment so a `,` won't be seen as the argument separator.
Diffstat (limited to 'src')
-rw-r--r--src/pre.l16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/pre.l b/src/pre.l
index 5eb0c5c..b18984e 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -882,6 +882,21 @@ static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int
arg+=c;
}
}
+ else if (c=='/') // possible start of a comment
+ {
+ char prevChar = '\0';
+ arg+=c;
+ if ((cc=getCurrentChar(expr,rest,j)) == '*') // we have a comment
+ {
+ while ((cc=getNextChar(expr,rest,j))!=EOF && cc!=0)
+ {
+ c=(char)cc;
+ arg+=c;
+ if (c == '/' && prevChar == '*') break; // we have an end of comment
+ prevChar = c;
+ }
+ }
+ }
else // append other characters
{
arg+=c;
@@ -1110,7 +1125,6 @@ static void expandExpression(QCString &expr,QCString *rest,int pos)
if (replaced) // expand the macro and rescan the expression
{
-
//printf("replacing `%s'->`%s'\n",expr.mid(p,len).data(),expMacro.data());
QCString resultExpr=expMacro;
QCString restExpr=expr.right(expr.length()-len-p);