[PATCH] D94500: Rework Whitesmiths mode to use line-level values in UnwrappedLineParser

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 19 23:31:15 PST 2021


HazardyKnusperkeks added a comment.

Is there a test with indentation within a namespace? If not maybe you should add one.



================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:613
+  // settings. This allows the format to back up one level in those cases.
+  if (!AddLevel && NamespaceBlock &&
+      Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths)
----------------
Maybe give `!AddLevel && Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths` a name? You check it three times.


================
Comment at: clang/lib/Format/UnwrappedLineParser.h:146
+  // when resetting the line state.
+  enum LineLevel { LL_Remove, LL_Keep };
+
----------------
I would prefer an enum class.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94500



More information about the cfe-commits mailing list