summaryrefslogtreecommitdiffstats
path: root/src/docparser.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-02-15 14:27:14 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-02-15 14:27:14 (GMT)
commit1c25efff32ab9b8032b032f5e2374f77b09354eb (patch)
tree7066c23246e8882da51b5a4d4a05e0fbfd8eaa89 /src/docparser.cpp
parent9a05fda1c0aef229252d133987f866e0f6718eb0 (diff)
downloadDoxygen-1c25efff32ab9b8032b032f5e2374f77b09354eb.zip
Doxygen-1c25efff32ab9b8032b032f5e2374f77b09354eb.tar.gz
Doxygen-1c25efff32ab9b8032b032f5e2374f77b09354eb.tar.bz2
issue #6831 Failure to recognize class array with PHP in @var
There are 2 different situations here: - @var, here a special change is necessary to check and handle whether or not we are in PHP (declinfo.*, doxygen.cpp) - @param - the type recognition for the PHP type has to be extended with the `[]` possibility and subsequently the `[]` part has to be handled separately from the 'datatype' (doctokinizer.l, docparser.*). - In the output we now can have multiple text strings resulting in a small change in handling of the separator between the data type (*docvisitor.*)
Diffstat (limited to 'src/docparser.cpp')
-rw-r--r--src/docparser.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp
index bcf4bac..4db4dd7 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -1229,16 +1229,32 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor
static void handleParameterType(DocNode *parent,QList<DocNode> &children,const QCString &paramTypes)
{
+ static QRegExp re("[ \t\r\n\\[\\]]");
QCString name = g_token->name;
- int p=0,i;
+ QCString name1;
+ int p=0,i,l,ii;
while ((i=paramTypes.find('|',p))!=-1)
{
- g_token->name = paramTypes.mid(p,i-p);
+ name1 = paramTypes.mid(p,i-p);
+ ii=re.match(name1,0,&l);
+ if (ii != -1)
+ g_token->name=name1.mid(0,ii);
+ else
+ g_token->name=name1;
handleLinkedWord(parent,children);
+ if (ii != -1) children.append(new DocWord(parent,name1.mid(ii).data()));
p=i+1;
+ children.append(new DocSeparator(parent,"|"));
}
- g_token->name = paramTypes.mid(p);
+ name1 = paramTypes.mid(p);
+ ii=re.match(name1,0,&l);
+ if (ii != -1)
+ g_token->name=name1.mid(0,ii);
+ else
+ g_token->name=name1;
handleLinkedWord(parent,children);
+ if (ii != -1) children.append(new DocWord(parent,name1.mid(ii).data()));
+
g_token->name = name;
}