summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-12-22 18:31:45 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-12-22 18:31:45 (GMT)
commitc65daff57d905a2b89bde059e7ccf5ed26584116 (patch)
tree4bea4f05a79984be9ae0be6a18b138221f16998e
parent48096bb6c5d7a2879327c82cc0144eef8e6d8ac8 (diff)
downloadDoxygen-c65daff57d905a2b89bde059e7ccf5ed26584116.zip
Doxygen-c65daff57d905a2b89bde059e7ccf5ed26584116.tar.gz
Doxygen-c65daff57d905a2b89bde059e7ccf5ed26584116.tar.bz2
Fixed more issues handling Java nested generic classes
-rw-r--r--src/doxygen.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 95d8465..de1546f 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -4216,6 +4216,32 @@ static int findEndOfTemplate(const QCString &s,int startPos)
return brCount==0 ? e : -1;
}
+static int findTemplateSpecializationPosition(const char *name)
+{
+ if (name==0 || name[0]=='\0') return 0;
+ int l = strlen(name);
+ if (name[l-1]=='>') // search backward to find the matching <, allowing nested <...> and strings.
+ {
+ int count=1;
+ int i=l-2;
+ char insideQuote=0;
+ while (count>0 && i>=0)
+ {
+ char c = name[i--];
+ switch (c)
+ {
+ case '>': if (!insideQuote) count++; break;
+ case '<': if (!insideQuote) count--; break;
+ case '\'': if (!insideQuote) insideQuote=c; else if (i<0 || name[i]!='\\') insideQuote=0; break;
+ case '"': if (!insideQuote) insideQuote=c; else if (i<0 || name[i]!='\\') insideQuote=0; break;
+ default: break;
+ }
+ }
+ if (i>=0) l=i+1;
+ }
+ return l;
+}
+
static bool findClassRelation(
const Entry *root,
Definition *context,
@@ -4307,8 +4333,8 @@ static bool findClassRelation(
qPrint(templSpec)
);
- int i=baseClassName.findRev('<');
- int si=baseClassName.findRev("::",i==-1 ? baseClassName.length() : i);
+ int i=findTemplateSpecializationPosition(baseClassName);
+ int si=baseClassName.findRev("::",i);
if (si==-1) si=0;
if (baseClass==0 && i!=-1)
// base class has template specifiers