Skip to content

Commit a1a6e29

Browse files
committed
issue #8633 Line break in C++ nested-name confuses doxygen
The white space was detected by doxygen in the name of a variable / scope name but handled with removeRedundantWhiteSpace and this left a space after the `::`, using a dedicated method solves this issue.
1 parent 97dffa0 commit a1a6e29

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/scanner.l

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ static void addKnRArgInfo(yyscan_t yyscanner,const QCString &type,const QCString
226226
const QCString &brief,const QCString &docs);
227227
static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
228228

229+
static QCString removeWhiteSpace(const QCString &s);
229230

230231
/* ----------------------------------------------------------------- */
231232
#undef YY_INPUT
@@ -2345,6 +2346,7 @@ NONLopt [^\n]*
23452346
BEGIN(FindMembers);
23462347
}
23472348
}
2349+
yyextra->current->name = removeWhiteSpace(yyextra->current->name);
23482350
}
23492351
<StaticAssert>"(" {
23502352
yyextra->lastSkipRoundContext = FindMembers;
@@ -7068,7 +7070,7 @@ static void addType(yyscan_t yyscanner)
70687070
{
70697071
yyextra->current->type += ' ' ;
70707072
}
7071-
yyextra->current->type += yyextra->current->name ;
7073+
yyextra->current->type += yyextra->current->name;
70727074
yyextra->current->name.resize(0) ;
70737075
tl=yyextra->current->type.length();
70747076
if( tl>0 && !yyextra->current->args.isEmpty() && yyextra->current->type.at(tl-1)!='.')
@@ -7704,6 +7706,19 @@ static void parsePrototype(yyscan_t yyscanner,const QCString &text)
77047706
//printf("**** parsePrototype end\n");
77057707
}
77067708
7709+
// removeRedundantWhiteSpace does not work as it will leave e.g. "foo:: bar"
7710+
static QCString removeWhiteSpace(const QCString &s)
7711+
{
7712+
QCString res;
7713+
uint l=s.length();
7714+
const char *src=s.data();
7715+
for (uint i = 0;i<l;i++)
7716+
{
7717+
if (!isspace((uchar)src[i])) res += src[i];
7718+
}
7719+
return res;
7720+
}
7721+
77077722
//static void handleGroupStartCommand(const char *header)
77087723
//{
77097724
// memberGroupHeader=header;

0 commit comments

Comments
 (0)