summaryrefslogtreecommitdiffstats
path: root/src/code.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2013-05-31 20:12:30 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-06-15 08:47:58 (GMT)
commitbd76ec600742936e6373ccbcdfc19966b44cb3ec (patch)
tree54abe9cfcb619e333e71cc2e9571eea244908150 /src/code.l
parent438375840da2b1ea19126f8d4b53f0bc71c62a68 (diff)
downloadDoxygen-bd76ec600742936e6373ccbcdfc19966b44cb3ec.zip
Doxygen-bd76ec600742936e6373ccbcdfc19966b44cb3ec.tar.gz
Doxygen-bd76ec600742936e6373ccbcdfc19966b44cb3ec.tar.bz2
Bug 701314 - URLs are not created on C# classes in some cases
Diffstat (limited to 'src/code.l')
-rw-r--r--src/code.l50
1 files changed, 45 insertions, 5 deletions
diff --git a/src/code.l b/src/code.l
index d38f492..2a415b0 100644
--- a/src/code.l
+++ b/src/code.l
@@ -112,6 +112,9 @@ static int g_memCallContext;
static int g_lastCContext;
static bool g_insideObjC;
+static bool g_insideJava;
+static bool g_insideCS;
+static bool g_insidePHP;
static bool g_insideProtocolList;
static bool g_lexInit = FALSE;
@@ -927,7 +930,14 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName
{
className+="-p";
}
- className = substitute(className,"\\","::"); // for PHP namespaces
+ if (g_insidePHP)
+ {
+ className = substitute(className,"\\","::"); // for PHP namespaces
+ }
+ else if (g_insideCS || g_insideJava)
+ {
+ className = substitute(className,".","::"); // for PHP namespaces
+ }
ClassDef *cd=0,*lcd=0;
MemberDef *md=0;
bool isLocal=FALSE;
@@ -1747,8 +1757,10 @@ static int yyread(char *buf,int max_size)
B [ \t]
BN [ \t\n\r]
ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
-SEP ("::"|"\\")
+SEP ("::"|"\\")
+SEPCS (".")
SCOPENAME ({SEP}{BN}*)?({ID}{BN}*{SEP}{BN}*)*("~"{BN}*)?{ID}
+SCOPENAMECS ({SEPCS}{BN}*)?({ID}{BN}*{SEPCS}{BN}*)*("~"{BN}*)?{ID}
TEMPLIST "<"[^\"\}\{\(\)\/\n\>]*">"
SCOPETNAME (((({ID}{TEMPLIST}?){BN}*)?{SEP}{BN}*)*)((~{BN}*)?{ID})
SCOPEPREFIX ({ID}{TEMPLIST}?{BN}*{SEP}{BN}*)+
@@ -2492,6 +2504,20 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
generateClassOrGlobalLink(*g_code,yytext);
g_name+=yytext;
}
+<Body>{SCOPENAMECS}/{BN}*[;,)\]] { // "int var;" or "var, var2" or "debug(f) macro"
+ if (!g_insideCS && !g_insideJava)
+ {
+ REJECT;
+ }
+ else
+ {
+ addType();
+ // changed this to generateFunctionLink, see bug 624514
+ //generateClassOrGlobalLink(*g_code,yytext,FALSE,TRUE);
+ generateFunctionLink(*g_code,yytext);
+ g_name+=yytext;
+ }
+ }
<Body>{SCOPENAME}/{BN}*[;,)\]] { // "int var;" or "var, var2" or "debug(f) macro"
addType();
// changed this to generateFunctionLink, see bug 624514
@@ -2499,6 +2525,18 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
generateFunctionLink(*g_code,yytext);
g_name+=yytext;
}
+<Body>{SCOPENAMECS}/{B}* { // p->func()
+ if (!g_insideCS && !g_insideJava)
+ {
+ REJECT;
+ }
+ else
+ {
+ addType();
+ generateClassOrGlobalLink(*g_code,yytext);
+ g_name+=yytext;
+ }
+ }
<Body>{SCOPENAME}/{B}* { // p->func()
addType();
generateClassOrGlobalLink(*g_code,yytext);
@@ -3514,7 +3552,7 @@ void resetCCodeParserState()
}
void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
- bool exBlock, const char *exName,FileDef *fd,
+ SrcLangExt lang,bool exBlock, const char *exName,FileDef *fd,
int startLine,int endLine,bool inlineFragment,
MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx)
{
@@ -3562,11 +3600,13 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
g_sourceFileDef = new FileDef("",(exName?exName:"generated"));
cleanupSourceDef = TRUE;
}
+ g_insideObjC = lang==SrcLangExt_ObjC;
+ g_insideJava = lang==SrcLangExt_Java;
+ g_insideCS = lang==SrcLangExt_CSharp;
+ g_insidePHP = lang==SrcLangExt_PHP;
if (g_sourceFileDef)
{
setCurrentDoc("l00001");
- g_insideObjC = g_sourceFileDef->name().lower().right(2)==".m" ||
- g_sourceFileDef->name().lower().right(3)==".mm";
}
g_currentDefinition = 0;
g_currentMemberDef = 0;