summaryrefslogtreecommitdiffstats
path: root/src/code.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2004-10-10 19:13:27 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2004-10-10 19:13:27 (GMT)
commit50828c3c773e8095785c010c1aad3891076742f4 (patch)
treea1de4b4e9cdb500ec50176a1d5a70efafc4eb88f /src/code.l
parent89f2e4c8f026df987fab492c050e43011ef96871 (diff)
downloadDoxygen-50828c3c773e8095785c010c1aad3891076742f4.zip
Doxygen-50828c3c773e8095785c010c1aad3891076742f4.tar.gz
Doxygen-50828c3c773e8095785c010c1aad3891076742f4.tar.bz2
Release-1.3.9.1
Diffstat (limited to 'src/code.l')
-rw-r--r--src/code.l38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/code.l b/src/code.l
index fd47652..cefd8bb 100644
--- a/src/code.l
+++ b/src/code.l
@@ -843,18 +843,18 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,
}
}
-static bool getLink(const char *className,
- const char *memberName,
- BaseCodeDocInterface &ol,
- const char *text=0)
+static bool getLinkInScope(const QCString &c, // scope
+ const QCString &m, // member
+ const char *memberText, // exact text
+ BaseCodeDocInterface &ol,
+ const char *text
+ )
{
MemberDef *md;
ClassDef *cd;
FileDef *fd;
NamespaceDef *nd;
GroupDef *gd;
- QCString m=removeRedundantWhiteSpace(memberName);
- QCString c=className;
//printf("Trying `%s'::`%s'\n",c.data(),m.data());
if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,g_sourceFileDef) &&
md->isLinkable())
@@ -894,14 +894,34 @@ static bool getLink(const char *className,
writeMultiLineCodeLink(ol,md->getReference(),
md->getOutputFileBase(),
md->anchor(),
- text ? text : memberName);
- addToSearchIndex(text ? text : memberName);
+ text ? text : memberText);
+ addToSearchIndex(text ? text : memberText);
return TRUE;
}
}
return FALSE;
}
+static bool getLink(const char *className,
+ const char *memberName,
+ BaseCodeDocInterface &ol,
+ const char *text=0)
+{
+ QCString m=removeRedundantWhiteSpace(memberName);
+ QCString c=className;
+ if (!getLinkInScope(c,m,memberName,ol,text))
+ {
+ if (!g_curClassName.isEmpty())
+ {
+ if (!c.isEmpty()) c.prepend("::");
+ c.prepend(g_curClassName);
+ return getLinkInScope(c,m,memberName,ol,text);
+ }
+ return FALSE;
+ }
+ return TRUE;
+}
+
static bool generateClassMemberLink(BaseCodeDocInterface &ol,ClassDef *mcd,const char *memName)
{
if (mcd)
@@ -1761,7 +1781,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'"))
BEGIN( Body );
}
<ClassName,ClassVar>[*&]+ {
- g_type=g_curClassName;
+ g_type=g_curClassName.copy();
g_name.resize(0);
g_code->codify(yytext);
BEGIN( Body ); // variable of type struct *