Lines Matching refs:Right

1702   const FormatToken &Right = Tok;  in splitPenalty()  local
1708 if (Right.isOneOf(Keywords.kw_extends, Keywords.kw_throws)) in splitPenalty()
1710 if (Right.is(Keywords.kw_implements)) in splitPenalty()
1715 if (Right.is(Keywords.kw_function) && Left.isNot(tok::comma)) in splitPenalty()
1721 if (Left.is(tok::comma) || (Right.is(tok::identifier) && Right.Next && in splitPenalty()
1722 Right.Next->is(TT_DictLiteral))) in splitPenalty()
1724 if (Right.is(tok::l_square)) { in splitPenalty()
1728 if (Right.is(TT_LambdaLSquare) && Left.is(tok::equal)) in splitPenalty()
1730 if (!Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare, in splitPenalty()
1735 if (Right.isOneOf(TT_StartOfName, TT_FunctionDeclarationName) || in splitPenalty()
1736 Right.is(tok::kw_operator)) { in splitPenalty()
1737 if (Line.startsWith(tok::kw_for) && Right.PartOfMultiVariableDeclStmt) in splitPenalty()
1741 if (InFunctionDecl && Right.NestingLevel == 0) in splitPenalty()
1745 if (Right.is(TT_PointerOrReference)) in splitPenalty()
1747 if (Right.is(TT_LambdaArrow)) in splitPenalty()
1749 if (Left.is(tok::equal) && Right.is(tok::l_brace)) in splitPenalty()
1754 (Right.is(tok::period) && Style.Language == FormatStyle::LK_Proto)) in splitPenalty()
1762 if (Right.isMemberAccess()) { in splitPenalty()
1776 return Right.LastOperator ? 150 : 40; in splitPenalty()
1779 if (Right.is(TT_TrailingAnnotation) && in splitPenalty()
1780 (!Right.Next || Right.Next->isNot(tok::l_paren))) { in splitPenalty()
1790 bool is_short_annotation = Right.TokenText.size() < 10; in splitPenalty()
1800 if (Right.is(TT_SelectorName)) in splitPenalty()
1813 if (Right.is(tok::r_brace)) in splitPenalty()
1826 if (Right.is(tok::lessless)) { in splitPenalty()
1828 (!Right.LastOperator || Right.OperatorIndex != 1)) { in splitPenalty()
1846 Level = Right.getPrecedence(); in splitPenalty()
1855 const FormatToken &Right) { in spaceRequiredBetween() argument
1856 if (Left.is(tok::kw_return) && Right.isNot(tok::semi)) in spaceRequiredBetween()
1861 if (Right.is(tok::hashhash)) in spaceRequiredBetween()
1864 return Right.is(tok::hash); in spaceRequiredBetween()
1865 if (Left.is(tok::l_paren) && Right.is(tok::r_paren)) in spaceRequiredBetween()
1867 if (Left.is(tok::l_paren) || Right.is(tok::r_paren)) in spaceRequiredBetween()
1868 return (Right.is(TT_CastRParen) || in spaceRequiredBetween()
1872 if (Right.isOneOf(tok::semi, tok::comma)) in spaceRequiredBetween()
1874 if (Right.is(tok::less) && in spaceRequiredBetween()
1881 Right.isOneOf(tok::identifier, tok::string_literal, tok::char_constant, in spaceRequiredBetween()
1887 if (Left.is(tok::less) || Right.isOneOf(tok::greater, tok::less)) in spaceRequiredBetween()
1889 if (Right.is(tok::ellipsis)) in spaceRequiredBetween()
1891 if (Left.is(tok::l_square) && Right.is(tok::amp)) in spaceRequiredBetween()
1893 if (Right.is(TT_PointerOrReference)) in spaceRequiredBetween()
1902 if (Right.is(TT_FunctionTypeLParen) && Left.isNot(tok::l_paren) && in spaceRequiredBetween()
1908 return Right.Tok.isLiteral() || in spaceRequiredBetween()
1909 Right.isOneOf(TT_BlockComment, Keywords.kw_final, in spaceRequiredBetween()
1911 (Right.is(tok::l_brace) && Right.BlockKind == BK_Block) || in spaceRequiredBetween()
1912 (!Right.isOneOf(TT_PointerOrReference, TT_ArraySubscriptLSquare, in spaceRequiredBetween()
1918 if (Right.is(tok::star) && Left.is(tok::l_paren)) in spaceRequiredBetween()
1922 Style.SpacesInContainerLiterals && Right.isNot(tok::r_square)) || in spaceRequiredBetween()
1924 Right.isNot(tok::r_square)); in spaceRequiredBetween()
1925 if (Right.is(tok::r_square)) in spaceRequiredBetween()
1926 return Right.MatchingParen && in spaceRequiredBetween()
1928 Right.MatchingParen->is(TT_ArrayInitializerLSquare)) || in spaceRequiredBetween()
1930 Right.MatchingParen->is(TT_ArraySubscriptLSquare))); in spaceRequiredBetween()
1931 if (Right.is(tok::l_square) && in spaceRequiredBetween()
1932 !Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare) && in spaceRequiredBetween()
1937 if (Left.is(tok::l_brace) && Right.is(tok::r_brace)) in spaceRequiredBetween()
1940 (Right.is(tok::r_brace) && Right.MatchingParen && in spaceRequiredBetween()
1941 Right.MatchingParen->BlockKind != BK_Block)) in spaceRequiredBetween()
1945 if (Right.is(tok::l_paren)) { in spaceRequiredBetween()
1961 if (Left.is(tok::at) && Right.Tok.getObjCKeywordID() != tok::objc_not_keyword) in spaceRequiredBetween()
1963 if (Right.is(TT_UnaryOperator)) in spaceRequiredBetween()
1969 Right.is(tok::l_brace) && Right.getNextNonComment() && in spaceRequiredBetween()
1970 Right.BlockKind != BK_Block) in spaceRequiredBetween()
1972 if (Left.is(tok::period) || Right.is(tok::period)) in spaceRequiredBetween()
1974 if (Right.is(tok::hash) && Left.is(tok::identifier) && Left.TokenText == "L") in spaceRequiredBetween()
1981 if (Left.is(TT_TemplateCloser) && Right.is(tok::l_square)) in spaceRequiredBetween()
1987 const FormatToken &Right) { in spaceRequiredBefore() argument
1988 const FormatToken &Left = *Right.Previous; in spaceRequiredBefore()
1989 if (Right.Tok.getIdentifierInfo() && Left.Tok.getIdentifierInfo()) in spaceRequiredBefore()
1993 return Right.is(tok::coloncolon); in spaceRequiredBefore()
1995 if (Right.is(tok::period) && in spaceRequiredBefore()
1999 if (Right.is(tok::l_paren) && in spaceRequiredBefore()
2006 if (Right.isOneOf(TT_JsTypeColon, TT_JsTypeOptionalQuestion)) in spaceRequiredBefore()
2008 if ((Left.is(tok::l_brace) || Right.is(tok::r_brace)) && in spaceRequiredBefore()
2014 !Right.isOneOf(tok::equal, tok::l_brace, tok::comma, tok::l_square, in spaceRequiredBefore()
2021 if (Left.is(tok::r_square) && Right.is(tok::l_brace)) in spaceRequiredBefore()
2023 if (Left.is(Keywords.kw_synchronized) && Right.is(tok::l_paren)) in spaceRequiredBefore()
2029 Right.is(TT_TemplateOpener)) in spaceRequiredBefore()
2033 return Right.WhitespaceRange.getBegin() != Right.WhitespaceRange.getEnd(); in spaceRequiredBefore()
2037 if (Left.is(tok::r_paren) && Right.is(tok::identifier)) in spaceRequiredBefore()
2042 (Right.is(tok::equal) || Left.is(tok::equal))) in spaceRequiredBefore()
2045 if (Right.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow) || in spaceRequiredBefore()
2050 if (Right.is(tok::comma)) in spaceRequiredBefore()
2052 if (Right.isOneOf(TT_CtorInitializerColon, TT_ObjCBlockLParen)) in spaceRequiredBefore()
2054 if (Right.is(TT_OverloadedOperatorLParen)) in spaceRequiredBefore()
2056 if (Right.is(tok::colon)) { in spaceRequiredBefore()
2058 !Right.getNextNonComment() || Right.getNextNonComment()->is(tok::semi)) in spaceRequiredBefore()
2060 if (Right.is(TT_ObjCMethodExpr)) in spaceRequiredBefore()
2064 if (Right.is(TT_InlineASMColon) && Left.is(tok::coloncolon)) in spaceRequiredBefore()
2066 if (Right.is(TT_DictLiteral)) in spaceRequiredBefore()
2071 return Right.is(TT_BinaryOperator); in spaceRequiredBefore()
2077 Right.isOneOf(TT_BinaryOperator, TT_SelectorName); in spaceRequiredBefore()
2079 if (Left.is(tok::greater) && Right.is(tok::greater)) in spaceRequiredBefore()
2080 return Right.is(TT_TemplateCloser) && Left.is(TT_TemplateCloser) && in spaceRequiredBefore()
2082 if (Right.isOneOf(tok::arrow, tok::period, tok::arrowstar, tok::periodstar) || in spaceRequiredBefore()
2086 Right.getPrecedence() == prec::Assignment) in spaceRequiredBefore()
2088 if (Right.is(tok::coloncolon) && Left.isNot(tok::l_brace)) in spaceRequiredBefore()
2093 if ((Left.is(TT_TemplateOpener)) != (Right.is(TT_TemplateCloser))) in spaceRequiredBefore()
2095 if ((Right.is(TT_BinaryOperator) && !Left.is(tok::l_paren)) || in spaceRequiredBefore()
2097 !Right.is(tok::r_paren))) in spaceRequiredBefore()
2099 if (Left.is(TT_TemplateCloser) && Right.is(tok::l_paren) && in spaceRequiredBefore()
2100 Right.isNot(TT_FunctionTypeLParen)) in spaceRequiredBefore()
2102 if (Right.is(TT_TemplateOpener) && Left.is(tok::r_paren) && in spaceRequiredBefore()
2105 if (Right.is(tok::less) && Left.isNot(tok::l_paren) && in spaceRequiredBefore()
2108 if (Right.is(TT_TrailingUnaryOperator)) in spaceRequiredBefore()
2112 return spaceRequiredBetween(Line, Left, Right); in spaceRequiredBefore()
2122 const FormatToken &Right) { in mustBreakBefore() argument
2123 const FormatToken &Left = *Right.Previous; in mustBreakBefore()
2124 if (Right.NewlinesBefore > 1 && Style.MaxEmptyLinesToKeep > 0) in mustBreakBefore()
2129 if (Right.is(tok::char_constant) && Left.is(tok::plus) && Left.Previous && in mustBreakBefore()
2148 if (Right.is(tok::r_brace) && Left.is(tok::l_brace) && in mustBreakBefore()
2157 if (Right.is(tok::plus) && Left.is(tok::string_literal) && Right.Next && in mustBreakBefore()
2158 Right.Next->is(tok::string_literal)) in mustBreakBefore()
2169 else if (Right.MatchingParen && in mustBreakBefore()
2170 Right.MatchingParen->isOneOf(tok::l_brace, in mustBreakBefore()
2177 if (Right.is(tok::comment)) in mustBreakBefore()
2180 (Right.NewlinesBefore > 0 && Right.HasUnescapedNewline); in mustBreakBefore()
2184 (Right.isStringLiteral() || Right.is(TT_ObjCStringLiteral))) in mustBreakBefore()
2186 if (Right.Previous->IsUnterminatedLiteral) in mustBreakBefore()
2188 if (Right.is(tok::lessless) && Right.Next && in mustBreakBefore()
2189 Right.Previous->is(tok::string_literal) && in mustBreakBefore()
2190 Right.Next->is(tok::string_literal)) in mustBreakBefore()
2192 if (Right.Previous->ClosesTemplateDeclaration && in mustBreakBefore()
2193 Right.Previous->MatchingParen && in mustBreakBefore()
2194 Right.Previous->MatchingParen->NestingLevel == 0 && in mustBreakBefore()
2197 if ((Right.isOneOf(TT_CtorInitializerComma, TT_CtorInitializerColon)) && in mustBreakBefore()
2201 if (Right.is(tok::string_literal) && Right.TokenText.startswith("R\"")) in mustBreakBefore()
2205 return Right.NewlinesBefore > 0; in mustBreakBefore()
2206 if (Right.Previous->is(tok::l_brace) && Right.NestingLevel == 1 && in mustBreakBefore()
2210 if (Right.is(TT_InlineASMBrace)) in mustBreakBefore()
2211 return Right.HasUnescapedNewline; in mustBreakBefore()
2212 if (isAllmanBrace(Left) || isAllmanBrace(Right)) in mustBreakBefore()
2217 Right.is(TT_SelectorName)) in mustBreakBefore()
2225 Right.isNot(TT_LeadingJavaAnnotation) && Right.isNot(tok::l_paren) && in mustBreakBefore()
2233 const FormatToken &Right) { in canBreakBefore() argument
2234 const FormatToken &Left = *Right.Previous; in canBreakBefore()
2241 if (Right.isOneOf(Keywords.kw_throws, Keywords.kw_extends, in canBreakBefore()
2245 if (Left.is(TT_JsFatArrow) && Right.is(tok::l_brace)) in canBreakBefore()
2256 return !Right.is(tok::l_paren); in canBreakBefore()
2257 if (Right.is(TT_PointerOrReference)) in canBreakBefore()
2260 (!Right.Next || Right.Next->isNot(TT_FunctionDeclarationName))); in canBreakBefore()
2261 if (Right.isOneOf(TT_StartOfName, TT_FunctionDeclarationName) || in canBreakBefore()
2262 Right.is(tok::kw_operator)) in canBreakBefore()
2266 if (Right.isTrailingComment()) in canBreakBefore()
2273 if (Left.is(tok::question) && Right.is(tok::colon)) in canBreakBefore()
2275 if (Right.is(TT_ConditionalExpr) || Right.is(tok::question)) in canBreakBefore()
2279 if (Right.is(TT_InheritanceColon)) in canBreakBefore()
2281 if (Right.is(tok::colon) && in canBreakBefore()
2282 !Right.isOneOf(TT_CtorInitializerColon, TT_InlineASMColon)) in canBreakBefore()
2286 if (Right.is(TT_SelectorName) || (Right.is(tok::identifier) && Right.Next && in canBreakBefore()
2287 Right.Next->is(TT_ObjCMethodExpr))) in canBreakBefore()
2293 if (Right.isOneOf(TT_RangeBasedForLoopColon, TT_OverloadedOperatorLParen, in canBreakBefore()
2298 if (Right.is(TT_RangeBasedForLoopColon)) in canBreakBefore()
2303 if (Left.is(tok::equal) && !Right.isOneOf(tok::kw_default, tok::kw_delete) && in canBreakBefore()
2311 if (Right.is(TT_ImplicitStringLiteral)) in canBreakBefore()
2314 if (Right.is(tok::r_paren) || Right.is(TT_TemplateCloser)) in canBreakBefore()
2316 if (Right.is(tok::r_square) && Right.MatchingParen && in canBreakBefore()
2317 Right.MatchingParen->is(TT_LambdaLSquare)) in canBreakBefore()
2322 if (Right.is(tok::r_brace)) in canBreakBefore()
2323 return Right.MatchingParen && Right.MatchingParen->BlockKind == BK_Block; in canBreakBefore()
2328 return !Right.isOneOf(tok::l_brace, tok::semi, tok::equal, tok::l_paren, in canBreakBefore()
2331 if (Right.is(tok::kw___attribute)) in canBreakBefore()
2334 if (Left.is(tok::identifier) && Right.is(tok::string_literal)) in canBreakBefore()
2337 if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral)) in canBreakBefore()
2343 if (Right.is(TT_CtorInitializerComma) && in canBreakBefore()
2346 if ((Left.is(tok::greater) && Right.is(tok::greater)) || in canBreakBefore()
2347 (Left.is(tok::less) && Right.is(tok::less))) in canBreakBefore()
2349 if (Right.is(TT_BinaryOperator) && in canBreakBefore()
2352 Right.getPrecedence() != prec::Assignment)) in canBreakBefore()
2356 if (Right.is(tok::kw_typename) && Left.isNot(tok::kw_const)) in canBreakBefore()
2366 Right.isMemberAccess() || in canBreakBefore()
2367 Right.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow, tok::lessless, in canBreakBefore()
2370 Right.isOneOf(tok::identifier, tok::kw_const)) || in canBreakBefore()
2371 (Left.is(tok::l_paren) && !Right.is(tok::r_paren)); in canBreakBefore()