Home | History | Annotate | Download | only in Format

Lines Matching full:right

158       // categorize it as an unary operator, so set the right type here.
1074 // declarations. Thus, having an identifier on the right-hand side
1515 const FormatToken &Right = Tok;
1521 if (Right.isOneOf(Keywords.kw_extends, Keywords.kw_throws))
1523 if (Right.is(Keywords.kw_implements))
1528 if (Right.is(Keywords.kw_function))
1532 if (Left.is(tok::comma) || (Right.is(tok::identifier) && Right.Next &&
1533 Right.Next->is(TT_DictLiteral)))
1535 if (Right.is(tok::l_square)) {
1538 if (!Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare))
1542 if (Right.isOneOf(TT_StartOfName, TT_FunctionDeclarationName) ||
1543 Right.is(tok::kw_operator)) {
1544 if (Line.First->is(tok::kw_for) && Right.PartOfMultiVariableDeclStmt)
1548 if (InFunctionDecl && Right.NestingLevel == 0)
1552 if (Right.is(TT_PointerOrReference))
1554 if (Right.is(TT_TrailingReturnArrow))
1556 if (Left.is(tok::equal) && Right.is(tok::l_brace))
1561 (Right.is(tok::period) && Style.Language == FormatStyle::LK_Proto))
1569 if (Right.isMemberAccess()) {
1576 if (Right.is(TT_TrailingAnnotation) &&
1577 (!Right.Next || Right.Next->isNot(tok::l_paren))) {
1588 bool is_short_annotation = Right.TokenText.size() < 10;
1598 if (Right.is(TT_SelectorName))
1609 if (Right.is(tok::r_brace))
1622 if (Right.is(tok::lessless)) {
1647 const FormatToken &Right) {
1648 if (Left.is(tok::kw_return) && Right.isNot(tok::semi))
1653 if (Right.is(tok::hashhash))
1656 return Right.is(tok::hash);
1657 if (Left.is(tok::l_paren) && Right.is(tok::r_paren))
1659 if (Left.is(tok::l_paren) || Right.is(tok::r_paren))
1660 return (Right.is(TT_CastRParen) ||
1664 if (Right.isOneOf(tok::semi, tok::comma))
1666 if (Right.is(tok::less) &&
1673 Right.isOneOf(tok::identifier, tok::string_literal, tok::char_constant,
1679 if (Left.is(tok::less) || Right.isOneOf(tok::greater, tok::less))
1681 if (Right.is(tok::ellipsis))
1683 if (Left.is(tok::l_square) && Right.is(tok::amp))
1685 if (Right.is(TT_PointerOrReference))
1695 if (Right.is(TT_FunctionTypeLParen) && Left.isNot(tok::l_paren) &&
1701 return Right.Tok.isLiteral() || Right.is(TT_BlockComment) ||
1702 (!Right.isOneOf(TT_PointerOrReference, tok::l_paren) &&
1707 if (Right.is(tok::star) && Left.is(tok::l_paren))
1711 Style.SpacesInContainerLiterals && Right.isNot(tok::r_square)) ||
1713 Right.isNot(tok::r_square));
1714 if (Right.is(tok::r_square))
1715 return Right.MatchingParen &&
1717 Right.MatchingParen->is(TT_ArrayInitializerLSquare)) ||
1719 Right.MatchingParen->is(TT_ArraySubscriptLSquare)));
1720 if (Right.is(tok::l_square) &&
1721 !Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare) &&
1726 if (Left.is(tok::l_brace) && Right.is(tok::r_brace))
1729 (Right.is(tok::r_brace) && Right.MatchingParen &&
1730 Right.MatchingParen->BlockKind != BK_Block))
1734 if (Right.is(tok::l_paren)) {
1749 if (Left.is(tok::at) && Right.Tok.getObjCKeywordID() != tok::objc_not_keyword)
1751 if (Right.is(TT_UnaryOperator))
1757 Right.is(tok::l_brace) && Right.getNextNonComment() &&
1758 Right.BlockKind != BK_Block)
1760 if (Left.is(tok::period) || Right.is(tok::period))
1762 if (Right.is(tok::hash) && Left.is(tok::identifier) && Left.TokenText == "L")
1769 if (Left.is(TT_TemplateCloser) && Right.is(tok::l_square))
1775 const FormatToken &Right) {
1776 const FormatToken &Left = *Right.Previous;
1778 if (Right.is(tok::period) &&
1782 if (Right.is(tok::l_paren) &&
1788 if (Right.isOneOf(TT_JsTypeColon, TT_JsTypeOptionalQuestion))
1790 if ((Left.is(tok::l_brace) || Right.is(tok::r_brace)) &&
1794 !Right.isOneOf(tok::l_brace, tok::comma, tok::l_square,
1801 if (Left.is(tok::r_square) && Right.is(tok::l_brace))
1803 if (Left.is(TT_LambdaArrow) || Right.is(TT_LambdaArrow))
1805 if (Left.is(Keywords.kw_synchronized) && Right.is(tok::l_paren))
1811 Right.is(TT_TemplateOpener))
1814 if (Right.Tok.getIdentifierInfo() && Left.Tok.getIdentifierInfo())
1817 return Right.WhitespaceRange.getBegin() != Right.WhitespaceRange.getEnd();
1821 if (Left.is(tok::r_paren) && Right.is(tok::identifier))
1826 (Right.is(tok::equal) || Left.is(tok::equal)))
1829 if (Right.is(TT_TrailingReturnArrow) || Left.is(TT_TrailingReturnArrow))
1833 if (Right.is(tok::comma))
1835 if (Right.isOneOf(TT_CtorInitializerColon, TT_ObjCBlockLParen))
1838 return Right.is(tok::coloncolon);
1839 if (Right.is(TT_OverloadedOperatorLParen))
1841 if (Right.is(tok::colon))
1843 Right.getNextNonComment() && Right.isNot(TT_ObjCMethodExpr) &&
1845 !(Right.is(TT_InlineASMColon) && Left.is(tok::coloncolon)) &&
1846 (Right.isNot(TT_DictLiteral) || Style.SpacesInContainerLiterals);
1848 return Right.is(TT_BinaryOperator);
1850 return Style.SpaceAfterCStyleCast || Right.is(TT_BinaryOperator);
1851 if (Left.is(tok::greater) && Right.is(tok::greater)) {
1852 return Right.is(TT_TemplateCloser) && Left.is(TT_TemplateCloser) &&
1855 if (Right.isOneOf(tok::arrow, tok::period, tok::arrowstar, tok::periodstar) ||
1859 Right.getPrecedence() == prec::Assignment)
1861 if (Right.is(tok::coloncolon) && Left.isNot(tok::l_brace))
1866 if ((Left.is(TT_TemplateOpener)) != (Right.is(TT_TemplateCloser)))
1868 if ((Right.is(TT_BinaryOperator) && !Left.is(tok::l_paren)) ||
1871 if (Left.is(TT_TemplateCloser) && Right.is(tok::l_paren) &&
1872 Right.isNot(TT_FunctionTypeLParen))
1874 if (Right.is(TT_TemplateOpener) && Left.is(tok::r_paren) &&
1877 if (Right.is(tok::less) && Left.isNot(tok::l_paren) &&
1880 if (Right.is(TT_TrailingUnaryOperator))
1884 return spaceRequiredBetween(Line, Left, Right);
1894 const FormatToken &Right) {
1895 const FormatToken &Left = *Right.Previous;
1896 if (Right.NewlinesBefore > 1)
1906 else if (Right.MatchingParen &&
1907 Right.MatchingParen->isOneOf(tok::l_brace,
1914 if (Right.is(tok::comment))
1917 (Right.NewlinesBefore > 0 && Right.HasUnescapedNewline);
1918 if (Right.Previous->isTrailingComment() ||
1919 (Right.isStringLiteral() && Right.Previous->isStringLiteral()))
1921 if (Right.Previous->IsUnterminatedLiteral)
1923 if (Right.is(tok::lessless) && Right.Next &&
1924 Right.Previous->is(tok::string_literal) &&
1925 Right.Next->is(tok::string_literal))
1927 if (Right.Previous->ClosesTemplateDeclaration &&
1928 Right.Previous->MatchingParen &&
1929 Right.Previous->MatchingParen->NestingLevel == 0 &&
1932 if ((Right.isOneOf(TT_CtorInitializerComma, TT_CtorInitializerColon)) &&
1936 if (Right.is(tok::string_literal) && Right.TokenText.startswith("R\""))
1940 return Right.NewlinesBefore > 0;
1941 if (Right.Previous->is(tok::l_brace) && Right.NestingLevel == 1 &&
1945 if (Style.Language == FormatStyle::LK_JavaScript && Right.is(tok::r_brace) &&
1951 if (isAllmanBrace(Left) || isAllmanBrace(Right))
1955 Right.is(TT_SelectorName))
1963 Right.isNot(TT_LeadingJavaAnnotation) && Right.isNot(tok::l_paren) &&
1969 if (Right.is(tok::char_constant) && Left.is(tok::plus) && Left.Previous &&
1982 if (Right.is(tok::plus) && Left.is(tok::string_literal) && Right.Next &&
1983 Right.Next->is(tok::string_literal))
1991 const FormatToken &Right) {
1992 const FormatToken &Left = *Right.Previous;
1998 if (Right.isOneOf(Keywords.kw_throws, Keywords.kw_extends,
2008 return !Right.is(tok::l_paren);
2009 if (Right.is(TT_PointerOrReference))
2012 (!Right.Next || Right.Next->isNot(TT_FunctionDeclarationName)));
2013 if (Right.isOneOf(TT_StartOfName, TT_FunctionDeclarationName) ||
2014 Right.is(tok::kw_operator))
2018 if (Right.isTrailingComment())
2025 if (Left.is(tok::question) && Right.is(tok::colon))
2027 if (Right.is(TT_ConditionalExpr) || Right.is(tok::question))
2031 if (Right.is(TT_InheritanceColon))
2033 if (Right.is(tok::colon) &&
2034 !Right.isOneOf(TT_CtorInitializerColon, TT_InlineASMColon))
2038 if (Right.is(TT_SelectorName))
2044 if (Right.isOneOf(TT_RangeBasedForLoopColon, TT_OverloadedOperatorLParen,
2049 if (Right.is(TT_RangeBasedForLoopColon))
2061 if (Right.is(TT_ImplicitStringLiteral))
2064 if (Right.is(tok::r_paren) || Right.is(TT_TemplateCloser))
2069 if (Right.is(tok::r_brace))
2070 return Right.MatchingParen && Right.MatchingParen->BlockKind == BK_Block;
2075 return !Right.isOneOf(tok::l_brace, tok::semi, tok::equal, tok::l_paren,
2078 if (Right.is(tok::kw___attribute))
2081 if (Left.is(tok::identifier) && Right.is(tok::string_literal))
2084 if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral))
2090 if (Right.is(TT_CtorInitializerComma) &&
2093 if ((Left.is(tok::greater) && Right.is(tok::greater)) ||
2094 (Left.is(tok::less) && Right.is(tok::less)))
2096 if (Right.is(TT_BinaryOperator) &&
2099 Right.getPrecedence() != prec::Assignment))
2103 if (Right.is(tok::kw_typename) && Left.isNot(tok::kw_const))
2112 Right.isMemberAccess() ||
2113 Right.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow, tok::lessless,
2116 Right.isOneOf(tok::identifier, tok::kw_const)) ||
2117 (Left.is(tok::l_paren) && !Right.is(tok::r_paren));