@@ -430,11 +430,11 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
430
430
return true ;
431
431
}
432
432
433
- if (Current.is (TT_ObjCMethodExpr) && ! Previous.is (TT_SelectorName) &&
433
+ if (Current.is (TT_ObjCMethodExpr) && Previous.isNot (TT_SelectorName) &&
434
434
State.Line ->startsWith (TT_ObjCMethodSpecifier)) {
435
435
return true ;
436
436
}
437
- if (Current.is (TT_SelectorName) && ! Previous.is (tok::at) &&
437
+ if (Current.is (TT_SelectorName) && Previous.isNot (tok::at) &&
438
438
CurrentState.ObjCSelectorNameFound && CurrentState.BreakBeforeParameter &&
439
439
(Style .ObjCBreakBeforeNestedBlockParam ||
440
440
!Current.startsSequence (TT_SelectorName, tok::colon, tok::caret))) {
@@ -469,7 +469,7 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
469
469
return true ;
470
470
}
471
471
472
- if (! State.Line ->First ->is (tok::kw_enum) && State.Column <= NewLineColumn)
472
+ if (State.Line ->First ->isNot (tok::kw_enum) && State.Column <= NewLineColumn)
473
473
return false ;
474
474
475
475
if (Style .AlwaysBreakBeforeMultilineStrings &&
@@ -578,8 +578,8 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
578
578
// Don't always break between a JavaScript `function` and the function
579
579
// name.
580
580
!Style .isJavaScript ()) ||
581
- (Current.is (tok::kw_operator) && ! Previous.is (tok::coloncolon))) &&
582
- ! Previous.is (tok::kw_template) && CurrentState.BreakBeforeParameter ) {
581
+ (Current.is (tok::kw_operator) && Previous.isNot (tok::coloncolon))) &&
582
+ Previous.isNot (tok::kw_template) && CurrentState.BreakBeforeParameter ) {
583
583
return true ;
584
584
}
585
585
@@ -815,7 +815,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
815
815
// Exclude relational operators, as there, it is always more desirable to
816
816
// have the LHS 'left' of the RHS.
817
817
const FormatToken *P = Current.getPreviousNonComment ();
818
- if (! Current.is (tok::comment) && P &&
818
+ if (Current.isNot (tok::comment) && P &&
819
819
(P->isOneOf (TT_BinaryOperator, tok::comma) ||
820
820
(P->is (TT_ConditionalExpr) && P->is (tok::colon))) &&
821
821
!P->isOneOf (TT_OverloadedOperator, TT_CtorInitializerComma) &&
@@ -830,8 +830,8 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
830
830
// Don't do this if there are only two operands. In these cases, there is
831
831
// always a nice vertical separation between them and the extra line break
832
832
// does not help.
833
- bool HasTwoOperands =
834
- P-> OperatorIndex == 0 && !P-> NextOperator && ! P->is (TT_ConditionalExpr);
833
+ bool HasTwoOperands = P-> OperatorIndex == 0 && !P-> NextOperator &&
834
+ P->isNot (TT_ConditionalExpr);
835
835
if ((!BreakBeforeOperator &&
836
836
!(HasTwoOperands &&
837
837
Style .AlignOperands != FormatStyle::OAS_DontAlign)) ||
@@ -850,7 +850,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
850
850
CurrentState.NestedBlockIndent = State.Column ;
851
851
} else if (!Current.isOneOf (tok::comment, tok::caret) &&
852
852
((Previous.is (tok::comma) &&
853
- ! Previous.is (TT_OverloadedOperator)) ||
853
+ Previous.isNot (TT_OverloadedOperator)) ||
854
854
(Previous.is (tok::colon) && Previous.is (TT_ObjCMethodExpr)))) {
855
855
CurrentState.LastSpace = State.Column ;
856
856
} else if (Previous.is (TT_CtorInitializerColon) &&
@@ -952,9 +952,9 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State,
952
952
//
953
953
// is common and should be formatted like a free-standing function. The same
954
954
// goes for wrapping before the lambda return type arrow.
955
- if (! Current.is (TT_LambdaArrow) &&
955
+ if (Current.isNot (TT_LambdaArrow) &&
956
956
(!Style .isJavaScript () || Current.NestingLevel != 0 ||
957
- !PreviousNonComment || ! PreviousNonComment->is (tok::equal) ||
957
+ !PreviousNonComment || PreviousNonComment->isNot (tok::equal) ||
958
958
!Current.isOneOf (Keywords.kw_async , Keywords.kw_function ))) {
959
959
CurrentState.NestedBlockIndent = State.Column ;
960
960
}
@@ -1418,7 +1418,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
1418
1418
if (Current.is (TT_BinaryOperator) && Current.isNot (tok::lessless))
1419
1419
CurrentState.LastOperatorWrapped = Newline;
1420
1420
if (Current.is (TT_ConditionalExpr) && Current.Previous &&
1421
- ! Current.Previous ->is (TT_ConditionalExpr)) {
1421
+ Current.Previous ->isNot (TT_ConditionalExpr)) {
1422
1422
CurrentState.LastOperatorWrapped = Newline;
1423
1423
}
1424
1424
if (Current.is (TT_ArraySubscriptLSquare) &&
@@ -1447,7 +1447,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
1447
1447
CurrentState.QuestionColumn = State.Column ;
1448
1448
}
1449
1449
if (!Current.opensScope () && !Current.closesScope () &&
1450
- ! Current.is (TT_PointerOrReference)) {
1450
+ Current.isNot (TT_PointerOrReference)) {
1451
1451
State.LowestLevelOnLine =
1452
1452
std::min (State.LowestLevelOnLine , Current.NestingLevel );
1453
1453
}
@@ -1511,7 +1511,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
1511
1511
// }, a, b, c);
1512
1512
if (Current.isNot (tok::comment) && !Current.ClosesRequiresClause &&
1513
1513
Previous && Previous->isOneOf (tok::l_brace, TT_ArrayInitializerLSquare) &&
1514
- ! Previous->is (TT_DictLiteral) && State.Stack .size () > 1 &&
1514
+ Previous->isNot (TT_DictLiteral) && State.Stack .size () > 1 &&
1515
1515
!CurrentState.HasMultipleNestedBlocks ) {
1516
1516
if (State.Stack [State.Stack .size () - 2 ].NestedBlockInlined && Newline)
1517
1517
for (ParenState &PState : llvm::drop_end (State.Stack ))
@@ -1641,7 +1641,8 @@ void ContinuationIndenter::moveStatePastFakeLParens(LineState &State,
1641
1641
// ParameterToInnerFunction));
1642
1642
if (PrecedenceLevel > prec::Unknown)
1643
1643
NewParenState.LastSpace = std::max (NewParenState.LastSpace , State.Column );
1644
- if (PrecedenceLevel != prec::Conditional && !Current.is (TT_UnaryOperator) &&
1644
+ if (PrecedenceLevel != prec::Conditional &&
1645
+ Current.isNot (TT_UnaryOperator) &&
1645
1646
Style .AlignAfterOpenBracket != FormatStyle::BAS_DontAlign) {
1646
1647
NewParenState.StartOfFunctionCall = State.Column ;
1647
1648
}
@@ -2146,7 +2147,7 @@ unsigned ContinuationIndenter::handleEndOfLine(const FormatToken &Current,
2146
2147
static StringRef getEnclosingFunctionName (const FormatToken &Current) {
2147
2148
// Look for: 'function(' or 'function<templates>(' before Current.
2148
2149
auto Tok = Current.getPreviousNonComment ();
2149
- if (!Tok || ! Tok->is (tok::l_paren))
2150
+ if (!Tok || Tok->isNot (tok::l_paren))
2150
2151
return " " ;
2151
2152
Tok = Tok->getPreviousNonComment ();
2152
2153
if (!Tok)
@@ -2156,7 +2157,7 @@ static StringRef getEnclosingFunctionName(const FormatToken &Current) {
2156
2157
if (Tok)
2157
2158
Tok = Tok->getPreviousNonComment ();
2158
2159
}
2159
- if (!Tok || ! Tok->is (tok::identifier))
2160
+ if (!Tok || Tok->isNot (tok::identifier))
2160
2161
return " " ;
2161
2162
return Tok->TokenText ;
2162
2163
}
0 commit comments