================
@@ -3117,9 +3117,16 @@ void UnwrappedLineParser::parseForOrWhileLoop(bool
HasParens) {
FormatTok->setFinalizedType(TT_ConditionLParen);
parseParens();
}
- // Event control.
- if (Style.isVerilog())
+
+ if (Style.isVerilog()) {
+ // Event control.
parseVerilogSensitivityList();
+ } else if (Style.AllowShortLoopsOnASingleLine && FormatTok->is(tok::semi) &&
----------------
owenca wrote:
I didn't use `getPreviousNonComment()` because there are 3 more cases where we
either can't or probably shouldn't merge the semicolon:
1.
```
while (1) //
;
```
2.
```
while (1) /**/
;
```
3.
```
while (1)
/**/ ;
```
Like `while (1) /**/ ;`, case 3 probably doesn't matter in practice.
https://github.com/llvm/llvm-project/pull/70768
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits