Skip to content

Commit 4cef14a

Browse files
authored
Merge pull request doxygen#6772 from albert-github/feature/issue_6764
issue doxygen#6764 Incorrect parsing of C enum comments defined using a macro
2 parents 6549eb6 + 9c44f50 commit 4cef14a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/pre.l

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,21 @@ static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int
882882
arg+=c;
883883
}
884884
}
885+
else if (c=='/') // possible start of a comment
886+
{
887+
char prevChar = '\0';
888+
arg+=c;
889+
if ((cc=getCurrentChar(expr,rest,j)) == '*') // we have a comment
890+
{
891+
while ((cc=getNextChar(expr,rest,j))!=EOF && cc!=0)
892+
{
893+
c=(char)cc;
894+
arg+=c;
895+
if (c == '/' && prevChar == '*') break; // we have an end of comment
896+
prevChar = c;
897+
}
898+
}
899+
}
885900
else // append other characters
886901
{
887902
arg+=c;
@@ -1110,7 +1125,6 @@ static void expandExpression(QCString &expr,QCString *rest,int pos)
11101125

11111126
if (replaced) // expand the macro and rescan the expression
11121127
{
1113-
11141128
//printf("replacing `%s'->`%s'\n",expr.mid(p,len).data(),expMacro.data());
11151129
QCString resultExpr=expMacro;
11161130
QCString restExpr=expr.right(expr.length()-len-p);

0 commit comments

Comments
 (0)