================
@@ -805,6 +805,11 @@ FormatToken *UnwrappedLineParser::parseBlock(bool 
MustBeDeclaration,
   if (AddLevels > 0u && Style.BreakBeforeBraces != FormatStyle::BS_Whitesmiths)
     Line->Level += AddLevels;
 
+  // One level has already been added for Whitesmiths at this point,
+  // this adds the second level if needed
----------------
jwobser wrote:

Thanks for suggesting the ternary. I initially resisted combining the logic to 
avoid a nested if. 

The Whitesmiths special casing actually only adds a single level , see Lines 
768-771. 
```cpp
  // For Whitesmiths mode, jump to the next level prior to skipping over the
  // braces.
  if (!VerilogHierarchy && AddLevels > 0 && Whitesmiths)
    ++Line->Level;
```

I cleaned up the comment to not make assumptions about AddLevels.

https://github.com/llvm/llvm-project/pull/182432
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to