summaryrefslogtreecommitdiffstats
path: root/src/scanner.l
diff options
context:
space:
mode:
authorAustin Henriksen <austin.r.henriksen79@gmail.com>2019-06-12 14:52:16 (GMT)
committerAustin Henriksen <austin.r.henriksen79@gmail.com>2019-06-12 14:52:16 (GMT)
commit8a2b1dd98f6d1dd2ed08beda3a654827a0ad821b (patch)
tree629a6a8b6f2b55818bf79ef53383dc5886aff30c /src/scanner.l
parent527fa741a67b9bc34ef315ff0ff6f96bae726497 (diff)
downloadDoxygen-8a2b1dd98f6d1dd2ed08beda3a654827a0ad821b.zip
Doxygen-8a2b1dd98f6d1dd2ed08beda3a654827a0ad821b.tar.gz
Doxygen-8a2b1dd98f6d1dd2ed08beda3a654827a0ad821b.tar.bz2
Fixes #6860.
Diffstat (limited to 'src/scanner.l')
-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)