@@ -368,7 +368,7 @@ bool ContinuationIndenter::canBreak(const LineState &State) {
368368
369369 // If binary operators are moved to the next line (including commas for some
370370 // styles of constructor initializers), that's always ok.
371- if (! Current.isOneOf (TT_BinaryOperator, tok::comma) &&
371+ if (Current.isNoneOf (TT_BinaryOperator, tok::comma) &&
372372 // Allow breaking opening brace of lambdas (when passed as function
373373 // arguments) to a new line when BeforeLambdaBody brace wrapping is
374374 // enabled.
@@ -445,7 +445,7 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
445445 (!Style.BreakBeforeTernaryOperators &&
446446 Previous.is (TT_ConditionalExpr))) &&
447447 CurrentState.BreakBeforeParameter && !Current.isTrailingComment () &&
448- ! Current.isOneOf (tok::r_paren, tok::r_brace)) {
448+ Current.isNoneOf (tok::r_paren, tok::r_brace)) {
449449 return true ;
450450 }
451451 if (CurrentState.IsChainedConditional &&
@@ -523,9 +523,9 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
523523 if (Style.AlwaysBreakBeforeMultilineStrings &&
524524 (NewLineColumn == State.FirstIndent + Style.ContinuationIndentWidth ||
525525 Previous.is (tok::comma) || Current.NestingLevel < 2 ) &&
526- ! Previous.isOneOf (tok::kw_return, tok::lessless, tok::at,
526+ Previous.isNoneOf (tok::kw_return, tok::lessless, tok::at,
527527 Keywords.kw_dollar ) &&
528- ! Previous.isOneOf (TT_InlineASMColon, TT_ConditionalExpr) &&
528+ Previous.isNoneOf (TT_InlineASMColon, TT_ConditionalExpr) &&
529529 nextIsMultilineString (State)) {
530530 return true ;
531531 }
@@ -648,7 +648,7 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
648648 // into the ColumnLimit, they are checked here in the ContinuationIndenter.
649649 if (Style.ColumnLimit != 0 && Previous.is (BK_Block) &&
650650 Previous.is (tok::l_brace) &&
651- ! Current.isOneOf (tok::r_brace, tok::comment)) {
651+ Current.isNoneOf (tok::r_brace, tok::comment)) {
652652 return true ;
653653 }
654654
@@ -752,7 +752,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
752752 return false ;
753753
754754 const auto *Next = Comma->getNextNonComment ();
755- return Next && ! Next->isOneOf (TT_LambdaLSquare, tok::l_brace, tok::caret);
755+ return Next && Next->isNoneOf (TT_LambdaLSquare, tok::l_brace, tok::caret);
756756 };
757757
758758 if (DisallowLineBreaks ())
@@ -835,15 +835,15 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
835835 return Tok.is (tok::l_brace) && Tok.isNot (BK_Block) &&
836836 Style.Cpp11BracedListStyle ;
837837 };
838- if (! Tok.isOneOf (tok::l_paren, TT_TemplateOpener, tok::l_square) &&
838+ if (Tok.isNoneOf (tok::l_paren, TT_TemplateOpener, tok::l_square) &&
839839 !IsStartOfBracedList ()) {
840840 return false ;
841841 }
842842 if (!Tok.Previous )
843843 return true ;
844844 if (Tok.Previous ->isIf ())
845845 return Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak;
846- return ! Tok.Previous ->isOneOf (TT_CastRParen, tok::kw_for, tok::kw_while,
846+ return Tok.Previous ->isNoneOf (TT_CastRParen, tok::kw_for, tok::kw_while,
847847 tok::kw_switch) &&
848848 !(Style.isJavaScript () && Tok.Previous ->is (Keywords.kw_await ));
849849 };
@@ -882,8 +882,8 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
882882 Tok.isOneOf (tok::ellipsis, Keywords.kw_await ))) {
883883 return true ;
884884 }
885- const auto *Previous = Tok.Previous ;
886- if ( !Previous || (! Previous->isOneOf (TT_FunctionDeclarationLParen,
885+ if ( const auto *Previous = Tok.Previous ;
886+ !Previous || (Previous->isNoneOf (TT_FunctionDeclarationLParen,
887887 TT_LambdaDefinitionLParen) &&
888888 !IsFunctionCallParen (*Previous))) {
889889 return true ;
@@ -920,9 +920,9 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
920920 // align the commas with the opening paren.
921921 if (Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign &&
922922 !CurrentState.IsCSharpGenericTypeConstraint && Previous.opensScope () &&
923- Previous.isNot (TT_ObjCMethodExpr) && Previous. isNot ( TT_RequiresClause) &&
924- Previous. isNot (TT_TableGenDAGArgOpener) &&
925- Previous. isNot ( TT_TableGenDAGArgOpenerToBreak) &&
923+ Previous.isNoneOf (TT_ObjCMethodExpr, TT_RequiresClause,
924+ TT_TableGenDAGArgOpener,
925+ TT_TableGenDAGArgOpenerToBreak) &&
926926 !(Current.MacroParent && Previous.MacroParent ) &&
927927 (Current.isNot (TT_LineComment) ||
928928 Previous.isOneOf (BK_BracedInit, TT_VerilogMultiLineListLParen)) &&
@@ -962,7 +962,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
962962 if (Current.isNot (tok::comment) && P &&
963963 (P->isOneOf (TT_BinaryOperator, tok::comma) ||
964964 (P->is (TT_ConditionalExpr) && P->is (tok::colon))) &&
965- ! P->isOneOf (TT_OverloadedOperator, TT_CtorInitializerComma) &&
965+ P->isNoneOf (TT_OverloadedOperator, TT_CtorInitializerComma) &&
966966 P->getPrecedence () != prec::Assignment &&
967967 P->getPrecedence () != prec::Relational &&
968968 P->getPrecedence () != prec::Spaceship) {
@@ -992,7 +992,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
992992 // parameter, i.e. let nested calls have a continuation indent.
993993 CurrentState.LastSpace = State.Column ;
994994 CurrentState.NestedBlockIndent = State.Column ;
995- } else if (! Current.isOneOf (tok::comment, tok::caret) &&
995+ } else if (Current.isNoneOf (tok::comment, tok::caret) &&
996996 ((Previous.is (tok::comma) &&
997997 Previous.isNot (TT_OverloadedOperator)) ||
998998 (Previous.is (tok::colon) && Previous.is (TT_ObjCMethodExpr)))) {
@@ -1099,7 +1099,7 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State,
10991099 if (Current.isNot (TT_LambdaArrow) &&
11001100 (!Style.isJavaScript () || Current.NestingLevel != 0 ||
11011101 !PreviousNonComment || PreviousNonComment->isNot (tok::equal) ||
1102- ! Current.isOneOf (Keywords.kw_async , Keywords.kw_function ))) {
1102+ Current.isNoneOf (Keywords.kw_async , Keywords.kw_function ))) {
11031103 CurrentState.NestedBlockIndent = State.Column ;
11041104 }
11051105
@@ -1239,11 +1239,11 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State,
12391239 }
12401240
12411241 if (PreviousNonComment &&
1242- ! PreviousNonComment->isOneOf (tok::comma, tok::colon, tok::semi) &&
1242+ PreviousNonComment->isNoneOf (tok::comma, tok::colon, tok::semi) &&
12431243 ((PreviousNonComment->isNot (TT_TemplateCloser) &&
12441244 !PreviousNonComment->ClosesRequiresClause ) ||
12451245 Current.NestingLevel != 0 ) &&
1246- ! PreviousNonComment->isOneOf (
1246+ PreviousNonComment->isNoneOf (
12471247 TT_BinaryOperator, TT_FunctionAnnotationRParen, TT_JavaAnnotation,
12481248 TT_LeadingJavaAnnotation) &&
12491249 Current.isNot (TT_BinaryOperator) && !PreviousNonComment->opensScope () &&
@@ -1281,8 +1281,8 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State,
12811281 bool AllowAllConstructorInitializersOnNextLine =
12821282 Style.PackConstructorInitializers == FormatStyle::PCIS_NextLine ||
12831283 Style.PackConstructorInitializers == FormatStyle::PCIS_NextLineOnly;
1284- if (! (Previous.isOneOf (tok::l_paren, tok::l_brace, TT_BinaryOperator) ||
1285- PreviousIsBreakingCtorInitializerColon) ||
1284+ if ((Previous.isNoneOf (tok::l_paren, tok::l_brace, TT_BinaryOperator) &&
1285+ ! PreviousIsBreakingCtorInitializerColon) ||
12861286 (!Style.AllowAllParametersOfDeclarationOnNextLine &&
12871287 State.Line ->MustBeDeclaration ) ||
12881288 (!Style.AllowAllArgumentsOnNextLine &&
@@ -1576,7 +1576,7 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) {
15761576 if (Previous.is (tok::r_paren) &&
15771577 Previous.isNot (TT_TableGenDAGArgOperatorToBreak) &&
15781578 !Current.isBinaryOperator () &&
1579- ! Current.isOneOf (tok::colon, tok::comment)) {
1579+ Current.isNoneOf (tok::colon, tok::comment)) {
15801580 return ContinuationIndent;
15811581 }
15821582 if (Current.is (TT_ProtoExtensionLSquare))
@@ -1591,7 +1591,7 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) {
15911591 NextNonComment->SpacesRequiredBefore ;
15921592 }
15931593 if (CurrentState.Indent == State.FirstIndent && PreviousNonComment &&
1594- ! PreviousNonComment->isOneOf (tok::r_brace, TT_CtorInitializerComma)) {
1594+ PreviousNonComment->isNoneOf (tok::r_brace, TT_CtorInitializerComma)) {
15951595 // Ensure that we fall back to the continuation indent width instead of
15961596 // just flushing continuations left.
15971597 return CurrentState.Indent + Style.ContinuationIndentWidth ;
@@ -1734,7 +1734,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
17341734 }
17351735 if (Previous && (Previous->isOneOf (TT_BinaryOperator, TT_ConditionalExpr) ||
17361736 (Previous->isOneOf (tok::l_paren, tok::comma, tok::colon) &&
1737- ! Previous->isOneOf (TT_DictLiteral, TT_ObjCMethodExpr,
1737+ Previous->isNoneOf (TT_DictLiteral, TT_ObjCMethodExpr,
17381738 TT_CtorInitializerColon)))) {
17391739 CurrentState.NestedBlockInlined =
17401740 !Newline && hasNestedBlockInlined (Previous, Current, Style);
@@ -1758,7 +1758,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
17581758 State.StartOfStringLiteral = State.Column + 1 ;
17591759 } else if (Current.isStringLiteral () && State.StartOfStringLiteral == 0 ) {
17601760 State.StartOfStringLiteral = State.Column ;
1761- } else if (! Current.isOneOf (tok::comment, tok::identifier, tok::hash) &&
1761+ } else if (Current.isNoneOf (tok::comment, tok::identifier, tok::hash) &&
17621762 !Current.isStringLiteral ()) {
17631763 State.StartOfStringLiteral = 0 ;
17641764 }
@@ -2057,7 +2057,7 @@ void ContinuationIndenter::moveStatePastScopeOpener(LineState &State,
20572057 // array literals as these follow different indentation rules.
20582058 bool NoLineBreak =
20592059 Current.Children .empty () &&
2060- ! Current.isOneOf (TT_DictLiteral, TT_ArrayInitializerLSquare) &&
2060+ Current.isNoneOf (TT_DictLiteral, TT_ArrayInitializerLSquare) &&
20612061 (CurrentState.NoLineBreak || CurrentState.NoLineBreakInOperand ||
20622062 (Current.is (TT_TemplateOpener) &&
20632063 CurrentState.ContainsUnwrappedBuilder ));
0 commit comments