summaryrefslogtreecommitdiffstats
path: root/src/declinfo.l
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/declinfo.l
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/declinfo.l')
-rw-r--r--src/declinfo.l15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/declinfo.l b/src/declinfo.l
index a91f832..6c28099 100644
--- a/src/declinfo.l
+++ b/src/declinfo.l
@@ -30,6 +30,7 @@
#include "declinfo.h"
#include "util.h"
#include "message.h"
+#include "types.h"
#define YY_NO_INPUT 1
#define YY_NO_UNISTD_H 1
@@ -53,6 +54,7 @@ static bool classTempListFound;
static bool funcTempListFound;
static QCString exceptionString;
static bool insideObjC;
+static bool insidePHP;
static void addType()
{
@@ -132,6 +134,14 @@ ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+)
name += yytext;
}
}
+<Start>([~!]{B}*)?{ID}{B}*"["{B}*"]" { // PHP
+ if (!insidePHP)
+ {
+ REJECT;
+ }
+ addTypeName();
+ name += yytext;
+ }
<Start>([~!]{B}*)?{ID}/({B}*"["{B}*"]")* { // the []'s are for Java,
// the / was add to deal with multi-
// dimensional C++ arrays like A[][15]
@@ -230,7 +240,7 @@ ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+)
/*@ ----------------------------------------------------------------------------
*/
-void parseFuncDecl(const QCString &decl,bool objC,QCString &cl,QCString &t,
+void parseFuncDecl(const QCString &decl,const SrcLangExt lang,QCString &cl,QCString &t,
QCString &n,QCString &a,QCString &ftl,QCString &exc)
{
printlex(yy_flex_debug, TRUE, __FILE__, NULL);
@@ -240,7 +250,8 @@ void parseFuncDecl(const QCString &decl,bool objC,QCString &cl,QCString &t,
inputPosition = 0;
classTempListFound = FALSE;
funcTempListFound = FALSE;
- insideObjC = objC;
+ insideObjC = lang==SrcLangExt_ObjC;
+ insidePHP = lang==SrcLangExt_PHP;
scope.resize(0);
className.resize(0);
classTempList.resize(0);