[cfe-commits] [PATCH] Make parenthesis counting and aligning a bit saner

Manuel Klimek klimek at google.com
Tue Dec 4 06:49:26 PST 2012


  LG after fixing all the nits


================
Comment at: lib/Format/Format.cpp:148
@@ -151,3 +147,3 @@
 
-  /// Append the next token to \p State.
-  void addToken(bool Newline, bool DryRun, IndentState &State) {
+  /// \brief Append the next token to \p State and updates information
+  /// necessary for indentation.
----------------
Appends

================
Comment at: lib/Format/Format.cpp:160
@@ -156,9 +159,3 @@
     const FormatToken &Previous = Line.Tokens[Index - 1];
-    unsigned ParenLevel = Annotations[Index].ParenLevel;
-
-    if (Current.Tok.is(tok::l_paren) || Current.Tok.is(tok::l_square) ||
-        Annotations[Index].Type == TokenAnnotation::TT_TemplateOpener) {
-      State.Indent.push_back(4 + State.LastSpace.back());
-      State.LastSpace.push_back(State.LastSpace.back());
-    }
+    unsigned ParenLevel = State.Indent.size() - 1;
 
----------------
Much better already...


http://llvm-reviews.chandlerc.com/D162



More information about the cfe-commits mailing list