While I am not personally convinced about the usefulness of this
construct, we should break it.
Before:
if (a) label:
f();
After:
if (a)
label:
f();
llvm-svn: 265545
// not labels.
Style.Language != FormatStyle::LK_JavaScript) {
if (FormatTok->Tok.is(tok::colon) && !Line->MustBeDeclaration) {
+ Line->Tokens.begin()->Tok->MustBreakBefore = true;
parseLabel();
return;
}
addUnwrappedLine();
}
Line->Level = OldLineLevel;
+ if (FormatTok->isNot(tok::l_brace))
+ parseStructuralElement();
}
void UnwrappedLineParser::parseCaseLabel() {
" // comment\n"
" f();",
AllowsMergedIf);
+ verifyFormat("{\n"
+ " if (a)\n"
+ " label:\n"
+ " f();\n"
+ "}",
+ AllowsMergedIf);
verifyFormat("if (a)\n"
" ;",
AllowsMergedIf);