[PATCH] D44609: [Clang-Format] New option BeforeLambdaBody to manage lambda line break inside function parameter call (in Allman style)

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 25 01:10:53 PDT 2019


MyDeveloperDay added a comment.

Thanks for the patch, so sorry its taking a long time, its patches like this why I'm about to make a phabricator project for #clang-format alone so that we can ensure all clang-format patches can be see in isolation.

I think we need to get this patches rebased to the current trunk and then take a final look. if you are still interested, I'll be happy to review it.



================
Comment at: lib/Format/ContinuationIndenter.cpp:1179
+                       Current.is(TT_LambdaLSquare))));
   }
 
----------------
oh boy... I have to say.. that I don't like these kinds of massive if statements without some sort of comment.. as to what it's doing, it's so hard, later on, to read through the various clauses and understand which bit of functionality this section covers


================
Comment at: lib/Format/Format.cpp:651
     Expanded.BraceWrapping = {true, true, true, true, true, true, true, true,
                               true, true, true, true, true, true, true, true};
     break;
----------------
if we are adding new options to BraceWrapping structure wouldn't these structures need to change too or wouldn't it potentially become unintialized


================
Comment at: lib/Format/TokenAnnotator.cpp:2920
+
+// Returns 'true' if 'Tok' is an function argument.
+static bool IsFunctionArgument(const FormatToken &Tok) {
----------------
I really like this style of pulling out the clauses into separate functions because it helps to describe what its doing without the need for a comment at all.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D44609/new/

https://reviews.llvm.org/D44609





More information about the cfe-commits mailing list