summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2015-12-13 12:11:51 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2015-12-13 12:11:51 (GMT)
commit6c005b1e9458430a77bfeba6d08deed4778ad71d (patch)
tree96e2cfa3fde1a260e84371cfc55ca8c3753a5d23
parent692544fb47407a3f2c5a5a5e4b80185428adda25 (diff)
downloadDoxygen-6c005b1e9458430a77bfeba6d08deed4778ad71d.zip
Doxygen-6c005b1e9458430a77bfeba6d08deed4778ad71d.tar.gz
Doxygen-6c005b1e9458430a77bfeba6d08deed4778ad71d.tar.bz2
Bug 759281 - Doxygen parser confused by C++11 attributes
-rw-r--r--src/scanner.l25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/scanner.l b/src/scanner.l
index 819ee4a..e468b8f 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -75,6 +75,7 @@ static int lastCSConstraint;
static int lastHereDocContext;
static int lastDefineContext;
static int lastAlignAsContext;
+static int lastC11AttributeContext;
static Protection protection;
static Protection baseProt;
static int sharpCount = 0 ;
@@ -668,6 +669,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
%x SkipPHPString
%x SkipInits
%x SkipC11Inits
+%x SkipC11Attribute
%x SkipCPP
%x SkipCPPBlock
%x SkipComment
@@ -5024,6 +5026,9 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
BEGIN(SkipInits);
}
}
+<SkipC11Attribute>"]]" {
+ BEGIN(lastC11AttributeContext);
+ }
<SkipInits>"{" { // C++11 style initializer
unput('{');
BEGIN( Function );
@@ -5127,7 +5132,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
//addToBody(yytext);
BEGIN( SkipCurlyCpp );
}
-<SkipCurly,SkipC11Inits,SkipInits>\n {
+<SkipCurly,SkipC11Inits,SkipInits,SkipC11Attribute>\n {
lineCount();
//addToBody(yytext);
}
@@ -5156,22 +5161,22 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
//addToBody(yytext);
lineCount();
}
-<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp>"/*" {
+<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>"/*" {
//addToBody(yytext);
lastCContext = YY_START;
BEGIN(SkipComment);
}
-<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp>"//" {
+<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>"//" {
//addToBody(yytext);
lastCContext = YY_START;
BEGIN(SkipCxxComment);
}
-<SkipInits,SkipC11Inits>"(" {
+<SkipInits,SkipC11Inits,SkipC11Attribute>"(" {
roundCount=0;
lastSkipRoundContext=YY_START;
BEGIN(SkipRound);
}
-<SkipInits,SkipC11Inits>\" {
+<SkipInits,SkipC11Inits,SkipC11Attribute>\" {
lastStringContext=YY_START;
BEGIN( SkipString );
}
@@ -5206,7 +5211,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
BEGIN(SkipPHPString);
}
}
-<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp>. { }
+<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>. { }
<SkipString,SkipPHPString>\\. { }
<SkipString>\" {
BEGIN( lastStringContext );
@@ -6001,7 +6006,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<Comment>. { current->program += *yytext ; }
-<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,Bases,OldStyleArgs>("//"{B}*)?"/*!" {
+<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,SkipC11Attribute,Bases,OldStyleArgs>("//"{B}*)?"/*!" {
//printf("Start doc block at %d\n",yyLineNr);
removeSlashes=(yytext[1]=='/');
tmpDocType=-1;
@@ -6530,6 +6535,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
BEGIN( lastCContext ) ;
}
<SkipComment>[^\*\n]+
+
+"[[" { // C++11 attribute
+ lastC11AttributeContext = YY_START;
+ BEGIN( SkipC11Attribute );
+ }
+
<*>\n { lineCount(); }
<*>\" {
if (insideIDL && insideCppQuote)