Lines Matching full:right

199       // categorize it as an unary operator, so set the right type here.  in parseParens()
1165 // If there is an identifier (or with a few exceptions a keyword) right in rParenEndsCast()
1172 // Certain other tokens right before the parentheses are also signals that in rParenEndsCast()
1281 // declarations. Thus, having an identifier on the right-hand side in determineStarAmpUsage()
1802 const FormatToken &Right = Tok; in splitPenalty() local
1808 if (Right.isOneOf(Keywords.kw_extends, Keywords.kw_throws)) in splitPenalty()
1810 if (Right.is(Keywords.kw_implements)) in splitPenalty()
1815 if (Right.is(Keywords.kw_function) && Left.isNot(tok::comma)) in splitPenalty()
1821 if (Left.is(tok::comma) || (Right.is(tok::identifier) && Right.Next && in splitPenalty()
1822 Right.Next->is(TT_DictLiteral))) in splitPenalty()
1824 if (Right.is(tok::l_square)) { in splitPenalty()
1830 if (Right.is(TT_LambdaLSquare) && Left.is(tok::equal)) in splitPenalty()
1832 if (!Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare, in splitPenalty()
1837 if (Right.isOneOf(TT_StartOfName, TT_FunctionDeclarationName) || in splitPenalty()
1838 Right.is(tok::kw_operator)) { in splitPenalty()
1839 if (Line.startsWith(tok::kw_for) && Right.PartOfMultiVariableDeclStmt) in splitPenalty()
1843 if (InFunctionDecl && Right.NestingLevel == 0) in splitPenalty()
1847 if (Right.is(TT_PointerOrReference)) in splitPenalty()
1849 if (Right.is(TT_LambdaArrow)) in splitPenalty()
1851 if (Left.is(tok::equal) && Right.is(tok::l_brace)) in splitPenalty()
1856 (Right.is(tok::period) && Style.Language == FormatStyle::LK_Proto)) in splitPenalty()
1866 if (Right.isMemberAccess()) { in splitPenalty()
1886 return !Right.NextOperator || !Right.NextOperator->Previous->closesScope() in splitPenalty()
1891 if (Right.is(TT_TrailingAnnotation) && in splitPenalty()
1892 (!Right.Next || Right.Next->isNot(tok::l_paren))) { in splitPenalty()
1902 bool is_short_annotation = Right.TokenText.size() < 10; in splitPenalty()
1912 if (Right.is(TT_SelectorName)) in splitPenalty()
1925 if (Right.is(tok::r_brace)) in splitPenalty()
1938 if (Right.is(tok::lessless)) { in splitPenalty()
1940 (Right.NextOperator || Right.OperatorIndex != 1)) { in splitPenalty()
1958 Level = Right.getPrecedence(); in splitPenalty()
1967 const FormatToken &Right) { in spaceRequiredBetween() argument
1968 if (Left.is(tok::kw_return) && Right.isNot(tok::semi)) in spaceRequiredBetween()
1973 if (Right.is(tok::hashhash)) in spaceRequiredBetween()
1976 return Right.is(tok::hash); in spaceRequiredBetween()
1977 if (Left.is(tok::l_paren) && Right.is(tok::r_paren)) in spaceRequiredBetween()
1979 if (Left.is(tok::l_paren) || Right.is(tok::r_paren)) in spaceRequiredBetween()
1980 return (Right.is(TT_CastRParen) || in spaceRequiredBetween()
1984 if (Right.isOneOf(tok::semi, tok::comma)) in spaceRequiredBetween()
1986 if (Right.is(tok::less) && in spaceRequiredBetween()
1993 Right.isOneOf(tok::identifier, tok::string_literal, tok::char_constant, in spaceRequiredBetween()
2001 if (Left.is(tok::less) || Right.isOneOf(tok::greater, tok::less)) in spaceRequiredBetween()
2003 if (Right.is(tok::ellipsis)) in spaceRequiredBetween()
2006 if (Left.is(tok::l_square) && Right.is(tok::amp)) in spaceRequiredBetween()
2008 if (Right.is(TT_PointerOrReference)) in spaceRequiredBetween()
2015 if (Right.is(TT_FunctionTypeLParen) && Left.isNot(tok::l_paren) && in spaceRequiredBetween()
2021 return Right.Tok.isLiteral() || in spaceRequiredBetween()
2022 Right.isOneOf(TT_BlockComment, Keywords.kw_final, in spaceRequiredBetween()
2024 (Right.is(tok::l_brace) && Right.BlockKind == BK_Block) || in spaceRequiredBetween()
2025 (!Right.isOneOf(TT_PointerOrReference, TT_ArraySubscriptLSquare, in spaceRequiredBetween()
2031 if (Right.is(tok::star) && Left.is(tok::l_paren)) in spaceRequiredBetween()
2035 Style.SpacesInContainerLiterals && Right.isNot(tok::r_square)) || in spaceRequiredBetween()
2037 Right.isNot(tok::r_square)); in spaceRequiredBetween()
2038 if (Right.is(tok::r_square)) in spaceRequiredBetween()
2039 return Right.MatchingParen && in spaceRequiredBetween()
2041 Right.MatchingParen->is(TT_ArrayInitializerLSquare)) || in spaceRequiredBetween()
2043 Right.MatchingParen->is(TT_ArraySubscriptLSquare))); in spaceRequiredBetween()
2044 if (Right.is(tok::l_square) && in spaceRequiredBetween()
2045 !Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare) && in spaceRequiredBetween()
2048 if (Left.is(tok::l_brace) && Right.is(tok::r_brace)) in spaceRequiredBetween()
2051 (Right.is(tok::r_brace) && Right.MatchingParen && in spaceRequiredBetween()
2052 Right.MatchingParen->BlockKind != BK_Block)) in spaceRequiredBetween()
2056 if (Right.is(tok::l_paren)) { in spaceRequiredBetween()
2072 if (Left.is(tok::at) && Right.Tok.getObjCKeywordID() != tok::objc_not_keyword) in spaceRequiredBetween()
2074 if (Right.is(TT_UnaryOperator)) in spaceRequiredBetween()
2080 Right.is(tok::l_brace) && Right.getNextNonComment() && in spaceRequiredBetween()
2081 Right.BlockKind != BK_Block) in spaceRequiredBetween()
2083 if (Left.is(tok::period) || Right.is(tok::period)) in spaceRequiredBetween()
2085 if (Right.is(tok::hash) && Left.is(tok::identifier) && Left.TokenText == "L") in spaceRequiredBetween()
2092 if (Left.is(TT_TemplateCloser) && Right.is(tok::l_square)) in spaceRequiredBetween()
2098 const FormatToken &Right) { in spaceRequiredBefore() argument
2099 const FormatToken &Left = *Right.Previous; in spaceRequiredBefore()
2100 if (Right.Tok.getIdentifierInfo() && Left.Tok.getIdentifierInfo()) in spaceRequiredBefore()
2104 return Right.is(tok::coloncolon); in spaceRequiredBefore()
2106 if (Right.is(tok::period) && in spaceRequiredBefore()
2110 if (Right.is(tok::l_paren) && in spaceRequiredBefore()
2116 if (Right.is(tok::star) && in spaceRequiredBefore()
2126 if (Left.is(Keywords.kw_is) && Right.is(tok::l_brace)) in spaceRequiredBefore()
2128 if (Right.isOneOf(TT_JsTypeColon, TT_JsTypeOptionalQuestion)) in spaceRequiredBefore()
2130 if (Left.is(TT_JsTypeOperator) || Right.is(TT_JsTypeOperator)) in spaceRequiredBefore()
2132 if ((Left.is(tok::l_brace) || Right.is(tok::r_brace)) && in spaceRequiredBefore()
2138 !Right.isOneOf(tok::equal, tok::l_brace, tok::comma, tok::l_square, in spaceRequiredBefore()
2145 if (Right.is(tok::exclaim) && (Left.isOneOf(tok::identifier, tok::r_paren, in spaceRequiredBefore()
2150 if (Left.is(tok::r_square) && Right.is(tok::l_brace)) in spaceRequiredBefore()
2152 if (Left.is(Keywords.kw_synchronized) && Right.is(tok::l_paren)) in spaceRequiredBefore()
2158 Right.is(TT_TemplateOpener)) in spaceRequiredBefore()
2162 return Right.WhitespaceRange.getBegin() != Right.WhitespaceRange.getEnd(); in spaceRequiredBefore()
2166 if (Left.is(tok::r_paren) && Right.is(tok::identifier)) in spaceRequiredBefore()
2171 (Right.is(tok::equal) || Left.is(tok::equal))) in spaceRequiredBefore()
2174 if (Right.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow) || in spaceRequiredBefore()
2177 if (Right.is(TT_OverloadedOperatorLParen)) in spaceRequiredBefore()
2181 if (Right.is(tok::comma)) in spaceRequiredBefore()
2183 if (Right.isOneOf(TT_CtorInitializerColon, TT_ObjCBlockLParen)) in spaceRequiredBefore()
2185 if (Right.is(tok::colon)) { in spaceRequiredBefore()
2187 !Right.getNextNonComment() || Right.getNextNonComment()->is(tok::semi)) in spaceRequiredBefore()
2189 if (Right.is(TT_ObjCMethodExpr)) in spaceRequiredBefore()
2193 if (Right.is(TT_InlineASMColon) && Left.is(tok::coloncolon)) in spaceRequiredBefore()
2195 if (Right.is(TT_DictLiteral)) in spaceRequiredBefore()
2200 return Right.is(TT_BinaryOperator); in spaceRequiredBefore()
2206 Right.isOneOf(TT_BinaryOperator, TT_SelectorName); in spaceRequiredBefore()
2208 if (Left.is(tok::greater) && Right.is(tok::greater)) in spaceRequiredBefore()
2209 return Right.is(TT_TemplateCloser) && Left.is(TT_TemplateCloser) && in spaceRequiredBefore()
2211 if (Right.isOneOf(tok::arrow, tok::period, tok::arrowstar, tok::periodstar) || in spaceRequiredBefore()
2215 Right.getPrecedence() == prec::Assignment) in spaceRequiredBefore()
2217 if (Right.is(tok::coloncolon) && !Left.isOneOf(tok::l_brace, tok::comment)) in spaceRequiredBefore()
2223 if ((Left.is(TT_TemplateOpener)) != (Right.is(TT_TemplateCloser))) in spaceRequiredBefore()
2225 if ((Right.is(TT_BinaryOperator) && !Left.is(tok::l_paren)) || in spaceRequiredBefore()
2227 !Right.is(tok::r_paren))) in spaceRequiredBefore()
2229 if (Left.is(TT_TemplateCloser) && Right.is(tok::l_paren) && in spaceRequiredBefore()
2230 Right.isNot(TT_FunctionTypeLParen)) in spaceRequiredBefore()
2232 if (Right.is(TT_TemplateOpener) && Left.is(tok::r_paren) && in spaceRequiredBefore()
2235 if (Right.is(tok::less) && Left.isNot(tok::l_paren) && in spaceRequiredBefore()
2238 if (Right.is(TT_TrailingUnaryOperator)) in spaceRequiredBefore()
2242 return spaceRequiredBetween(Line, Left, Right); in spaceRequiredBefore()
2252 const FormatToken &Right) { in mustBreakBefore() argument
2253 const FormatToken &Left = *Right.Previous; in mustBreakBefore()
2254 if (Right.NewlinesBefore > 1 && Style.MaxEmptyLinesToKeep > 0) in mustBreakBefore()
2259 if (Right.is(tok::string_literal) && Left.is(tok::plus) && Left.Previous && in mustBreakBefore()
2278 if (Right.is(tok::r_brace) && Left.is(tok::l_brace) && in mustBreakBefore()
2287 if (Right.is(tok::plus) && Left.is(tok::string_literal) && Right.Next && in mustBreakBefore()
2288 Right.Next->is(tok::string_literal)) in mustBreakBefore()
2299 else if (Right.MatchingParen && in mustBreakBefore()
2300 Right.MatchingParen->isOneOf(tok::l_brace, in mustBreakBefore()
2307 if (Right.is(tok::comment)) in mustBreakBefore()
2310 (Right.NewlinesBefore > 0 && Right.HasUnescapedNewline); in mustBreakBefore()
2314 (Right.isStringLiteral() || Right.is(TT_ObjCStringLiteral))) in mustBreakBefore()
2316 if (Right.Previous->IsUnterminatedLiteral) in mustBreakBefore()
2318 if (Right.is(tok::lessless) && Right.Next && in mustBreakBefore()
2319 Right.Previous->is(tok::string_literal) && in mustBreakBefore()
2320 Right.Next->is(tok::string_literal)) in mustBreakBefore()
2322 if (Right.Previous->ClosesTemplateDeclaration && in mustBreakBefore()
2323 Right.Previous->MatchingParen && in mustBreakBefore()
2324 Right.Previous->MatchingParen->NestingLevel == 0 && in mustBreakBefore()
2327 if ((Right.isOneOf(TT_CtorInitializerComma, TT_CtorInitializerColon)) && in mustBreakBefore()
2331 if (Right.is(tok::string_literal) && Right.TokenText.startswith("R\"")) in mustBreakBefore()
2335 return Right.NewlinesBefore > 0; in mustBreakBefore()
2336 if (Right.Previous->is(tok::l_brace) && Right.NestingLevel == 1 && in mustBreakBefore()
2340 if (Right.is(TT_InlineASMBrace)) in mustBreakBefore()
2341 return Right.HasUnescapedNewline; in mustBreakBefore()
2342 if (isAllmanBrace(Left) || isAllmanBrace(Right)) in mustBreakBefore()
2352 Right.isNot(TT_LeadingJavaAnnotation) && Right.isNot(tok::l_paren) && in mustBreakBefore()
2360 const FormatToken &Right) { in canBreakBefore() argument
2361 const FormatToken &Left = *Right.Previous; in canBreakBefore()
2368 if (Right.isOneOf(Keywords.kw_throws, Keywords.kw_extends, in canBreakBefore()
2374 if (Left.is(TT_JsFatArrow) && Right.is(tok::l_brace)) in canBreakBefore()
2378 if (Right.NestingLevel == 0 && Right.is(Keywords.kw_is)) in canBreakBefore()
2382 if (Right.is(Keywords.kw_in)) in canBreakBefore()
2384 if (Right.is(Keywords.kw_as)) in canBreakBefore()
2393 return !Right.is(tok::l_paren); in canBreakBefore()
2394 if (Right.is(TT_PointerOrReference)) in canBreakBefore()
2397 (!Right.Next || Right.Next->isNot(TT_FunctionDeclarationName))); in canBreakBefore()
2398 if (Right.isOneOf(TT_StartOfName, TT_FunctionDeclarationName) || in canBreakBefore()
2399 Right.is(tok::kw_operator)) in canBreakBefore()
2403 if (Right.isTrailingComment()) in canBreakBefore()
2410 if (Left.is(tok::question) && Right.is(tok::colon)) in canBreakBefore()
2412 if (Right.is(TT_ConditionalExpr) || Right.is(tok::question)) in canBreakBefore()
2416 if (Right.is(TT_InheritanceColon)) in canBreakBefore()
2418 if (Right.is(tok::colon) && in canBreakBefore()
2419 !Right.isOneOf(TT_CtorInitializerColon, TT_InlineASMColon)) in canBreakBefore()
2423 if (Right.is(TT_SelectorName) || (Right.is(tok::identifier) && Right.Next && in canBreakBefore()
2424 Right.Next->is(TT_ObjCMethodExpr))) in canBreakBefore()
2430 if (Right.isOneOf(TT_RangeBasedForLoopColon, TT_OverloadedOperatorLParen, in canBreakBefore()
2435 if (Right.is(TT_RangeBasedForLoopColon)) in canBreakBefore()
2440 if (Left.is(tok::equal) && !Right.isOneOf(tok::kw_default, tok::kw_delete) && in canBreakBefore()
2448 if (Right.is(TT_ImplicitStringLiteral)) in canBreakBefore()
2451 if (Right.is(tok::r_paren) || Right.is(TT_TemplateCloser)) in canBreakBefore()
2453 if (Right.is(tok::r_square) && Right.MatchingParen && in canBreakBefore()
2454 Right.MatchingParen->is(TT_LambdaLSquare)) in canBreakBefore()
2459 if (Right.is(tok::r_brace)) in canBreakBefore()
2460 return Right.MatchingParen && Right.MatchingParen->BlockKind == BK_Block; in canBreakBefore()
2465 return !Right.isOneOf(tok::l_brace, tok::semi, tok::equal, tok::l_paren, in canBreakBefore()
2468 if (Right.is(tok::kw___attribute)) in canBreakBefore()
2471 if (Left.is(tok::identifier) && Right.is(tok::string_literal)) in canBreakBefore()
2474 if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral)) in canBreakBefore()
2480 if (Right.is(TT_CtorInitializerComma) && in canBreakBefore()
2483 if ((Left.is(tok::greater) && Right.is(tok::greater)) || in canBreakBefore()
2484 (Left.is(tok::less) && Right.is(tok::less))) in canBreakBefore()
2486 if (Right.is(TT_BinaryOperator) && in canBreakBefore()
2489 Right.getPrecedence() != prec::Assignment)) in canBreakBefore()
2493 if (Right.is(tok::kw_typename) && Left.isNot(tok::kw_const)) in canBreakBefore()
2503 Right.isMemberAccess() || in canBreakBefore()
2504 Right.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow, tok::lessless, in canBreakBefore()
2507 Right.isOneOf(tok::identifier, tok::kw_const)) || in canBreakBefore()
2508 (Left.is(tok::l_paren) && !Right.is(tok::r_paren)); in canBreakBefore()