djasper added inline comments.

================
Comment at: lib/Format/Format.cpp:1821
@@ +1820,3 @@
+      if (Line->Affected)
+        checkConstructorInitList(*Line);
+    }
----------------
Why are we restricting this to constructor initializers? I think we should 
directly be more generic and clean up different lists. Also, as an idea? Could 
we make this very generic and implement a function that analyzes a line for a 
specific sequence of tokens? E.g., I would assume that then the current 
checkConstructorInitList() could be written as:

  cleanupLeft(tok::comma, tok::comma);
  cleanupLeft(tok::comma, tok::l_brace);
  cleanupRight(tok::colon, tok::comma);
  cleanupLeft(tok::colon, tok::l_brace);

With cleanupLeft/Right meaning: Find this sequence of tokens (ignoring 
comments) and then clean up the left or the right side.

Not sure about the exact names of functions etc. What do you think?


http://reviews.llvm.org/D19804



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to