Lines Matching refs:Right
3036 const FormatToken &Right = Tok; in splitPenalty() local
3042 if (Right.isOneOf(Keywords.kw_extends, Keywords.kw_throws)) in splitPenalty()
3044 if (Right.is(Keywords.kw_implements)) in splitPenalty()
3049 if (Right.is(Keywords.kw_function) && Left.isNot(tok::comma)) in splitPenalty()
3054 (Right.is(TT_TemplateString) && Right.TokenText.startswith("}"))) { in splitPenalty()
3058 if (Left.opensScope() && Right.closesScope()) in splitPenalty()
3062 if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral)) in splitPenalty()
3064 if (Right.is(tok::l_square)) { in splitPenalty()
3070 if (Right.is(TT_LambdaLSquare) && Left.is(tok::equal)) in splitPenalty()
3072 if (!Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare, in splitPenalty()
3080 (Right.is(tok::period) && Style.Language == FormatStyle::LK_Proto)) { in splitPenalty()
3083 if (Right.isOneOf(TT_StartOfName, TT_FunctionDeclarationName) || in splitPenalty()
3084 Right.is(tok::kw_operator)) { in splitPenalty()
3085 if (Line.startsWith(tok::kw_for) && Right.PartOfMultiVariableDeclStmt) in splitPenalty()
3089 if (InFunctionDecl && Right.NestingLevel == 0) in splitPenalty()
3093 if (Right.is(TT_PointerOrReference)) in splitPenalty()
3095 if (Right.is(TT_LambdaArrow)) in splitPenalty()
3097 if (Left.is(tok::equal) && Right.is(tok::l_brace)) in splitPenalty()
3111 if (Right.isMemberAccess()) { in splitPenalty()
3131 return !Right.NextOperator || !Right.NextOperator->Previous->closesScope() in splitPenalty()
3136 if (Right.is(TT_TrailingAnnotation) && in splitPenalty()
3137 (!Right.Next || Right.Next->isNot(tok::l_paren))) { in splitPenalty()
3147 bool is_short_annotation = Right.TokenText.size() < 10; in splitPenalty()
3157 if (Right.is(TT_SelectorName)) in splitPenalty()
3182 if (Right.is(tok::r_brace)) in splitPenalty()
3209 if (Right.is(tok::plus) && Left.isLabelString() && in splitPenalty()
3210 (Right.NextOperator || Right.OperatorIndex != 0)) { in splitPenalty()
3215 if (Right.is(tok::lessless) && Left.isLabelString() && in splitPenalty()
3216 (Right.NextOperator || Right.OperatorIndex != 1)) { in splitPenalty()
3219 if (Right.is(tok::lessless)) { in splitPenalty()
3221 if (!Left.is(tok::r_paren) || Right.OperatorIndex > 0) { in splitPenalty()
3235 Level = Right.getPrecedence(); in splitPenalty()
3244 bool TokenAnnotator::spaceRequiredBeforeParens(const FormatToken &Right) const { in spaceRequiredBeforeParens()
3247 if (Right.is(TT_OverloadedOperatorLParen) && in spaceRequiredBeforeParens()
3252 Right.ParameterCount > 0) { in spaceRequiredBeforeParens()
3260 const FormatToken &Right) const { in spaceRequiredBetween()
3262 !Right.isOneOf(tok::semi, tok::r_paren, tok::hashhash)) { in spaceRequiredBetween()
3265 if (Style.isJson() && Left.is(tok::string_literal) && Right.is(tok::colon)) in spaceRequiredBetween()
3273 if (Right.is(tok::hashhash)) in spaceRequiredBetween()
3276 return Right.is(tok::hash); in spaceRequiredBetween()
3277 if ((Left.is(tok::l_paren) && Right.is(tok::r_paren)) || in spaceRequiredBetween()
3279 Right.is(tok::r_brace) && Right.isNot(BK_Block))) { in spaceRequiredBetween()
3286 else if (Right.is(tok::r_paren) && Right.MatchingParen) in spaceRequiredBetween()
3287 LeftParen = Right.MatchingParen; in spaceRequiredBetween()
3295 if (Left.is(tok::kw_auto) && Right.isOneOf(tok::l_paren, tok::l_brace)) in spaceRequiredBetween()
3299 if (Right.is(tok::l_paren) && Left.is(tok::kw_co_await) && Left.Previous && in spaceRequiredBetween()
3305 !Right.isOneOf(tok::semi, tok::r_paren)) { in spaceRequiredBetween()
3309 if (Left.is(tok::l_paren) || Right.is(tok::r_paren)) { in spaceRequiredBetween()
3310 return (Right.is(TT_CastRParen) || in spaceRequiredBetween()
3315 if (Right.isOneOf(tok::semi, tok::comma)) in spaceRequiredBetween()
3317 if (Right.is(tok::less) && Line.Type == LT_ObjCDecl) { in spaceRequiredBetween()
3318 bool IsLightweightGeneric = Right.MatchingParen && in spaceRequiredBetween()
3319 Right.MatchingParen->Next && in spaceRequiredBetween()
3320 Right.MatchingParen->Next->is(tok::colon); in spaceRequiredBetween()
3323 if (Right.is(tok::less) && Left.is(tok::kw_template)) in spaceRequiredBetween()
3328 Right.isOneOf(tok::identifier, tok::string_literal, tok::char_constant, in spaceRequiredBetween()
3337 if (Left.is(tok::less) || Right.isOneOf(tok::greater, tok::less)) { in spaceRequiredBetween()
3340 (Left.is(TT_DictLiteral) || Right.is(TT_DictLiteral)))) { in spaceRequiredBetween()
3342 if (Left.is(tok::less) && Right.is(tok::greater)) in spaceRequiredBetween()
3348 if (Right.is(tok::ellipsis)) { in spaceRequiredBetween()
3352 if (Left.is(tok::l_square) && Right.is(tok::amp)) in spaceRequiredBetween()
3354 if (Right.is(TT_PointerOrReference)) { in spaceRequiredBetween()
3375 if (Left.isTypeOrIdentifier() && Right.Next && Right.Next->Next && in spaceRequiredBetween()
3376 Right.Next->Next->is(TT_RangeBasedForLoopColon)) { in spaceRequiredBetween()
3377 return getTokenPointerOrReferenceAlignment(Right) != in spaceRequiredBetween()
3381 (getTokenPointerOrReferenceAlignment(Right) != in spaceRequiredBetween()
3387 if (Right.is(TT_FunctionTypeLParen) && Left.isNot(tok::l_paren) && in spaceRequiredBetween()
3398 Right.canBePointerOrReferenceQualifier()) { in spaceRequiredBetween()
3402 if (Right.Tok.isLiteral()) in spaceRequiredBetween()
3405 if (Right.is(TT_BlockComment)) in spaceRequiredBetween()
3408 if (Right.isOneOf(Keywords.kw_override, Keywords.kw_final) && in spaceRequiredBetween()
3409 !Right.is(TT_StartOfName)) { in spaceRequiredBetween()
3413 if (Right.is(tok::l_brace) && Right.is(BK_Block)) in spaceRequiredBetween()
3416 if (Left.Previous && Left.Previous->isTypeOrIdentifier() && Right.Next && in spaceRequiredBetween()
3417 Right.Next->is(TT_RangeBasedForLoopColon)) { in spaceRequiredBetween()
3421 if (Right.isOneOf(TT_PointerOrReference, TT_ArraySubscriptLSquare, in spaceRequiredBetween()
3448 if (Right.is(tok::star) && Left.is(tok::l_paren)) in spaceRequiredBetween()
3450 if (Left.is(tok::star) && Right.isOneOf(tok::star, tok::amp, tok::ampamp)) in spaceRequiredBetween()
3452 if (Right.isOneOf(tok::star, tok::amp, tok::ampamp)) { in spaceRequiredBetween()
3502 return (Left.is(TT_ArrayInitializerLSquare) && Right.isNot(tok::r_square) && in spaceRequiredBetween()
3506 Style.SpacesInSquareBrackets && Right.isNot(tok::r_square)); in spaceRequiredBetween()
3508 if (Right.is(tok::r_square)) { in spaceRequiredBetween()
3509 return Right.MatchingParen && in spaceRequiredBetween()
3510 ((Right.MatchingParen->is(TT_ArrayInitializerLSquare) && in spaceRequiredBetween()
3511 SpaceRequiredForArrayInitializerLSquare(*Right.MatchingParen, in spaceRequiredBetween()
3514 Right.MatchingParen->isOneOf(TT_ArraySubscriptLSquare, in spaceRequiredBetween()
3517 Right.MatchingParen->is(TT_AttributeParen)); in spaceRequiredBetween()
3519 if (Right.is(tok::l_square) && in spaceRequiredBetween()
3520 !Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare, in spaceRequiredBetween()
3525 Right.is(TT_ArraySubscriptLSquare))) { in spaceRequiredBetween()
3528 if (Left.is(tok::l_brace) && Right.is(tok::r_brace)) in spaceRequiredBetween()
3531 (Right.is(tok::r_brace) && Right.MatchingParen && in spaceRequiredBetween()
3532 Right.MatchingParen->isNot(BK_Block))) { in spaceRequiredBetween()
3542 if (Left.is(TT_TemplateCloser) && Right.is(TT_AttributeSquare)) in spaceRequiredBetween()
3545 if (Right.is(tok::l_paren)) { in spaceRequiredBetween()
3546 if (Left.is(TT_TemplateCloser) && Right.isNot(TT_FunctionTypeLParen)) in spaceRequiredBetween()
3547 return spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3551 spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3555 spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3563 spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3567 spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3577 spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3582 if (Right.is(TT_OverloadedOperatorLParen)) in spaceRequiredBetween()
3583 return spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3588 spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3591 spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3598 spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3603 spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3608 spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3615 spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3621 return spaceRequiredBeforeParens(Right); in spaceRequiredBetween()
3625 if (Left.is(tok::at) && Right.Tok.getObjCKeywordID() != tok::objc_not_keyword) in spaceRequiredBetween()
3627 if (Right.is(TT_UnaryOperator)) { in spaceRequiredBetween()
3634 Right.is(tok::l_brace) && Right.getNextNonComment() && in spaceRequiredBetween()
3635 Right.isNot(BK_Block)) { in spaceRequiredBetween()
3638 if (Left.is(tok::period) || Right.is(tok::period)) in spaceRequiredBetween()
3642 if (Right.is(tok::hash) && Left.is(tok::identifier) && in spaceRequiredBetween()
3658 if (Left.is(TT_TemplateCloser) && Right.is(tok::l_square)) in spaceRequiredBetween()
3664 if (Right.is(tok::r_brace) && Right.MatchingParen && in spaceRequiredBetween()
3665 Right.MatchingParen->endsSequence(TT_DictLiteral, tok::at)) { in spaceRequiredBetween()
3669 if (Right.getType() == TT_TrailingAnnotation && in spaceRequiredBetween()
3670 Right.isOneOf(tok::amp, tok::ampamp) && in spaceRequiredBetween()
3672 (!Right.Next || Right.Next->is(tok::semi))) { in spaceRequiredBetween()
3676 return getTokenReferenceAlignment(Right) != FormatStyle::PAS_Left; in spaceRequiredBetween()
3683 const FormatToken &Right) const { in spaceRequiredBefore()
3684 const FormatToken &Left = *Right.Previous; in spaceRequiredBefore()
3689 return Right.hasWhitespaceBefore(); in spaceRequiredBefore()
3692 if (Keywords.isWordLike(Right) && Keywords.isWordLike(Left)) in spaceRequiredBefore()
3697 if (Left.is(tok::star) && Right.is(tok::comment)) in spaceRequiredBefore()
3703 if (Left.is(Keywords.kw_import) && Right.isOneOf(tok::less, tok::ellipsis)) in spaceRequiredBefore()
3707 Right.is(TT_ModulePartitionColon)) { in spaceRequiredBefore()
3711 if (Left.is(tok::identifier) && Right.is(TT_ModulePartitionColon)) in spaceRequiredBefore()
3715 Right.isOneOf(tok::identifier, tok::kw_private)) { in spaceRequiredBefore()
3718 if (Left.is(tok::ellipsis) && Right.is(tok::identifier) && in spaceRequiredBefore()
3723 if (Left.is(TT_AttributeParen) && Right.is(tok::coloncolon)) in spaceRequiredBefore()
3727 return Right.is(tok::coloncolon); in spaceRequiredBefore()
3728 if (Right.is(tok::l_brace) && Right.is(BK_BracedInit) && in spaceRequiredBefore()
3733 Right.is(TT_TemplateOpener)) { in spaceRequiredBefore()
3738 if (Right.is(tok::period) && in spaceRequiredBefore()
3743 if (Right.is(tok::l_paren) && in spaceRequiredBefore()
3747 if (Right.isOneOf(tok::l_brace, tok::less) && Left.is(TT_SelectorName)) in spaceRequiredBefore()
3750 if (Left.is(tok::slash) || Right.is(tok::slash)) in spaceRequiredBefore()
3754 Right.isOneOf(tok::l_brace, tok::less)) { in spaceRequiredBefore()
3762 if (Left.is(tok::numeric_constant) && Right.is(tok::percent)) in spaceRequiredBefore()
3763 return Right.hasWhitespaceBefore(); in spaceRequiredBefore()
3765 if (Right.is(tok::colon)) in spaceRequiredBefore()
3773 if (Left.is(tok::kw_this) && Right.is(tok::l_square)) in spaceRequiredBefore()
3777 if (Left.is(tok::kw_new) && Right.is(tok::l_paren)) in spaceRequiredBefore()
3781 if (Right.is(tok::l_brace)) in spaceRequiredBefore()
3785 if (Left.is(tok::l_brace) && Right.isNot(tok::r_brace)) in spaceRequiredBefore()
3788 if (Left.isNot(tok::l_brace) && Right.is(tok::r_brace)) in spaceRequiredBefore()
3792 if (Left.is(TT_FatArrow) || Right.is(TT_FatArrow)) in spaceRequiredBefore()
3796 if (Left.is(TT_AttributeColon) || Right.is(TT_AttributeColon)) in spaceRequiredBefore()
3800 if (Left.is(TT_TemplateCloser) && Right.is(TT_StartOfName)) in spaceRequiredBefore()
3804 if (Left.is(tok::l_square) || Right.is(tok::r_square)) in spaceRequiredBefore()
3808 if (Right.is(TT_CSharpNullable)) in spaceRequiredBefore()
3812 if (Right.is(TT_NonNullAssertion)) in spaceRequiredBefore()
3816 if (Left.is(tok::comma) && Right.is(tok::comma)) in spaceRequiredBefore()
3820 if (Left.is(Keywords.kw_var) && Right.is(tok::l_paren)) in spaceRequiredBefore()
3824 if (Right.is(tok::l_paren)) { in spaceRequiredBefore()
3828 spaceRequiredBeforeParens(Right); in spaceRequiredBefore()
3839 Right.is(tok::l_paren)) { in spaceRequiredBefore()
3846 if (Right.is(tok::l_paren) && Left.is(Keywords.kw_await) && Left.Previous && in spaceRequiredBefore()
3850 if (Left.is(Keywords.kw_async) && Right.is(tok::l_paren) && in spaceRequiredBefore()
3851 Right.MatchingParen) { in spaceRequiredBefore()
3852 const FormatToken *Next = Right.MatchingParen->getNextNonComment(); in spaceRequiredBefore()
3859 (Right.is(TT_TemplateString) && Right.TokenText.startswith("}"))) { in spaceRequiredBefore()
3866 Right.is(TT_TemplateString)) { in spaceRequiredBefore()
3869 if (Right.is(tok::star) && in spaceRequiredBefore()
3873 if (Right.isOneOf(tok::l_brace, tok::l_square) && in spaceRequiredBefore()
3878 if (Right.is(tok::l_paren)) { in spaceRequiredBefore()
3909 Left.Previous->is(tok::period) && Right.is(tok::l_paren)) { in spaceRequiredBefore()
3913 Right.isOneOf(tok::l_square, tok::l_brace, tok::l_paren)) { in spaceRequiredBefore()
3920 if (Left.is(Keywords.kw_is) && Right.is(tok::l_brace)) in spaceRequiredBefore()
3922 if (Right.isOneOf(TT_JsTypeColon, TT_JsTypeOptionalQuestion)) in spaceRequiredBefore()
3924 if (Left.is(TT_JsTypeOperator) || Right.is(TT_JsTypeOperator)) in spaceRequiredBefore()
3926 if ((Left.is(tok::l_brace) || Right.is(tok::r_brace)) && in spaceRequiredBefore()
3933 !Right.isOneOf(tok::equal, tok::l_brace, tok::comma, tok::l_square, in spaceRequiredBefore()
3940 if (Right.is(TT_NonNullAssertion)) in spaceRequiredBefore()
3943 Right.isOneOf(Keywords.kw_as, Keywords.kw_in)) { in spaceRequiredBefore()
3947 if (Left.is(tok::r_square) && Right.is(tok::l_brace)) in spaceRequiredBefore()
3949 if (Left.is(Keywords.kw_synchronized) && Right.is(tok::l_paren)) { in spaceRequiredBefore()
3951 spaceRequiredBeforeParens(Right); in spaceRequiredBefore()
3957 Right.is(TT_TemplateOpener)) { in spaceRequiredBefore()
3967 if (!Right.is(tok::semi) && in spaceRequiredBefore()
3977 return Right.hasWhitespaceBefore(); in spaceRequiredBefore()
3981 if (Left.is(tok::r_paren) && canBeObjCSelectorComponent(Right)) { in spaceRequiredBefore()
3989 (Right.is(tok::equal) || Left.is(tok::equal))) { in spaceRequiredBefore()
3993 if (Right.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow) || in spaceRequiredBefore()
3997 if (Left.is(tok::comma) && !Right.is(TT_OverloadedOperatorLParen)) in spaceRequiredBefore()
3999 if (Right.is(tok::comma)) in spaceRequiredBefore()
4001 if (Right.is(TT_ObjCBlockLParen)) in spaceRequiredBefore()
4003 if (Right.is(TT_CtorInitializerColon)) in spaceRequiredBefore()
4005 if (Right.is(TT_InheritanceColon) && !Style.SpaceBeforeInheritanceColon) in spaceRequiredBefore()
4007 if (Right.is(TT_RangeBasedForLoopColon) && in spaceRequiredBefore()
4015 if (Right.is(tok::colon)) { in spaceRequiredBefore()
4018 const FormatToken *Next = Right.getNextNonComment(); in spaceRequiredBefore()
4021 if (Right.is(TT_ObjCMethodExpr)) in spaceRequiredBefore()
4025 if (Right.is(TT_InlineASMColon) && Left.is(tok::coloncolon)) in spaceRequiredBefore()
4027 if (Right.is(TT_DictLiteral)) in spaceRequiredBefore()
4029 if (Right.is(TT_AttributeColon)) in spaceRequiredBefore()
4031 if (Right.is(TT_CSharpNamedArgumentColon)) in spaceRequiredBefore()
4033 if (Right.is(TT_BitFieldColon)) { in spaceRequiredBefore()
4041 Right.isOneOf(tok::minus, tok::minusminus)) || in spaceRequiredBefore()
4043 Right.isOneOf(tok::plus, tok::plusplus))) { in spaceRequiredBefore()
4047 if (!Right.is(tok::l_paren)) { in spaceRequiredBefore()
4057 if (Left.is(tok::amp) && Right.is(tok::r_square)) in spaceRequiredBefore()
4061 Right.is(TT_BinaryOperator); in spaceRequiredBefore()
4068 Right.isOneOf(TT_BinaryOperator, TT_SelectorName); in spaceRequiredBefore()
4071 auto ShouldAddSpacesInAngles = [this, &Right]() { in spaceRequiredBefore()
4075 return Right.hasWhitespaceBefore(); in spaceRequiredBefore()
4079 if (Left.is(tok::greater) && Right.is(tok::greater)) { in spaceRequiredBefore()
4084 return Right.is(TT_TemplateCloser) && Left.is(TT_TemplateCloser) && in spaceRequiredBefore()
4088 if (Right.isOneOf(tok::arrow, tok::arrowstar, tok::periodstar) || in spaceRequiredBefore()
4090 (Right.is(tok::period) && Right.isNot(TT_DesignatedInitializerPeriod))) { in spaceRequiredBefore()
4094 Right.getPrecedence() == prec::Assignment) { in spaceRequiredBefore()
4097 if (Style.Language == FormatStyle::LK_Java && Right.is(tok::coloncolon) && in spaceRequiredBefore()
4101 if (Right.is(tok::coloncolon) && Left.is(tok::identifier)) { in spaceRequiredBefore()
4105 return Right.hasWhitespaceBefore(); in spaceRequiredBefore()
4107 if (Right.is(tok::coloncolon) && in spaceRequiredBefore()
4118 if ((Left.is(TT_TemplateOpener)) != (Right.is(TT_TemplateCloser))) in spaceRequiredBefore()
4121 if (Right.is(TT_StructuredBindingLSquare)) { in spaceRequiredBefore()
4126 if (Right.Next && Right.Next->is(TT_StructuredBindingLSquare) && in spaceRequiredBefore()
4127 Right.isOneOf(tok::amp, tok::ampamp)) { in spaceRequiredBefore()
4128 return getTokenReferenceAlignment(Right) != FormatStyle::PAS_Left; in spaceRequiredBefore()
4130 if ((Right.is(TT_BinaryOperator) && !Left.is(tok::l_paren)) || in spaceRequiredBefore()
4132 !Right.is(tok::r_paren))) { in spaceRequiredBefore()
4135 if (Right.is(TT_TemplateOpener) && Left.is(tok::r_paren) && in spaceRequiredBefore()
4140 if (Right.is(tok::less) && Left.isNot(tok::l_paren) && in spaceRequiredBefore()
4144 if (Right.is(TT_TrailingUnaryOperator)) in spaceRequiredBefore()
4148 return spaceRequiredBetween(Line, Left, Right); in spaceRequiredBefore()
4185 const FormatToken &Right) const { in mustBreakBefore()
4186 const FormatToken &Left = *Right.Previous; in mustBreakBefore()
4187 if (Right.NewlinesBefore > 1 && Style.MaxEmptyLinesToKeep > 0) in mustBreakBefore()
4191 if (Left.is(TT_FatArrow) && Right.is(tok::l_brace) && in mustBreakBefore()
4195 if (Right.is(TT_CSharpNamedArgumentColon) || in mustBreakBefore()
4199 if (Right.is(TT_CSharpGenericTypeConstraint)) in mustBreakBefore()
4201 if (Right.Next && Right.Next->is(TT_FatArrow) && in mustBreakBefore()
4202 (Right.is(tok::numeric_constant) || in mustBreakBefore()
4203 (Right.is(tok::identifier) && Right.TokenText == "_"))) { in mustBreakBefore()
4209 (Right.isAccessSpecifier(/*ColonRequired=*/false) || in mustBreakBefore()
4210 Right.is(Keywords.kw_internal))) { in mustBreakBefore()
4214 if (Left.is(TT_AttributeSquare) && Right.is(TT_AttributeSquare) && in mustBreakBefore()
4215 Left.is(tok::r_square) && Right.is(tok::l_square)) { in mustBreakBefore()
4221 if (Right.is(tok::string_literal) && Left.is(tok::plus) && Left.Previous && in mustBreakBefore()
4245 if (Right.is(tok::r_brace) && Left.is(tok::l_brace) && Left.Previous && in mustBreakBefore()
4264 if (Right.is(tok::r_brace) && Left.is(tok::l_brace) && in mustBreakBefore()
4274 if (Right.is(tok::plus) && Left.is(tok::string_literal) && Right.Next && in mustBreakBefore()
4275 Right.Next->is(tok::string_literal)) { in mustBreakBefore()
4283 if (Left.isStringLiteral() && Right.isStringLiteral()) in mustBreakBefore()
4298 !Right.is(tok::r_square)) { in mustBreakBefore()
4318 } else if (Right.MatchingParen && in mustBreakBefore()
4319 (Right.MatchingParen->isOneOf(tok::l_brace, in mustBreakBefore()
4322 Right.MatchingParen->is(tok::l_paren)))) { in mustBreakBefore()
4331 if (Right.is(tok::comment)) { in mustBreakBefore()
4333 (Right.NewlinesBefore > 0 && Right.HasUnescapedNewline); in mustBreakBefore()
4339 if (Right.is(tok::lessless) && Right.Next && Left.is(tok::string_literal) && in mustBreakBefore()
4340 Right.Next->is(tok::string_literal)) { in mustBreakBefore()
4343 if (Right.is(TT_RequiresClause)) { in mustBreakBefore()
4358 if (Right.is(tok::kw_concept)) in mustBreakBefore()
4362 if (Left.ClosesRequiresClause && Right.isNot(tok::semi)) { in mustBreakBefore()
4374 Right.is(TT_CtorInitializerColon))) { in mustBreakBefore()
4385 Right.isOneOf(TT_CtorInitializerComma, TT_CtorInitializerColon)) { in mustBreakBefore()
4390 Right.is(TT_InheritanceComma)) { in mustBreakBefore()
4397 if (Right.is(tok::string_literal) && Right.TokenText.startswith("R\"")) { in mustBreakBefore()
4401 return Right.IsMultiline && Right.NewlinesBefore > 0; in mustBreakBefore()
4405 Right.NestingLevel == 1 && Style.Language == FormatStyle::LK_Proto) { in mustBreakBefore()
4410 if (Right.is(TT_InlineASMBrace)) in mustBreakBefore()
4411 return Right.HasUnescapedNewline; in mustBreakBefore()
4413 if (isAllmanBrace(Left) || isAllmanBrace(Right)) { in mustBreakBefore()
4450 if (Left.is(TT_AttributeParen) && Right.is(TT_ObjCDecl)) in mustBreakBefore()
4467 if (Style.BraceWrapping.BeforeLambdaBody && Right.is(TT_LambdaLBrace) && in mustBreakBefore()
4475 Right.isNot(TT_LeadingJavaAnnotation) && Right.isNot(tok::l_paren) && in mustBreakBefore()
4480 if (Right.is(TT_ProtoExtensionLSquare)) in mustBreakBefore()
4512 Right.is(TT_SelectorName) && !Right.is(tok::r_square) && Right.Next) { in mustBreakBefore()
4521 FormatToken *LBrace = Right.Next; in mustBreakBefore()
4574 !Right.isOneOf(tok::l_paren, TT_LambdaLSquare)) { in mustBreakBefore()
4596 const FormatToken &Right) const { in canBreakBefore()
4597 const FormatToken &Left = *Right.Previous; in canBreakBefore()
4601 Right.isOneOf(TT_CSharpNamedArgumentColon, TT_AttributeColon)) { in canBreakBefore()
4608 if (Right.is(TT_CSharpNullable)) in canBreakBefore()
4615 if (Right.isOneOf(Keywords.kw_throws, Keywords.kw_extends, in canBreakBefore()
4620 const FormatToken *NonComment = Right.getPreviousNonComment(); in canBreakBefore()
4631 if (Right.NestingLevel == 0 && in canBreakBefore()
4634 Right.isOneOf(tok::l_square, tok::l_paren)) { in canBreakBefore()
4641 if (Left.is(TT_FatArrow) && Right.is(tok::l_brace)) in canBreakBefore()
4646 if (Left.is(tok::exclaim) && Right.is(tok::colon)) in canBreakBefore()
4651 if (Right.is(Keywords.kw_is)) { in canBreakBefore()
4652 const FormatToken *Next = Right.getNextNonComment(); in canBreakBefore()
4665 if (Right.is(Keywords.kw_in)) in canBreakBefore()
4667 if (Right.is(Keywords.kw_as)) in canBreakBefore()
4669 if (Right.isOneOf(Keywords.kw_extends, Keywords.kw_infer)) { in canBreakBefore()
4680 Right.isOneOf(Keywords.kw_module, tok::kw_namespace, in canBreakBefore()
4689 Right.isOneOf(tok::identifier, tok::string_literal)) { in canBreakBefore()
4692 if (Right.is(TT_TemplateString) && Right.closesScope()) in canBreakBefore()
4696 if (Left.is(tok::identifier) && Right.is(TT_TemplateString)) in canBreakBefore()
4707 return !Right.is(tok::l_paren); in canBreakBefore()
4708 if (Right.is(TT_PointerOrReference)) { in canBreakBefore()
4710 (getTokenPointerOrReferenceAlignment(Right) == in canBreakBefore()
4712 (!Right.Next || Right.Next->isNot(TT_FunctionDeclarationName))); in canBreakBefore()
4714 if (Right.isOneOf(TT_StartOfName, TT_FunctionDeclarationName) || in canBreakBefore()
4715 Right.is(tok::kw_operator)) { in canBreakBefore()
4720 if (Right.isTrailingComment()) { in canBreakBefore()
4727 (Left.is(TT_CtorInitializerColon) && Right.NewlinesBefore > 0 && in canBreakBefore()
4730 if (Left.is(tok::question) && Right.is(tok::colon)) in canBreakBefore()
4732 if (Right.is(TT_ConditionalExpr) || Right.is(tok::question)) in canBreakBefore()
4738 if (Right.is(TT_InheritanceColon)) in canBreakBefore()
4740 if (Right.is(TT_ObjCMethodExpr) && !Right.is(tok::r_square) && in canBreakBefore()
4745 if (Right.is(tok::colon) && in canBreakBefore()
4746 !Right.isOneOf(TT_CtorInitializerColon, TT_InlineASMColon)) { in canBreakBefore()
4752 if (!Style.AlwaysBreakBeforeMultilineStrings && Right.isStringLiteral()) in canBreakBefore()
4778 if (((Right.is(tok::l_brace) || Right.is(tok::less)) && in canBreakBefore()
4779 Right.is(TT_DictLiteral)) || in canBreakBefore()
4780 Right.is(TT_ArrayInitializerLSquare)) { in canBreakBefore()
4786 if (Right.is(tok::r_square) && Right.MatchingParen && in canBreakBefore()
4787 Right.MatchingParen->is(TT_ProtoExtensionLSquare)) { in canBreakBefore()
4790 if (Right.is(TT_SelectorName) || (Right.is(tok::identifier) && Right.Next && in canBreakBefore()
4791 Right.Next->is(TT_ObjCMethodExpr))) { in canBreakBefore()
4796 if (Right.is(tok::kw_concept)) in canBreakBefore()
4798 if (Right.is(TT_RequiresClause)) in canBreakBefore()
4804 if (Right.isOneOf(TT_RangeBasedForLoopColon, TT_OverloadedOperatorLParen, in canBreakBefore()
4810 if (Right.is(TT_RangeBasedForLoopColon)) in canBreakBefore()
4812 if (Left.is(TT_TemplateCloser) && Right.is(TT_TemplateOpener)) in canBreakBefore()
4814 if ((Left.is(tok::greater) && Right.is(tok::greater)) || in canBreakBefore()
4815 (Left.is(tok::less) && Right.is(tok::less))) { in canBreakBefore()
4818 if (Right.is(TT_BinaryOperator) && in canBreakBefore()
4821 Right.getPrecedence() != prec::Assignment)) { in canBreakBefore()
4828 if (Left.is(tok::equal) && !Right.isOneOf(tok::kw_default, tok::kw_delete) && in canBreakBefore()
4832 if (Left.is(tok::equal) && Right.is(tok::l_brace) && in canBreakBefore()
4844 if (Right.is(TT_ImplicitStringLiteral)) in canBreakBefore()
4847 if (Right.is(TT_TemplateCloser)) in canBreakBefore()
4849 if (Right.is(tok::r_square) && Right.MatchingParen && in canBreakBefore()
4850 Right.MatchingParen->is(TT_LambdaLSquare)) { in canBreakBefore()
4856 if (Right.is(tok::r_brace)) in canBreakBefore()
4857 return Right.MatchingParen && Right.MatchingParen->is(BK_Block); in canBreakBefore()
4860 if (Right.is(tok::r_paren)) { in canBreakBefore()
4862 !Right.MatchingParen) { in canBreakBefore()
4865 const FormatToken *Previous = Right.MatchingParen->Previous; in canBreakBefore()
4872 return !Right.isOneOf(tok::l_brace, tok::semi, tok::equal, tok::l_paren, in canBreakBefore()
4876 if (Right.is(tok::kw___attribute) || in canBreakBefore()
4877 (Right.is(tok::l_square) && Right.is(TT_AttributeSquare))) { in canBreakBefore()
4881 if (Left.is(tok::identifier) && Right.is(tok::string_literal)) in canBreakBefore()
4884 if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral)) in canBreakBefore()
4889 (!Right.isTrailingComment() || Right.NewlinesBefore > 0); in canBreakBefore()
4891 if (Right.is(TT_CtorInitializerColon)) in canBreakBefore()
4897 if (Right.is(TT_CtorInitializerComma) && in canBreakBefore()
4905 if (Right.is(TT_InheritanceComma) && in canBreakBefore()
4911 if (Right.is(tok::kw_typename) && Left.isNot(tok::kw_const)) in canBreakBefore()
4920 if ((Left.is(TT_AttributeSquare) && Right.is(tok::l_square)) || in canBreakBefore()
4921 (Left.is(tok::r_square) && Right.is(TT_AttributeSquare))) { in canBreakBefore()
4926 if (Style.BraceWrapping.BeforeLambdaBody && Right.is(TT_LambdaLBrace)) { in canBreakBefore()
4929 if (isAllmanLambdaBrace(Right)) in canBreakBefore()
4930 return !isItAnEmptyLambdaAllowed(Right, ShortLambdaOption); in canBreakBefore()
4935 Right.isMemberAccess() || in canBreakBefore()
4936 Right.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow, tok::lessless, in canBreakBefore()
4939 Right.isOneOf(tok::identifier, tok::kw_const)) || in canBreakBefore()
4940 (Left.is(tok::l_paren) && !Right.is(tok::r_paren)) || in canBreakBefore()
4941 (Left.is(TT_TemplateOpener) && !Right.is(TT_TemplateCloser)); in canBreakBefore()