Skip to content

Commit 20f8e3d

Browse files
authored
Merge pull request doxygen#11558 from albert-github/feature/issue_9843
Issue doxygen#9843 Incomplete call graph when using curly brackets in constructor call (C++)
2 parents f8ce920 + dbcd4c6 commit 20f8e3d

File tree

1 file changed

+41
-35
lines changed

1 file changed

+41
-35
lines changed

src/code.l

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
348348
%x SkipComment
349349
%x SkipCxxComment
350350
%x Body
351+
%x BodyVar
351352
%x FuncCall
352353
%x MemberCall
353354
%x MemberCall2
@@ -571,38 +572,6 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
571572
<SkipCPP>{CPPC}/[^/!] {
572573
REJECT;
573574
}
574-
<Body,FuncCall>"{" {
575-
yyextra->theVarContext.pushScope();
576-
yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
577-
yyextra->bracketCount = 0;
578-
579-
DBG_CTX((stderr,"** type='%s' name='%s'\n",qPrint(yyextra->type),qPrint(yyextra->name)));
580-
if (yyextra->type.find("enum ")!=-1)
581-
{ // for strong enums we need to start a scope
582-
DBG_CTX((stderr,"** scope stack push SCOPEBLOCK\n"));
583-
pushScope(yyscanner,yyextra->name);
584-
yyextra->scopeStack.push(SCOPEBLOCK);
585-
}
586-
else
587-
{
588-
DBG_CTX((stderr,"** scope stack push INNERBLOCK\n"));
589-
yyextra->scopeStack.push(INNERBLOCK);
590-
}
591-
592-
if (yyextra->searchingForBody)
593-
{
594-
yyextra->searchingForBody=FALSE;
595-
yyextra->insideBody=TRUE;
596-
}
597-
yyextra->code->codify(yytext);
598-
if (yyextra->insideBody)
599-
{
600-
yyextra->bodyCurlyCount++;
601-
}
602-
yyextra->type.clear();
603-
yyextra->name.clear();
604-
BEGIN( Body );
605-
}
606575
<Body,FuncCall,MemberCall,MemberCall2>"}" {
607576
yyextra->theVarContext.popScope();
608577
yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
@@ -1446,7 +1415,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
14461415
yyextra->type.clear();
14471416
BEGIN(yyextra->memCallContext);
14481417
}
1449-
<Body>[,=;\[] {
1418+
<Body>[,=;\[{] {
14501419
if (yyextra->insideObjC && *yytext=='[')
14511420
{
14521421
DBG_CTX((stderr,"Found start of ObjC call!\n"));
@@ -1466,7 +1435,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
14661435
}
14671436
else
14681437
{
1469-
yyextra->code->codify(yytext);
1438+
if (*yytext!='{') yyextra->code->codify(yytext);
14701439
yyextra->saveName = yyextra->name;
14711440
yyextra->saveType = yyextra->type;
14721441
if (*yytext!='[' && !yyextra->type.isEmpty())
@@ -1480,7 +1449,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
14801449
}
14811450
yyextra->name.clear();
14821451
}
1483-
if (*yytext==';' || *yytext=='=')
1452+
if (*yytext==';' || *yytext=='=' || *yytext=='{')
14841453
{
14851454
yyextra->type.clear();
14861455
yyextra->name.clear();
@@ -1492,7 +1461,44 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
14921461
yyextra->args.clear();
14931462
yyextra->parmType.clear();
14941463
yyextra->parmName.clear();
1464+
if (*yytext=='{')
1465+
{
1466+
BEGIN( BodyVar );
1467+
unput('{');
1468+
}
1469+
}
1470+
}
1471+
<Body,FuncCall,BodyVar>"{" {
1472+
yyextra->theVarContext.pushScope();
1473+
yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1474+
yyextra->bracketCount = 0;
1475+
1476+
DBG_CTX((stderr,"** type='%s' name='%s'\n",qPrint(yyextra->type),qPrint(yyextra->name)));
1477+
if (yyextra->type.find("enum ")!=-1)
1478+
{ // for strong enums we need to start a scope
1479+
DBG_CTX((stderr,"** scope stack push SCOPEBLOCK\n"));
1480+
pushScope(yyscanner,yyextra->name);
1481+
yyextra->scopeStack.push(SCOPEBLOCK);
1482+
}
1483+
else
1484+
{
1485+
DBG_CTX((stderr,"** scope stack push INNERBLOCK\n"));
1486+
yyextra->scopeStack.push(INNERBLOCK);
1487+
}
1488+
1489+
if (yyextra->searchingForBody)
1490+
{
1491+
yyextra->searchingForBody=FALSE;
1492+
yyextra->insideBody=TRUE;
14951493
}
1494+
yyextra->code->codify(yytext);
1495+
if (yyextra->insideBody)
1496+
{
1497+
yyextra->bodyCurlyCount++;
1498+
}
1499+
yyextra->type.clear();
1500+
yyextra->name.clear();
1501+
BEGIN( Body );
14961502
}
14971503
<ObjCCall,ObjCMName>"["|"{" {
14981504
saveObjCContext(yyscanner);

0 commit comments

Comments
 (0)