Skip to content

Commit c6d53b8

Browse files
committed
issue #8622: Greater than in template function declaration not parsed correctly
1 parent 85364b6 commit c6d53b8

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

src/declinfo.l

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ struct declinfoYY_state
6161
QCString name;
6262
QCString args;
6363
int sharpCount;
64+
int roundCount;
6465
bool classTempListFound;
6566
bool funcTempListFound;
6667
QCString exceptionString;
@@ -169,22 +170,38 @@ ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+)
169170
<Start>{B}*"<" {
170171
yyextra->name+="<";
171172
yyextra->sharpCount=0;
173+
yyextra->roundCount=0;
172174
BEGIN(Template);
173175
}
174176
<Template>"<<" { yyextra->name+="<<"; }
175177
<Template>">>" { yyextra->name+=">>"; }
178+
<Template>"(" { yyextra->name+="(";
179+
yyextra->roundCount++;
180+
}
181+
<Template>")" { yyextra->name+=")";
182+
if (yyextra->roundCount>0)
183+
{
184+
yyextra->roundCount--;
185+
}
186+
}
176187
<Template>"<" {
177188
yyextra->name+="<";
178-
yyextra->sharpCount++;
189+
if (yyextra->roundCount==0)
190+
{
191+
yyextra->sharpCount++;
192+
}
179193
}
180194
<Template>">" {
181195
yyextra->name+=">";
182-
if (yyextra->sharpCount)
183-
--yyextra->sharpCount;
184-
else
185-
{
186-
BEGIN(Start);
187-
}
196+
if (yyextra->roundCount==0)
197+
{
198+
if (yyextra->sharpCount)
199+
--yyextra->sharpCount;
200+
else
201+
{
202+
BEGIN(Start);
203+
}
204+
}
188205
}
189206
<Template>. {
190207
yyextra->name+=*yytext;

0 commit comments

Comments
 (0)