Permalink
Browse files

Bug 759281 - Doxygen parser confused by C++11 attributes

  • Loading branch information...
Dimitri van Heesch
Dimitri van Heesch committed Dec 13, 2015
1 parent 692544f commit 6c005b1e9458430a77bfeba6d08deed4778ad71d
Showing with 18 additions and 7 deletions.
  1. +18 −7 src/scanner.l
View
@@ -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)

0 comments on commit 6c005b1

Please sign in to comment.