From c1789f2e5d8421d6028c836ab66afecacff284ef Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 23 Feb 2015 20:58:37 +0100 Subject: Bug 742095 - Missing documentation after nested C++11 unified initializer --- src/scanner.l | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/scanner.l b/src/scanner.l index f039306..517557f 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -668,6 +668,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) %x SkipString %x SkipPHPString %x SkipInits +%x SkipC11Inits %x SkipCPP %x SkipCPPBlock %x SkipComment @@ -5008,8 +5009,18 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } {ID}{BN}*"{" { // C++11 style initializer (see bug 688647) lineCount(); + curlyCount=1; + BEGIN(SkipC11Inits); + } +"{" { ++curlyCount; } +"}" { + if ( --curlyCount<=0 ) + { + BEGIN(SkipInits); + } + } "{" { // C++11 style initializer unput('{'); BEGIN( Function ); @@ -5113,7 +5124,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) //addToBody(yytext); BEGIN( SkipCurlyCpp ); } -\n { +\n { lineCount(); //addToBody(yytext); } @@ -5142,22 +5153,22 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) //addToBody(yytext); lineCount(); } -"/*" { +"/*" { //addToBody(yytext); lastCContext = YY_START; BEGIN(SkipComment); } -"//" { +"//" { //addToBody(yytext); lastCContext = YY_START; BEGIN(SkipCxxComment); } -"(" { +"(" { roundCount=0; lastSkipRoundContext=YY_START; BEGIN(SkipRound); } -\" { +\" { lastStringContext=YY_START; BEGIN( SkipString ); } @@ -5192,7 +5203,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) BEGIN(SkipPHPString); } } -. { } +. { } \\. { } \" { BEGIN( lastStringContext ); @@ -5981,7 +5992,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } . { current->program += *yytext ; } -("//"{B}*)?"/*!" { +("//"{B}*)?"/*!" { //printf("Start doc block at %d\n",yyLineNr); removeSlashes=(yytext[1]=='/'); tmpDocType=-1; -- cgit v0.12