Lines Matching refs:Right

2715   const FormatToken &Right = Tok;  in splitPenalty()  local
2721 if (Right.isOneOf(Keywords.kw_extends, Keywords.kw_throws)) in splitPenalty()
2723 if (Right.is(Keywords.kw_implements)) in splitPenalty()
2728 if (Right.is(Keywords.kw_function) && Left.isNot(tok::comma)) in splitPenalty()
2733 (Right.is(TT_TemplateString) && Right.TokenText.startswith("}"))) in splitPenalty()
2736 if (Left.opensScope() && Right.closesScope()) in splitPenalty()
2740 if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral)) in splitPenalty()
2742 if (Right.is(tok::l_square)) { in splitPenalty()
2748 if (Right.is(TT_LambdaLSquare) && Left.is(tok::equal)) in splitPenalty()
2750 if (!Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare, in splitPenalty()
2757 (Right.is(tok::period) && Style.Language == FormatStyle::LK_Proto)) in splitPenalty()
2759 if (Right.isOneOf(TT_StartOfName, TT_FunctionDeclarationName) || in splitPenalty()
2760 Right.is(tok::kw_operator)) { in splitPenalty()
2761 if (Line.startsWith(tok::kw_for) && Right.PartOfMultiVariableDeclStmt) in splitPenalty()
2765 if (InFunctionDecl && Right.NestingLevel == 0) in splitPenalty()
2769 if (Right.is(TT_PointerOrReference)) in splitPenalty()
2771 if (Right.is(TT_LambdaArrow)) in splitPenalty()
2773 if (Left.is(tok::equal) && Right.is(tok::l_brace)) in splitPenalty()
2786 if (Right.isMemberAccess()) { in splitPenalty()
2806 return !Right.NextOperator || !Right.NextOperator->Previous->closesScope() in splitPenalty()
2811 if (Right.is(TT_TrailingAnnotation) && in splitPenalty()
2812 (!Right.Next || Right.Next->isNot(tok::l_paren))) { in splitPenalty()
2822 bool is_short_annotation = Right.TokenText.size() < 10; in splitPenalty()
2832 if (Right.is(TT_SelectorName)) in splitPenalty()
2852 if (Right.is(tok::r_brace)) in splitPenalty()
2877 if (Right.is(tok::plus) && Left.isLabelString() && in splitPenalty()
2878 (Right.NextOperator || Right.OperatorIndex != 0)) in splitPenalty()
2882 if (Right.is(tok::lessless) && Left.isLabelString() && in splitPenalty()
2883 (Right.NextOperator || Right.OperatorIndex != 1)) in splitPenalty()
2885 if (Right.is(tok::lessless)) { in splitPenalty()
2887 if (!Left.is(tok::r_paren) || Right.OperatorIndex > 0) in splitPenalty()
2898 Level = Right.getPrecedence(); in splitPenalty()
2907 bool TokenAnnotator::spaceRequiredBeforeParens(const FormatToken &Right) const { in spaceRequiredBeforeParens()
2910 Right.ParameterCount > 0); in spaceRequiredBeforeParens()
2915 const FormatToken &Right) { in spaceRequiredBetween() argument
2916 if (Left.is(tok::kw_return) && Right.isNot(tok::semi)) in spaceRequiredBetween()
2918 if (Style.isJson() && Left.is(tok::string_literal) && Right.is(tok::colon)) in spaceRequiredBetween()
2925 if (Right.is(tok::hashhash)) in spaceRequiredBetween()
2928 return Right.is(tok::hash); in spaceRequiredBetween()
2929 if ((Left.is(tok::l_paren) && Right.is(tok::r_paren)) || in spaceRequiredBetween()
2931 Right.is(tok::r_brace) && Right.isNot(BK_Block))) in spaceRequiredBetween()
2937 if (Right.is(tok::r_paren) && Right.MatchingParen && in spaceRequiredBetween()
2938 Right.MatchingParen->Previous && in spaceRequiredBetween()
2939 isKeywordWithCondition(*Right.MatchingParen->Previous)) in spaceRequiredBetween()
2944 if (Right.is(tok::l_paren) && Left.is(tok::kw_requires)) in spaceRequiredBetween()
2945 return spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
2947 if (Left.is(TT_ConstraintJunctions) && Right.is(tok::identifier)) in spaceRequiredBetween()
2950 if (Left.is(tok::l_paren) || Right.is(tok::r_paren)) in spaceRequiredBetween()
2951 return (Right.is(TT_CastRParen) || in spaceRequiredBetween()
2955 if (Right.isOneOf(tok::semi, tok::comma)) in spaceRequiredBetween()
2957 if (Right.is(tok::less) && Line.Type == LT_ObjCDecl) { in spaceRequiredBetween()
2958 bool IsLightweightGeneric = Right.MatchingParen && in spaceRequiredBetween()
2959 Right.MatchingParen->Next && in spaceRequiredBetween()
2960 Right.MatchingParen->Next->is(tok::colon); in spaceRequiredBetween()
2963 if (Right.is(tok::less) && Left.is(tok::kw_template)) in spaceRequiredBetween()
2968 Right.isOneOf(tok::identifier, tok::string_literal, tok::char_constant, in spaceRequiredBetween()
2976 if (Left.is(tok::less) || Right.isOneOf(tok::greater, tok::less)) { in spaceRequiredBetween()
2979 (Left.is(TT_DictLiteral) || Right.is(TT_DictLiteral)))) { in spaceRequiredBetween()
2981 if (Left.is(tok::less) && Right.is(tok::greater)) in spaceRequiredBetween()
2987 if (Right.is(tok::ellipsis)) in spaceRequiredBetween()
2990 if (Left.is(tok::l_square) && Right.is(tok::amp)) in spaceRequiredBetween()
2992 if (Right.is(TT_PointerOrReference)) { in spaceRequiredBetween()
3011 (getTokenPointerOrReferenceAlignment(Right) != FormatStyle::PAS_Left || in spaceRequiredBetween()
3016 if (Right.is(TT_FunctionTypeLParen) && Left.isNot(tok::l_paren) && in spaceRequiredBetween()
3026 Right.canBePointerOrReferenceQualifier()) in spaceRequiredBetween()
3028 return Right.Tok.isLiteral() || Right.is(TT_BlockComment) || in spaceRequiredBetween()
3029 (Right.isOneOf(Keywords.kw_override, Keywords.kw_final) && in spaceRequiredBetween()
3030 !Right.is(TT_StartOfName)) || in spaceRequiredBetween()
3031 (Right.is(tok::l_brace) && Right.is(BK_Block)) || in spaceRequiredBetween()
3032 (!Right.isOneOf(TT_PointerOrReference, TT_ArraySubscriptLSquare, in spaceRequiredBetween()
3046 if (Right.is(tok::star) && Left.is(tok::l_paren)) in spaceRequiredBetween()
3048 if (Left.is(tok::star) && Right.isOneOf(tok::star, tok::amp, tok::ampamp)) in spaceRequiredBetween()
3050 if (Right.isOneOf(tok::star, tok::amp, tok::ampamp)) { in spaceRequiredBetween()
3099 return (Left.is(TT_ArrayInitializerLSquare) && Right.isNot(tok::r_square) && in spaceRequiredBetween()
3103 Style.SpacesInSquareBrackets && Right.isNot(tok::r_square)); in spaceRequiredBetween()
3104 if (Right.is(tok::r_square)) in spaceRequiredBetween()
3105 return Right.MatchingParen && in spaceRequiredBetween()
3106 ((Right.MatchingParen->is(TT_ArrayInitializerLSquare) && in spaceRequiredBetween()
3107 SpaceRequiredForArrayInitializerLSquare(*Right.MatchingParen, in spaceRequiredBetween()
3110 Right.MatchingParen->isOneOf(TT_ArraySubscriptLSquare, in spaceRequiredBetween()
3113 Right.MatchingParen->is(TT_AttributeParen)); in spaceRequiredBetween()
3114 if (Right.is(tok::l_square) && in spaceRequiredBetween()
3115 !Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare, in spaceRequiredBetween()
3120 Right.is(TT_ArraySubscriptLSquare))) in spaceRequiredBetween()
3122 if (Left.is(tok::l_brace) && Right.is(tok::r_brace)) in spaceRequiredBetween()
3125 (Right.is(tok::r_brace) && Right.MatchingParen && in spaceRequiredBetween()
3126 Right.MatchingParen->isNot(BK_Block))) in spaceRequiredBetween()
3135 if (Left.is(TT_TemplateCloser) && Right.is(TT_AttributeSquare)) in spaceRequiredBetween()
3137 if (Right.is(tok::l_paren)) { in spaceRequiredBetween()
3158 (spaceRequiredBeforeParens(Right) && in spaceRequiredBetween()
3165 if (Left.is(tok::at) && Right.Tok.getObjCKeywordID() != tok::objc_not_keyword) in spaceRequiredBetween()
3167 if (Right.is(TT_UnaryOperator)) in spaceRequiredBetween()
3173 Right.is(tok::l_brace) && Right.getNextNonComment() && in spaceRequiredBetween()
3174 Right.isNot(BK_Block)) in spaceRequiredBetween()
3176 if (Left.is(tok::period) || Right.is(tok::period)) in spaceRequiredBetween()
3178 if (Right.is(tok::hash) && Left.is(tok::identifier) && Left.TokenText == "L") in spaceRequiredBetween()
3188 if (Left.is(TT_TemplateCloser) && Right.is(tok::l_square)) in spaceRequiredBetween()
3193 if (Right.is(tok::r_brace) && Right.MatchingParen && in spaceRequiredBetween()
3194 Right.MatchingParen->endsSequence(TT_DictLiteral, tok::at)) in spaceRequiredBetween()
3197 if (Right.getType() == TT_TrailingAnnotation && in spaceRequiredBetween()
3198 Right.isOneOf(tok::amp, tok::ampamp) && in spaceRequiredBetween()
3200 (!Right.Next || Right.Next->is(tok::semi))) in spaceRequiredBetween()
3204 return getTokenReferenceAlignment(Right) != FormatStyle::PAS_Left; in spaceRequiredBetween()
3209 const FormatToken &Right) { in spaceRequiredBefore() argument
3210 const FormatToken &Left = *Right.Previous; in spaceRequiredBefore()
3211 auto HasExistingWhitespace = [&Right]() { in spaceRequiredBefore()
3212 return Right.WhitespaceRange.getBegin() != Right.WhitespaceRange.getEnd(); in spaceRequiredBefore()
3214 if (Right.Tok.getIdentifierInfo() && Left.Tok.getIdentifierInfo()) in spaceRequiredBefore()
3218 return Right.is(tok::coloncolon); in spaceRequiredBefore()
3219 if (Right.is(tok::l_brace) && Right.is(BK_BracedInit) && in spaceRequiredBefore()
3224 if (Right.is(tok::period) && in spaceRequiredBefore()
3228 if (Right.is(tok::l_paren) && in spaceRequiredBefore()
3231 if (Right.isOneOf(tok::l_brace, tok::less) && Left.is(TT_SelectorName)) in spaceRequiredBefore()
3234 if (Left.is(tok::slash) || Right.is(tok::slash)) in spaceRequiredBefore()
3238 Right.isOneOf(tok::l_brace, tok::less)) in spaceRequiredBefore()
3245 if (Left.is(tok::numeric_constant) && Right.is(tok::percent)) in spaceRequiredBefore()
3248 if (Right.is(tok::colon)) in spaceRequiredBefore()
3256 if (Left.is(tok::kw_this) && Right.is(tok::l_square)) in spaceRequiredBefore()
3260 if (Left.is(tok::kw_new) && Right.is(tok::l_paren)) in spaceRequiredBefore()
3264 if (Right.is(tok::l_brace)) in spaceRequiredBefore()
3268 if (Left.is(tok::l_brace) && Right.isNot(tok::r_brace)) in spaceRequiredBefore()
3271 if (Left.isNot(tok::l_brace) && Right.is(tok::r_brace)) in spaceRequiredBefore()
3275 if (Left.is(TT_FatArrow) || Right.is(TT_FatArrow)) in spaceRequiredBefore()
3279 if (Left.is(TT_AttributeColon) || Right.is(TT_AttributeColon)) in spaceRequiredBefore()
3283 if (Left.is(TT_TemplateCloser) && Right.is(TT_StartOfName)) in spaceRequiredBefore()
3287 if (Left.is(tok::l_square) || Right.is(tok::r_square)) in spaceRequiredBefore()
3291 if (Right.is(TT_CSharpNullable)) in spaceRequiredBefore()
3295 if (Right.is(TT_NonNullAssertion)) in spaceRequiredBefore()
3299 if (Left.is(tok::comma) && Right.is(tok::comma)) in spaceRequiredBefore()
3303 if (Left.is(Keywords.kw_var) && Right.is(tok::l_paren)) in spaceRequiredBefore()
3307 if (Right.is(tok::l_paren)) in spaceRequiredBefore()
3311 spaceRequiredBeforeParens(Right); in spaceRequiredBefore()
3320 Right.is(tok::l_paren)) in spaceRequiredBefore()
3326 if (Right.is(tok::l_paren) && Left.is(Keywords.kw_await) && Left.Previous && in spaceRequiredBefore()
3329 if (Left.is(Keywords.kw_async) && Right.is(tok::l_paren) && in spaceRequiredBefore()
3330 Right.MatchingParen) { in spaceRequiredBefore()
3331 const FormatToken *Next = Right.MatchingParen->getNextNonComment(); in spaceRequiredBefore()
3338 (Right.is(TT_TemplateString) && Right.TokenText.startswith("}"))) in spaceRequiredBefore()
3344 Right.is(TT_TemplateString)) in spaceRequiredBefore()
3346 if (Right.is(tok::star) && in spaceRequiredBefore()
3349 if (Right.isOneOf(tok::l_brace, tok::l_square) && in spaceRequiredBefore()
3353 if (Right.is(tok::l_paren)) { in spaceRequiredBefore()
3382 Left.Previous->is(tok::period) && Right.is(tok::l_paren)) in spaceRequiredBefore()
3385 Right.isOneOf(tok::l_square, tok::l_brace, tok::l_paren)) in spaceRequiredBefore()
3390 if (Left.is(Keywords.kw_is) && Right.is(tok::l_brace)) in spaceRequiredBefore()
3392 if (Right.isOneOf(TT_JsTypeColon, TT_JsTypeOptionalQuestion)) in spaceRequiredBefore()
3394 if (Left.is(TT_JsTypeOperator) || Right.is(TT_JsTypeOperator)) in spaceRequiredBefore()
3396 if ((Left.is(tok::l_brace) || Right.is(tok::r_brace)) && in spaceRequiredBefore()
3402 !Right.isOneOf(tok::equal, tok::l_brace, tok::comma, tok::l_square, in spaceRequiredBefore()
3408 if (Right.is(TT_NonNullAssertion)) in spaceRequiredBefore()
3411 Right.isOneOf(Keywords.kw_as, Keywords.kw_in)) in spaceRequiredBefore()
3414 if (Left.is(tok::r_square) && Right.is(tok::l_brace)) in spaceRequiredBefore()
3416 if (Left.is(Keywords.kw_synchronized) && Right.is(tok::l_paren)) in spaceRequiredBefore()
3422 Right.is(TT_TemplateOpener)) in spaceRequiredBefore()
3430 if (Left.is(tok::r_paren) && canBeObjCSelectorComponent(Right)) in spaceRequiredBefore()
3437 (Right.is(tok::equal) || Left.is(tok::equal))) in spaceRequiredBefore()
3440 if (Right.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow) || in spaceRequiredBefore()
3443 if (Right.is(TT_OverloadedOperatorLParen)) in spaceRequiredBefore()
3444 return spaceRequiredBeforeParens(Right); in spaceRequiredBefore()
3447 if (Right.is(tok::comma)) in spaceRequiredBefore()
3449 if (Right.is(TT_ObjCBlockLParen)) in spaceRequiredBefore()
3451 if (Right.is(TT_CtorInitializerColon)) in spaceRequiredBefore()
3453 if (Right.is(TT_InheritanceColon) && !Style.SpaceBeforeInheritanceColon) in spaceRequiredBefore()
3455 if (Right.is(TT_RangeBasedForLoopColon) && in spaceRequiredBefore()
3461 if (Right.is(tok::colon)) { in spaceRequiredBefore()
3464 if (!Right.getNextNonComment() || Right.getNextNonComment()->is(tok::semi)) in spaceRequiredBefore()
3466 if (Right.is(TT_ObjCMethodExpr)) in spaceRequiredBefore()
3470 if (Right.is(TT_InlineASMColon) && Left.is(tok::coloncolon)) in spaceRequiredBefore()
3472 if (Right.is(TT_DictLiteral)) in spaceRequiredBefore()
3474 if (Right.is(TT_AttributeColon)) in spaceRequiredBefore()
3476 if (Right.is(TT_CSharpNamedArgumentColon)) in spaceRequiredBefore()
3478 if (Right.is(TT_BitFieldColon)) in spaceRequiredBefore()
3485 Right.isOneOf(tok::minus, tok::minusminus)) || in spaceRequiredBefore()
3487 Right.isOneOf(tok::plus, tok::plusplus))) in spaceRequiredBefore()
3490 if (!Right.is(tok::l_paren)) { in spaceRequiredBefore()
3500 if (Left.is(tok::amp) && Right.is(tok::r_square)) in spaceRequiredBefore()
3504 Right.is(TT_BinaryOperator); in spaceRequiredBefore()
3511 Right.isOneOf(TT_BinaryOperator, TT_SelectorName); in spaceRequiredBefore()
3521 if (Left.is(tok::greater) && Right.is(tok::greater)) { in spaceRequiredBefore()
3525 return Right.is(TT_TemplateCloser) && Left.is(TT_TemplateCloser) && in spaceRequiredBefore()
3529 if (Right.isOneOf(tok::arrow, tok::arrowstar, tok::periodstar) || in spaceRequiredBefore()
3531 (Right.is(tok::period) && Right.isNot(TT_DesignatedInitializerPeriod))) in spaceRequiredBefore()
3534 Right.getPrecedence() == prec::Assignment) in spaceRequiredBefore()
3536 if (Style.Language == FormatStyle::LK_Java && Right.is(tok::coloncolon) && in spaceRequiredBefore()
3539 if (Right.is(tok::coloncolon) && Left.is(tok::identifier)) in spaceRequiredBefore()
3544 if (Right.is(tok::coloncolon) && in spaceRequiredBefore()
3554 if ((Left.is(TT_TemplateOpener)) != (Right.is(TT_TemplateCloser))) in spaceRequiredBefore()
3557 if (Right.is(TT_StructuredBindingLSquare)) in spaceRequiredBefore()
3561 if (Right.Next && Right.Next->is(TT_StructuredBindingLSquare) && in spaceRequiredBefore()
3562 Right.isOneOf(tok::amp, tok::ampamp)) in spaceRequiredBefore()
3563 return getTokenReferenceAlignment(Right) != FormatStyle::PAS_Left; in spaceRequiredBefore()
3564 if ((Right.is(TT_BinaryOperator) && !Left.is(tok::l_paren)) || in spaceRequiredBefore()
3566 !Right.is(tok::r_paren))) in spaceRequiredBefore()
3568 if (Left.is(TT_TemplateCloser) && Right.is(tok::l_paren) && in spaceRequiredBefore()
3569 Right.isNot(TT_FunctionTypeLParen)) in spaceRequiredBefore()
3570 return spaceRequiredBeforeParens(Right); in spaceRequiredBefore()
3571 if (Right.is(TT_TemplateOpener) && Left.is(tok::r_paren) && in spaceRequiredBefore()
3574 if (Right.is(tok::less) && Left.isNot(tok::l_paren) && in spaceRequiredBefore()
3577 if (Right.is(TT_TrailingUnaryOperator)) in spaceRequiredBefore()
3581 return spaceRequiredBetween(Line, Left, Right); in spaceRequiredBefore()
3608 const FormatToken &Right) { in mustBreakBefore() argument
3609 const FormatToken &Left = *Right.Previous; in mustBreakBefore()
3610 if (Right.NewlinesBefore > 1 && Style.MaxEmptyLinesToKeep > 0) in mustBreakBefore()
3614 if (Right.is(TT_CSharpNamedArgumentColon) || in mustBreakBefore()
3617 if (Right.is(TT_CSharpGenericTypeConstraint)) in mustBreakBefore()
3622 (Right.isAccessSpecifier(/*ColonRequired=*/false) || in mustBreakBefore()
3623 Right.is(Keywords.kw_internal))) in mustBreakBefore()
3626 if (Left.is(TT_AttributeSquare) && Right.is(TT_AttributeSquare) && in mustBreakBefore()
3627 Left.is(tok::r_square) && Right.is(tok::l_square)) in mustBreakBefore()
3632 if (Right.is(tok::string_literal) && Left.is(tok::plus) && Left.Previous && in mustBreakBefore()
3653 if (Right.is(tok::r_brace) && Left.is(tok::l_brace) && Left.Previous && in mustBreakBefore()
3672 if (Right.is(tok::r_brace) && Left.is(tok::l_brace) && in mustBreakBefore()
3681 if (Right.is(tok::plus) && Left.is(tok::string_literal) && Right.Next && in mustBreakBefore()
3682 Right.Next->is(tok::string_literal)) in mustBreakBefore()
3689 if (Left.isStringLiteral() && Right.isStringLiteral()) in mustBreakBefore()
3704 !Right.is(tok::r_square)) in mustBreakBefore()
3724 else if (Right.MatchingParen && in mustBreakBefore()
3725 (Right.MatchingParen->isOneOf(tok::l_brace, in mustBreakBefore()
3728 Right.MatchingParen->is(tok::l_paren)))) in mustBreakBefore()
3735 if (Right.is(tok::comment)) in mustBreakBefore()
3737 (Right.NewlinesBefore > 0 && Right.HasUnescapedNewline); in mustBreakBefore()
3740 if (Right.Previous->IsUnterminatedLiteral) in mustBreakBefore()
3742 if (Right.is(tok::lessless) && Right.Next && in mustBreakBefore()
3743 Right.Previous->is(tok::string_literal) && in mustBreakBefore()
3744 Right.Next->is(tok::string_literal)) in mustBreakBefore()
3747 if (Right.Previous->ClosesTemplateDeclaration && in mustBreakBefore()
3748 Right.Previous->MatchingParen && in mustBreakBefore()
3749 Right.Previous->MatchingParen->NestingLevel == 0) { in mustBreakBefore()
3753 if (Right.is(tok::kw_concept)) in mustBreakBefore()
3757 if (Right.is(TT_CtorInitializerComma) && in mustBreakBefore()
3761 if (Right.is(TT_CtorInitializerColon) && in mustBreakBefore()
3767 Right.is(TT_InheritanceComma)) in mustBreakBefore()
3772 if (Right.is(tok::string_literal) && Right.TokenText.startswith("R\"")) in mustBreakBefore()
3776 return Right.IsMultiline && Right.NewlinesBefore > 0; in mustBreakBefore()
3777 if ((Right.Previous->is(tok::l_brace) || in mustBreakBefore()
3778 (Right.Previous->is(tok::less) && Right.Previous->Previous && in mustBreakBefore()
3779 Right.Previous->Previous->is(tok::equal))) && in mustBreakBefore()
3780 Right.NestingLevel == 1 && Style.Language == FormatStyle::LK_Proto) { in mustBreakBefore()
3785 if (Right.is(TT_InlineASMBrace)) in mustBreakBefore()
3786 return Right.HasUnescapedNewline; in mustBreakBefore()
3788 if (isAllmanBrace(Left) || isAllmanBrace(Right)) in mustBreakBefore()
3810 if (Style.BraceWrapping.BeforeLambdaBody && Right.is(TT_LambdaLBrace) && in mustBreakBefore()
3819 Right.isNot(TT_LeadingJavaAnnotation) && Right.isNot(tok::l_paren) && in mustBreakBefore()
3823 if (Right.is(TT_ProtoExtensionLSquare)) in mustBreakBefore()
3855 Right.is(TT_SelectorName) && !Right.is(tok::r_square) && Right.Next) { in mustBreakBefore()
3858 if (Right.Previous && Right.Previous->is(tok::at)) in mustBreakBefore()
3864 FormatToken *LBrace = Right.Next; in mustBreakBefore()
3917 !Right.isOneOf(tok::l_paren, TT_LambdaLSquare)) { in mustBreakBefore()
3939 const FormatToken &Right) { in canBreakBefore() argument
3940 const FormatToken &Left = *Right.Previous; in canBreakBefore()
3944 Right.isOneOf(TT_CSharpNamedArgumentColon, TT_AttributeColon)) in canBreakBefore()
3950 if (Right.is(TT_CSharpNullable)) { in canBreakBefore()
3957 if (Right.isOneOf(Keywords.kw_throws, Keywords.kw_extends, in canBreakBefore()
3961 const FormatToken *NonComment = Right.getPreviousNonComment(); in canBreakBefore()
3970 if (Right.NestingLevel == 0 && in canBreakBefore()
3973 Right.isOneOf(tok::l_square, tok::l_paren)) in canBreakBefore()
3978 if (Left.is(TT_FatArrow) && Right.is(tok::l_brace)) in canBreakBefore()
3983 if (Left.is(tok::exclaim) && Right.is(tok::colon)) in canBreakBefore()
3988 if (Right.is(Keywords.kw_is)) { in canBreakBefore()
3989 const FormatToken *Next = Right.getNextNonComment(); in canBreakBefore()
4002 if (Right.is(Keywords.kw_in)) in canBreakBefore()
4004 if (Right.is(Keywords.kw_as)) in canBreakBefore()
4006 if (Right.isOneOf(Keywords.kw_extends, Keywords.kw_infer)) { in canBreakBefore()
4017 Right.isOneOf(Keywords.kw_module, tok::kw_namespace, in canBreakBefore()
4025 Right.isOneOf(tok::identifier, tok::string_literal)) in canBreakBefore()
4027 if (Right.is(TT_TemplateString) && Right.closesScope()) in canBreakBefore()
4031 if (Left.is(tok::identifier) && Right.is(TT_TemplateString)) { in canBreakBefore()
4043 return !Right.is(tok::l_paren); in canBreakBefore()
4044 if (Right.is(TT_PointerOrReference)) in canBreakBefore()
4046 (getTokenPointerOrReferenceAlignment(Right) == in canBreakBefore()
4048 (!Right.Next || Right.Next->isNot(TT_FunctionDeclarationName))); in canBreakBefore()
4049 if (Right.isOneOf(TT_StartOfName, TT_FunctionDeclarationName) || in canBreakBefore()
4050 Right.is(tok::kw_operator)) in canBreakBefore()
4054 if (Right.isTrailingComment()) in canBreakBefore()
4063 if (Left.is(tok::question) && Right.is(tok::colon)) in canBreakBefore()
4065 if (Right.is(TT_ConditionalExpr) || Right.is(tok::question)) in canBreakBefore()
4071 if (Right.is(TT_InheritanceColon)) in canBreakBefore()
4073 if (Right.is(TT_ObjCMethodExpr) && !Right.is(tok::r_square) && in canBreakBefore()
4077 if (Right.is(tok::colon) && in canBreakBefore()
4078 !Right.isOneOf(TT_CtorInitializerColon, TT_InlineASMColon)) in canBreakBefore()
4083 if (!Style.AlwaysBreakBeforeMultilineStrings && Right.isStringLiteral()) in canBreakBefore()
4109 if (((Right.is(tok::l_brace) || Right.is(tok::less)) && in canBreakBefore()
4110 Right.is(TT_DictLiteral)) || in canBreakBefore()
4111 Right.is(TT_ArrayInitializerLSquare)) in canBreakBefore()
4116 if (Right.is(tok::r_square) && Right.MatchingParen && in canBreakBefore()
4117 Right.MatchingParen->is(TT_ProtoExtensionLSquare)) in canBreakBefore()
4119 if (Right.is(TT_SelectorName) || (Right.is(tok::identifier) && Right.Next && in canBreakBefore()
4120 Right.Next->is(TT_ObjCMethodExpr))) in canBreakBefore()
4126 if (Right.isOneOf(TT_RangeBasedForLoopColon, TT_OverloadedOperatorLParen, in canBreakBefore()
4131 if (Right.is(TT_RangeBasedForLoopColon)) in canBreakBefore()
4133 if (Left.is(TT_TemplateCloser) && Right.is(TT_TemplateOpener)) in canBreakBefore()
4138 if (Left.is(tok::equal) && !Right.isOneOf(tok::kw_default, tok::kw_delete) && in canBreakBefore()
4141 if (Left.is(tok::equal) && Right.is(tok::l_brace) && in canBreakBefore()
4150 if (Right.is(TT_ImplicitStringLiteral)) in canBreakBefore()
4153 if (Right.is(tok::r_paren) || Right.is(TT_TemplateCloser)) in canBreakBefore()
4155 if (Right.is(tok::r_square) && Right.MatchingParen && in canBreakBefore()
4156 Right.MatchingParen->is(TT_LambdaLSquare)) in canBreakBefore()
4161 if (Right.is(tok::r_brace)) in canBreakBefore()
4162 return Right.MatchingParen && Right.MatchingParen->is(BK_Block); in canBreakBefore()
4167 return !Right.isOneOf(tok::l_brace, tok::semi, tok::equal, tok::l_paren, in canBreakBefore()
4170 if (Right.is(tok::kw___attribute) || in canBreakBefore()
4171 (Right.is(tok::l_square) && Right.is(TT_AttributeSquare))) in canBreakBefore()
4174 if (Left.is(tok::identifier) && Right.is(tok::string_literal)) in canBreakBefore()
4177 if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral)) in canBreakBefore()
4182 if (Right.is(TT_CtorInitializerColon)) in canBreakBefore()
4187 if (Right.is(TT_CtorInitializerComma) && in canBreakBefore()
4193 if (Right.is(TT_InheritanceComma) && in canBreakBefore()
4196 if ((Left.is(tok::greater) && Right.is(tok::greater)) || in canBreakBefore()
4197 (Left.is(tok::less) && Right.is(tok::less))) in canBreakBefore()
4199 if (Right.is(TT_BinaryOperator) && in canBreakBefore()
4202 Right.getPrecedence() != prec::Assignment)) in canBreakBefore()
4206 if (Right.is(tok::kw_typename) && Left.isNot(tok::kw_const)) in canBreakBefore()
4214 if ((Left.is(TT_AttributeSquare) && Right.is(tok::l_square)) || in canBreakBefore()
4215 (Left.is(tok::r_square) && Right.is(TT_AttributeSquare))) in canBreakBefore()
4219 if (Style.BraceWrapping.BeforeLambdaBody && Right.is(TT_LambdaLBrace)) { in canBreakBefore()
4222 if (isAllmanLambdaBrace(Right)) in canBreakBefore()
4223 return !isItAnEmptyLambdaAllowed(Right, ShortLambdaOption); in canBreakBefore()
4228 Right.isMemberAccess() || in canBreakBefore()
4229 Right.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow, tok::lessless, in canBreakBefore()
4232 Right.isOneOf(tok::identifier, tok::kw_const)) || in canBreakBefore()
4233 (Left.is(tok::l_paren) && !Right.is(tok::r_paren)) || in canBreakBefore()
4234 (Left.is(TT_TemplateOpener) && !Right.is(TT_TemplateCloser)); in canBreakBefore()