@@ -1193,26 +1193,22 @@ static bool tokenCanStartNewLine(const FormatToken &Tok) {
1193
1193
// Semicolon can be a null-statement, l_square can be a start of a macro or
1194
1194
// a C++11 attribute, but this doesn't seem to be common.
1195
1195
assert (Tok.isNot (TT_AttributeSquare));
1196
- return Tok.isNot (tok::semi) && Tok.isNot (tok::l_brace) &&
1197
- // Tokens that can only be used as binary operators and a part of
1198
- // overloaded operator names.
1199
- Tok.isNot (tok::period) && Tok.isNot (tok::periodstar) &&
1200
- Tok.isNot (tok::arrow) && Tok.isNot (tok::arrowstar) &&
1201
- Tok.isNot (tok::less) && Tok.isNot (tok::greater) &&
1202
- Tok.isNot (tok::slash) && Tok.isNot (tok::percent) &&
1203
- Tok.isNot (tok::lessless) && Tok.isNot (tok::greatergreater) &&
1204
- Tok.isNot (tok::equal) && Tok.isNot (tok::plusequal) &&
1205
- Tok.isNot (tok::minusequal) && Tok.isNot (tok::starequal) &&
1206
- Tok.isNot (tok::slashequal) && Tok.isNot (tok::percentequal) &&
1207
- Tok.isNot (tok::ampequal) && Tok.isNot (tok::pipeequal) &&
1208
- Tok.isNot (tok::caretequal) && Tok.isNot (tok::greatergreaterequal) &&
1209
- Tok.isNot (tok::lesslessequal) &&
1210
- // Colon is used in labels, base class lists, initializer lists,
1211
- // range-based for loops, ternary operator, but should never be the
1212
- // first token in an unwrapped line.
1213
- Tok.isNot (tok::colon) &&
1214
- // 'noexcept' is a trailing annotation.
1215
- Tok.isNot (tok::kw_noexcept);
1196
+ return !Tok.isOneOf (tok::semi, tok::l_brace,
1197
+ // Tokens that can only be used as binary operators and a
1198
+ // part of overloaded operator names.
1199
+ tok::period, tok::periodstar, tok::arrow, tok::arrowstar,
1200
+ tok::less, tok::greater, tok::slash, tok::percent,
1201
+ tok::lessless, tok::greatergreater, tok::equal,
1202
+ tok::plusequal, tok::minusequal, tok::starequal,
1203
+ tok::slashequal, tok::percentequal, tok::ampequal,
1204
+ tok::pipeequal, tok::caretequal, tok::greatergreaterequal,
1205
+ tok::lesslessequal,
1206
+ // Colon is used in labels, base class lists, initializer
1207
+ // lists, range-based for loops, ternary operator, but
1208
+ // should never be the first token in an unwrapped line.
1209
+ tok::colon,
1210
+ // 'noexcept' is a trailing annotation.
1211
+ tok::kw_noexcept);
1216
1212
}
1217
1213
1218
1214
static bool mustBeJSIdent (const AdditionalKeywords &Keywords,
0 commit comments