@@ -430,11 +430,11 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
430430 return true ;
431431 }
432432
433- if (Current.is (TT_ObjCMethodExpr) && ! Previous.is (TT_SelectorName) &&
433+ if (Current.is (TT_ObjCMethodExpr) && Previous.isNot (TT_SelectorName) &&
434434 State.Line ->startsWith (TT_ObjCMethodSpecifier)) {
435435 return true ;
436436 }
437- if (Current.is (TT_SelectorName) && ! Previous.is (tok::at) &&
437+ if (Current.is (TT_SelectorName) && Previous.isNot (tok::at) &&
438438 CurrentState.ObjCSelectorNameFound && CurrentState.BreakBeforeParameter &&
439439 (Style.ObjCBreakBeforeNestedBlockParam ||
440440 !Current.startsSequence (TT_SelectorName, tok::colon, tok::caret))) {
@@ -469,7 +469,7 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
469469 return true ;
470470 }
471471
472- if (! State.Line ->First ->is (tok::kw_enum) && State.Column <= NewLineColumn)
472+ if (State.Line ->First ->isNot (tok::kw_enum) && State.Column <= NewLineColumn)
473473 return false ;
474474
475475 if (Style.AlwaysBreakBeforeMultilineStrings &&
@@ -578,8 +578,8 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
578578 // Don't always break between a JavaScript `function` and the function
579579 // name.
580580 !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 ) {
583583 return true ;
584584 }
585585
@@ -815,7 +815,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
815815 // Exclude relational operators, as there, it is always more desirable to
816816 // have the LHS 'left' of the RHS.
817817 const FormatToken *P = Current.getPreviousNonComment ();
818- if (! Current.is (tok::comment) && P &&
818+ if (Current.isNot (tok::comment) && P &&
819819 (P->isOneOf (TT_BinaryOperator, tok::comma) ||
820820 (P->is (TT_ConditionalExpr) && P->is (tok::colon))) &&
821821 !P->isOneOf (TT_OverloadedOperator, TT_CtorInitializerComma) &&
@@ -830,8 +830,8 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
830830 // Don't do this if there are only two operands. In these cases, there is
831831 // always a nice vertical separation between them and the extra line break
832832 // 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);
835835 if ((!BreakBeforeOperator &&
836836 !(HasTwoOperands &&
837837 Style.AlignOperands != FormatStyle::OAS_DontAlign)) ||
@@ -850,7 +850,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
850850 CurrentState.NestedBlockIndent = State.Column ;
851851 } else if (!Current.isOneOf (tok::comment, tok::caret) &&
852852 ((Previous.is (tok::comma) &&
853- ! Previous.is (TT_OverloadedOperator)) ||
853+ Previous.isNot (TT_OverloadedOperator)) ||
854854 (Previous.is (tok::colon) && Previous.is (TT_ObjCMethodExpr)))) {
855855 CurrentState.LastSpace = State.Column ;
856856 } else if (Previous.is (TT_CtorInitializerColon) &&
@@ -952,9 +952,9 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State,
952952 //
953953 // is common and should be formatted like a free-standing function. The same
954954 // goes for wrapping before the lambda return type arrow.
955- if (! Current.is (TT_LambdaArrow) &&
955+ if (Current.isNot (TT_LambdaArrow) &&
956956 (!Style.isJavaScript () || Current.NestingLevel != 0 ||
957- !PreviousNonComment || ! PreviousNonComment->is (tok::equal) ||
957+ !PreviousNonComment || PreviousNonComment->isNot (tok::equal) ||
958958 !Current.isOneOf (Keywords.kw_async , Keywords.kw_function ))) {
959959 CurrentState.NestedBlockIndent = State.Column ;
960960 }
@@ -1418,7 +1418,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
14181418 if (Current.is (TT_BinaryOperator) && Current.isNot (tok::lessless))
14191419 CurrentState.LastOperatorWrapped = Newline;
14201420 if (Current.is (TT_ConditionalExpr) && Current.Previous &&
1421- ! Current.Previous ->is (TT_ConditionalExpr)) {
1421+ Current.Previous ->isNot (TT_ConditionalExpr)) {
14221422 CurrentState.LastOperatorWrapped = Newline;
14231423 }
14241424 if (Current.is (TT_ArraySubscriptLSquare) &&
@@ -1447,7 +1447,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
14471447 CurrentState.QuestionColumn = State.Column ;
14481448 }
14491449 if (!Current.opensScope () && !Current.closesScope () &&
1450- ! Current.is (TT_PointerOrReference)) {
1450+ Current.isNot (TT_PointerOrReference)) {
14511451 State.LowestLevelOnLine =
14521452 std::min (State.LowestLevelOnLine , Current.NestingLevel );
14531453 }
@@ -1511,7 +1511,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
15111511 // }, a, b, c);
15121512 if (Current.isNot (tok::comment) && !Current.ClosesRequiresClause &&
15131513 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 &&
15151515 !CurrentState.HasMultipleNestedBlocks ) {
15161516 if (State.Stack [State.Stack .size () - 2 ].NestedBlockInlined && Newline)
15171517 for (ParenState &PState : llvm::drop_end (State.Stack ))
@@ -1641,7 +1641,8 @@ void ContinuationIndenter::moveStatePastFakeLParens(LineState &State,
16411641 // ParameterToInnerFunction));
16421642 if (PrecedenceLevel > prec::Unknown)
16431643 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) &&
16451646 Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign) {
16461647 NewParenState.StartOfFunctionCall = State.Column ;
16471648 }
@@ -2146,7 +2147,7 @@ unsigned ContinuationIndenter::handleEndOfLine(const FormatToken &Current,
21462147static StringRef getEnclosingFunctionName (const FormatToken &Current) {
21472148 // Look for: 'function(' or 'function<templates>(' before Current.
21482149 auto Tok = Current.getPreviousNonComment ();
2149- if (!Tok || ! Tok->is (tok::l_paren))
2150+ if (!Tok || Tok->isNot (tok::l_paren))
21502151 return " " ;
21512152 Tok = Tok->getPreviousNonComment ();
21522153 if (!Tok)
@@ -2156,7 +2157,7 @@ static StringRef getEnclosingFunctionName(const FormatToken &Current) {
21562157 if (Tok)
21572158 Tok = Tok->getPreviousNonComment ();
21582159 }
2159- if (!Tok || ! Tok->is (tok::identifier))
2160+ if (!Tok || Tok->isNot (tok::identifier))
21602161 return " " ;
21612162 return Tok->TokenText ;
21622163}
0 commit comments