Improve nextArgument by returning 0 if there's an unexpected ';'.

This commit is contained in:
Edoardo Prezioso 2011-10-28 18:57:10 +02:00
parent ef8f49bbf3
commit 979f3b051c
1 changed files with 4 additions and 4 deletions

View File

@ -710,13 +710,13 @@ const Token* Token::nextArgument() const
{ {
for (const Token* tok = this; tok; tok = tok->next()) { for (const Token* tok = this; tok; tok = tok->next()) {
if (tok->str() == ",") if (tok->str() == ",")
return(tok->next()); return tok->next();
else if (tok->str() == "(" || tok->str() == "{" || tok->str() == "[") else if (tok->str() == "(" || tok->str() == "{" || tok->str() == "[")
tok = tok->link(); tok = tok->link();
else if (tok->str() == ")") else if (tok->str() == ")" || tok->str() == ";")
return(0); return 0;
} }
return(0); return 0;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------