summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-06-15 14:30:15 (GMT)
committerGitHub <noreply@github.com>2019-06-15 14:30:15 (GMT)
commitb44b9cddb75dbe5b9a212d3bfc6a6216b62174d4 (patch)
tree3583b8a209968da0c8591bfd2d263c988a7dc189
parentcbd012b39f00f664665f057a5750d7e10e1b5fb1 (diff)
parent8a2b1dd98f6d1dd2ed08beda3a654827a0ad821b (diff)
downloadDoxygen-b44b9cddb75dbe5b9a212d3bfc6a6216b62174d4.zip
Doxygen-b44b9cddb75dbe5b9a212d3bfc6a6216b62174d4.tar.gz
Doxygen-b44b9cddb75dbe5b9a212d3bfc6a6216b62174d4.tar.bz2
Merge pull request #7052 from InsertCreativityHere/master
issue #6860 - Incorrect parsing of optional class fields in Slices
-rw-r--r--src/scanner.l29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/scanner.l b/src/scanner.l
index e36b36d..42058d8 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -78,6 +78,7 @@ static int lastHereDocContext;
static int lastDefineContext;
static int lastAlignAsContext;
static int lastC11AttributeContext;
+static int lastModifierContext;
static Protection protection;
static Protection baseProt;
static int sharpCount = 0 ;
@@ -766,6 +767,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
/** Slice states */
+%x SliceOptional
%x SliceMetadata
%x SliceSequence
%x SliceSequenceName
@@ -2439,6 +2441,19 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
current->type+=yytext;
BEGIN(DeclType);
}
+ else if (insideSlice && qstrcmp(yytext,"optional")==0)
+ {
+ if (current->type.isEmpty())
+ {
+ current->type = "optional";
+ }
+ else
+ {
+ current->type += " optional";
+ }
+ lastModifierContext = YY_START;
+ BEGIN(SliceOptional);
+ }
else
{
if (YY_START==FindMembers)
@@ -3593,6 +3608,20 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
BEGIN (lastSquareContext);
}
}
+<SliceOptional>"(" {
+ current->type += "(";
+ roundCount++;
+ }
+<SliceOptional>[0-9]+ {
+ current->type += yytext;
+ }
+<SliceOptional>")" {
+ current->type += ")";
+ if(--roundCount<=0)
+ {
+ BEGIN (lastModifierContext);
+ }
+ }
<IDLAttribute>"]" {
// end of IDL function attribute
if (--squareCount<=0)