@@ -94,6 +94,7 @@ struct pycodeYY_state
94
94
QCString classScope;
95
95
int paramParens = 0 ;
96
96
97
+ bool insideBody = false ;
97
98
bool exampleBlock = FALSE ;
98
99
QCString exampleName;
99
100
@@ -389,7 +390,9 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBU
389
390
// about what to accept.
390
391
391
392
yyextra->curClassBases .push_back (yytext);
393
+ yyextra->insideBody = true ;
392
394
generateClassOrGlobalLink (yyscanner,*yyextra->code ,yytext);
395
+ yyextra->insideBody = false ;
393
396
// codify(yyscanner,yytext);
394
397
}
395
398
@@ -506,10 +509,14 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBU
506
509
endFontClass (yyscanner);
507
510
}
508
511
({IDENTIFIER}" ." )*{IDENTIFIER}/" (" {
512
+ yyextra->insideBody = true ;
509
513
generateClassOrGlobalLink (yyscanner,*yyextra->code ,yytext);
514
+ yyextra->insideBody = false ;
510
515
}
511
516
({IDENTIFIER}" ." )+{IDENTIFIER} {
517
+ yyextra->insideBody = true ;
512
518
generateClassOrGlobalLink (yyscanner,*yyextra->code ,yytext,TRUE );
519
+ yyextra->insideBody = false ;
513
520
}
514
521
{IDENTIFIER} { codify (yyscanner,yytext); }
515
522
@@ -1023,7 +1030,7 @@ static void startCodeLine(yyscan_t yyscanner)
1023
1030
{
1024
1031
yyextra->currentDefinition = d;
1025
1032
yyextra->currentMemberDef = yyextra->sourceFileDef ->getSourceMember (yyextra->yyLineNr );
1026
- // yyextra->insideBody = FALSE ;
1033
+ yyextra->insideBody = false ;
1027
1034
yyextra->endComment = FALSE ;
1028
1035
yyextra->searchingForBody = TRUE ;
1029
1036
yyextra->realScope = d->name ();
@@ -1232,7 +1239,7 @@ static bool getLinkInScope(yyscan_t yyscanner,
1232
1239
// printf("yyextra->currentDefinition=%p yyextra->currentMemberDef=%p\n",
1233
1240
// yyextra->currentDefinition,yyextra->currentMemberDef);
1234
1241
1235
- if (yyextra->currentDefinition && yyextra->currentMemberDef && yyextra->collectXRefs )
1242
+ if (yyextra->currentDefinition && yyextra->currentMemberDef && yyextra->collectXRefs && yyextra-> insideBody )
1236
1243
{
1237
1244
std::lock_guard<std::mutex> lock (g_docCrossReferenceMutex);
1238
1245
addDocCrossReference (toMemberDefMutable (yyextra->currentMemberDef ),toMemberDefMutable (md));
@@ -1343,7 +1350,7 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
1343
1350
md->getBodyDef () : md->getOuterScope ();
1344
1351
if (md->getGroupDef ()) d = md->getGroupDef ();
1345
1352
if (d && d->isLinkable () && md->isLinkable () &&
1346
- yyextra->currentMemberDef && yyextra->collectXRefs )
1353
+ yyextra->currentMemberDef && yyextra->collectXRefs && yyextra-> insideBody )
1347
1354
{
1348
1355
std::lock_guard<std::mutex> lock (g_docCrossReferenceMutex);
1349
1356
addDocCrossReference (toMemberDefMutable (yyextra->currentMemberDef ),toMemberDefMutable (md));
@@ -1371,7 +1378,7 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
1371
1378
mmd->getBodyDef () : mmd->getOuterScope ();
1372
1379
if (mmd->getGroupDef ()) d = mmd->getGroupDef ();
1373
1380
if (d && d->isLinkable () && mmd->isLinkable () &&
1374
- yyextra->currentMemberDef && yyextra->collectXRefs )
1381
+ yyextra->currentMemberDef && yyextra->collectXRefs && yyextra-> insideBody )
1375
1382
{
1376
1383
std::lock_guard<std::mutex> lock (g_docCrossReferenceMutex);
1377
1384
addDocCrossReference (toMemberDefMutable (yyextra->currentMemberDef ),toMemberDefMutable (mmd));
@@ -1395,7 +1402,7 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
1395
1402
mmd->getBodyDef () : mmd->getOuterScope ();
1396
1403
if (mmd->getGroupDef ()) d = mmd->getGroupDef ();
1397
1404
if (d && d->isLinkable () && mmd->isLinkable () &&
1398
- yyextra->currentMemberDef && yyextra->collectXRefs )
1405
+ yyextra->currentMemberDef && yyextra->collectXRefs && yyextra-> insideBody )
1399
1406
{
1400
1407
std::lock_guard<std::mutex> lock (g_docCrossReferenceMutex);
1401
1408
addDocCrossReference (toMemberDefMutable (yyextra->currentMemberDef ),toMemberDefMutable (mmd));
0 commit comments