@@ -574,6 +574,8 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
574574 }
575575<Body,FuncCall>" {" {
576576 yyextra->theVarContext.pushScope();
577+ yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
578+ yyextra->bracketCount = 0;
577579
578580 DBG_CTX((stderr," ** scope stack push INNERBLOCK\n" ));
579581 yyextra->scopeStack.push(INNERBLOCK);
@@ -594,6 +596,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
594596 }
595597<Body,FuncCall,MemberCall,MemberCall2>" }" {
596598 yyextra->theVarContext.popScope();
599+ yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
597600 yyextra->type.clear();
598601 yyextra->name.clear();
599602
@@ -1064,7 +1067,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
10641067 }
10651068<Body>" *" {B}*" )" { // end of cast?
10661069 yyextra->code->codify(yytext);
1067- yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
1070+ yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount );
10681071 yyextra->bracketCount--;
10691072 yyextra->parmType = yyextra->name;
10701073 BEGIN(FuncCall);
@@ -1077,7 +1080,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
10771080 yyextra->name.clear();yyextra->type.clear();
10781081 if (*yytext==')')
10791082 {
1080- yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
1083+ yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount );
10811084 yyextra->bracketCount--;
10821085 if (yyextra->bracketCount<=0)
10831086 {
@@ -1469,7 +1472,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
14691472 }
14701473 else if (*yytext=='[')
14711474 {
1472- yyextra->theCallContext.pushScope(yyextra->name, yyextra->type);
1475+ yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount );
14731476 }
14741477 yyextra->args.clear();
14751478 yyextra->parmType.clear();
@@ -1568,7 +1571,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
15681571<ObjCCall,ObjCMName,ObjCSkipStr>\n { yyextra->currentCtx ->format +=*yytext; }
15691572
15701573<Body>" ]" {
1571- yyextra->theCallContext .popScope (yyextra->name , yyextra->type );
1574+ yyextra->theCallContext .popScope (yyextra->name , yyextra->type , yyextra-> bracketCount );
15721575 yyextra->code ->codify (yytext);
15731576 // TODO: nested arrays like: a[b[0]->func()]->func()
15741577 yyextra->name = yyextra->saveName ;
@@ -1676,7 +1679,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
16761679 yyextra->parmType.clear();yyextra->parmName.clear();
16771680 yyextra->code->codify(yytext);
16781681 yyextra->bracketCount++;
1679- yyextra->theCallContext.pushScope(yyextra->name, yyextra->type);
1682+ yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount );
16801683 if (YY_START==FuncCall && !yyextra->insideBody)
16811684 {
16821685 yyextra->theVarContext.pushScope();
@@ -1710,7 +1713,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
17101713 yyextra->parmName .clear ();
17111714 addVariable (yyscanner,yyextra->parmType ,yyextra->parmName );
17121715 }
1713- yyextra->theCallContext .popScope (yyextra->name , yyextra->type );
1716+ yyextra->theCallContext .popScope (yyextra->name , yyextra->type , yyextra-> bracketCount );
17141717 yyextra->inForEachExpression = FALSE ;
17151718 // yyextra->theCallContext.setClass(0); // commented out, otherwise a()->b() does not work for b().
17161719 yyextra->code ->codify (yytext);
@@ -2255,12 +2258,12 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
22552258<*>" (" |" [" {
22562259 if (yytext[0]=='(') yyextra->bracketCount++;
22572260 yyextra->code->codify(yytext);
2258- yyextra->theCallContext.pushScope(yyextra->name, yyextra->type);
2261+ yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount );
22592262 }
22602263<*>" )" |" ]" {
22612264 if (yytext[0]==')') yyextra->bracketCount--;
22622265 yyextra->code->codify(yytext);
2263- yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
2266+ yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount );
22642267 }
22652268<*>\n {
22662269 codifyLines(yyscanner,yytext);
0 commit comments