File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -897,17 +897,24 @@ static bool isIIFE(const UnwrappedLine &Line,
897
897
898
898
static bool ShouldBreakBeforeBrace (const FormatStyle &Style,
899
899
const FormatToken &InitialToken) {
900
- if (InitialToken.isOneOf (tok::kw_namespace, TT_NamespaceMacro))
900
+ tok::TokenKind Kind = InitialToken.Tok .getKind ();
901
+ if (InitialToken.is (TT_NamespaceMacro))
902
+ Kind = tok::kw_namespace;
903
+
904
+ switch (Kind) {
905
+ case tok::kw_namespace:
901
906
return Style.BraceWrapping .AfterNamespace ;
902
- if (InitialToken. is ( tok::kw_class))
907
+ case tok::kw_class:
903
908
return Style.BraceWrapping .AfterClass ;
904
- if (InitialToken. is ( tok::kw_union))
909
+ case tok::kw_union:
905
910
return Style.BraceWrapping .AfterUnion ;
906
- if (InitialToken. is ( tok::kw_struct))
911
+ case tok::kw_struct:
907
912
return Style.BraceWrapping .AfterStruct ;
908
- if (InitialToken. is ( tok::kw_enum))
913
+ case tok::kw_enum:
909
914
return Style.BraceWrapping .AfterEnum ;
910
- return false ;
915
+ default :
916
+ return false ;
917
+ }
911
918
}
912
919
913
920
void UnwrappedLineParser::parseChildBlock (
You can’t perform that action at this time.
0 commit comments