Skip to content

Commit e5b35e8

Browse files
committed
issue #11102 Objective-C call graph is not shown when self proper is called
1 parent 814cfcc commit e5b35e8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/code.l

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,17 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
15211521
<ObjCCallComment>{CPPC}|{CCS} { yyextra->currentCtx->comment << yytext; }
15221522
<ObjCCallComment>\n { yyextra->currentCtx->comment << *yytext; }
15231523
<ObjCCallComment>. { yyextra->currentCtx->comment << *yytext; }
1524+
<ObjCCall>"self."{ID} {
1525+
QCString id = &yytext[5];
1526+
yyextra->currentCtx->format+=escapeWord(yyscanner,"self")+".";
1527+
yyextra->currentCtx->format+=escapeObject(yyscanner,id.data());
1528+
if (yyextra->braceCount==0)
1529+
{
1530+
yyextra->currentCtx->objectTypeOrName=id;
1531+
DBG_CTX((stderr,"new type=%s\n",qPrint(yyextra->currentCtx->objectTypeOrName)));
1532+
BEGIN(ObjCMName);
1533+
}
1534+
}
15241535
<ObjCCall>{ID} {
15251536
yyextra->currentCtx->format+=escapeObject(yyscanner,yytext);
15261537
if (yyextra->braceCount==0)
@@ -3908,7 +3919,16 @@ static void writeObjCMethodCall(yyscan_t yyscanner,ObjCCallCtx *ctx)
39083919
if (it!=yyextra->wordMap.end())
39093920
{
39103921
QCString word = it->second;
3922+
bool isKeyword = word=="self";
3923+
if (isKeyword)
3924+
{
3925+
startFontClass(yyscanner,"keyword");
3926+
}
39113927
codifyLines(yyscanner,word);
3928+
if (isKeyword)
3929+
{
3930+
endFontClass(yyscanner);
3931+
}
39123932
}
39133933
}
39143934
else if (nc=='d') // comment block

0 commit comments

Comments
 (0)