[cfe-commits] r173077 - /cfe/trunk/lib/Format/Format.cpp

Nico Weber nicolasweber at gmx.de
Mon Jan 21 11:29:31 PST 2013


Author: nico
Date: Mon Jan 21 13:29:31 2013
New Revision: 173077

URL: http://llvm.org/viewvc/llvm-project?rev=173077&view=rev
Log:
Formatter: Rename LSquare to Left to make parseSquare() more consistent with the other paren parsing methods.

Modified:
    cfe/trunk/lib/Format/Format.cpp

Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=173077&r1=173076&r2=173077&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Mon Jan 21 13:29:31 2013
@@ -937,19 +937,17 @@
       // A '[' could be an index subscript (after an indentifier or after
       // ')' or ']'), or it could be the start of an Objective-C method
       // expression.
-      AnnotatedToken *LSquare = CurrentToken->Parent;
+      AnnotatedToken *Left = CurrentToken->Parent;
       bool StartsObjCMethodExpr =
-          !LSquare->Parent || LSquare->Parent->is(tok::colon) ||
-          LSquare->Parent->is(tok::l_square) ||
-          LSquare->Parent->is(tok::l_paren) ||
-          LSquare->Parent->is(tok::kw_return) ||
-          LSquare->Parent->is(tok::kw_throw) ||
-          getBinOpPrecedence(LSquare->Parent->FormatTok.Tok.getKind(),
+          !Left->Parent || Left->Parent->is(tok::colon) ||
+          Left->Parent->is(tok::l_square) || Left->Parent->is(tok::l_paren) ||
+          Left->Parent->is(tok::kw_return) || Left->Parent->is(tok::kw_throw) ||
+          getBinOpPrecedence(Left->Parent->FormatTok.Tok.getKind(),
                              true, true) > prec::Unknown;
 
       ObjCSelectorRAII objCSelector(*this);
       if (StartsObjCMethodExpr)
-        objCSelector.markStart(*LSquare);
+        objCSelector.markStart(*Left);
 
       while (CurrentToken != NULL) {
         if (CurrentToken->is(tok::r_square)) {





More information about the cfe-commits mailing list