[cfe-commits] r54851 - in /cfe/trunk: include/clang/Parse/Parser.h lib/Parse/ParseExpr.cpp

Chris Lattner clattner at apple.com
Mon Aug 18 14:22:07 PDT 2008


On Aug 16, 2008, at 1:03 PM, Argiris Kirtzidis wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=54851&view=rev
> Log:
> Put (argument)-expression-list parsing in a separate function so  
> that it can be re-used.

nice.

> +bool Parser::ParseExpressionList(ExprListTy &Exprs, CommaLocsTy  
> &CommaLocs) {
> +  while (1) {
> +    ExprResult Expr = ParseAssignmentExpression();
> +    if (Expr.isInvalid)
> +      return true;
> +    else
> +      Exprs.push_back(Expr.Val);

It's a very minor thing, but please remove the 'else' since the code  
is fallthrough after it.  Something like:

> +    if (Expr.isInvalid)
> +      return true;

> +    Exprs.push_back(Expr.Val);

-Chris


> +
> +    if (Tok.isNot(tok::comma))
> +      return false;
> +    // Move to the next argument, remember where the comma was.
> +    CommaLocs.push_back(ConsumeToken());
> +  }
> +}
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list