Before:
#define OPERATION_CASE(name) \
case OP_name: \
return operations::Operation##name
After:
#define OPERATION_CASE(name) \
case OP_name: \
return operations::Operation##name
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189743
91177308-0d34-0410-b5e6-
96231b3b80d8
break;
case tok::kw_default:
case tok::kw_case:
- if (!SwitchLabelEncountered)
- Line->Level += Style.IndentCaseLabels;
+ if (!SwitchLabelEncountered &&
+ (Style.IndentCaseLabels || (Line->InPPDirective && Line->Level == 1)))
+ ++Line->Level;
SwitchLabelEncountered = true;
parseStructuralElement();
break;
}
void UnwrappedLineParser::parseLabel() {
- if (FormatTok->Tok.isNot(tok::colon))
- return;
nextToken();
unsigned OldLineLevel = Line->Level;
if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0))
" case a: \\\n"
" foo = b; \\\n"
" }", getLLVMStyleWithColumns(20));
+ verifyFormat("#define OPERATION_CASE(name) \\\n"
+ " case OP_name: \\\n"
+ " return operations::Operation##name\n",
+ getLLVMStyleWithColumns(40));
verifyGoogleFormat("switch (x) {\n"
" case 1:\n"