[PATCH] Again macros without trailing semicolons: don't care about declaration context.

Manuel Klimek klimek at google.com
Tue Apr 9 07:17:03 PDT 2013



================
Comment at: lib/Format/UnwrappedLineParser.cpp:266
@@ +265,3 @@
+         Tok.isNot(tok::l_square) &&
+                               // dereferencing operators
+         Tok.isNot(tok::period) && Tok.isNot(tok::periodstar) &&
----------------
Those comments don't help me at all...

================
Comment at: lib/Format/UnwrappedLineParser.cpp:263
@@ -262,1 +262,3 @@
 
+bool tokenCanStartNewLine(clang::Token Tok) {
+  return Tok.isNot(tok::semi) && Tok.isNot(tok::l_brace) &&
----------------
I'd like a comment that explains what kind of stuff we're looking for here, for example explaining that if() etc probably starts a new line.

================
Comment at: lib/Format/UnwrappedLineParser.cpp:279
@@ +278,3 @@
+                               // unary operators
+         Tok.isNot(tok::plusplus) && Tok.isNot(tok::minusminus) &&
+         Tok.isNot(tok::colon) // initializer lists
----------------
Those look like they can actually start a new line.

================
Comment at: lib/Format/UnwrappedLineParser.cpp:270
@@ +269,3 @@
+         // iostream operators
+         Tok.isNot(tok::lessless) && Tok.isNot(tok::greatergreater) &&
+         // assignments
----------------
I don't see tests for those...


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



More information about the cfe-commits mailing list