[clang] [clang-format] Merge case alignment into AlignTokens (PR #187811)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 21 02:08:46 PDT 2026
================
@@ -473,10 +478,14 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
// When RightJustify and ACS.PadOperators are true, operators in each block to
// be aligned will be padded on the left to the same length before aligning.
//
-// The simple check will not look at the indentaion and nesting level to recurse
-// into the line for alignment. It will also not count the commas. This is e.g.
-// for aligning macro definitions.
-template <typename F, bool SimpleCheck = false>
+// For the Macro or CaseX strategy we will not look at the indentaion and
+// nesting level to recurse into the line for alignment. We will also not count
+// the commas.
+//
+// The CaseX strategies also have some special handling, because we need to be
+// able align empty cases (rsp. use the position to push out other case bodies),
+// but stop on non short cases, which needs a bit of lookahead.
+template <typename F, AlignStrategy Strategy = AlignStrategy::Normal>
----------------
owenca wrote:
```suggestion
template <typename F>
```
https://github.com/llvm/llvm-project/pull/187811
More information about the cfe-commits
mailing list