diff options
-rw-r--r-- | src/scanner.l | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/scanner.l b/src/scanner.l index e56f151..5aa7e53 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -4583,13 +4583,29 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) lineCount(yyscanner); yyextra->current->argList.setTrailingReturnType(" -> "); yyextra->current->args += " -> "; + yyextra->roundCount=0; BEGIN(TrailingReturn); } <TrailingReturn>[{;] { + if (yyextra->roundCount!= 0) REJECT; unput(*yytext); BEGIN(FuncQual); } <TrailingReturn>. { + if (*yytext == '(') yyextra->roundCount++; + else if (*yytext == ')') + { + if (yyextra->roundCount) + { + yyextra->roundCount--; + } + else + { + warn(yyextra->yyFileName,yyextra->yyLineNr, + "Found ')' without opening '(' for '%s)...'", + yyextra->current->argList.trailingReturnType().data()); + } + } yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext); yyextra->current->args+=yytext; } |