reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/clang/lib/Format/AffectedRangeManager.cpp
  137       Line->First->is(tok::comment) && Line->First->Next == nullptr &&
  139       PreviousLine->Affected && PreviousLine->Last->is(tok::comment);
  142       Line->First->is(tok::r_brace) &&
tools/clang/lib/Format/ContinuationIndenter.cpp
  128   return Previous.is(tok::comma) && !Current.isTrailingComment() &&
  143            (LessTok.Previous && LessTok.Previous->is(tok::equal))));
  286   if (!Current.MustBreakBefore && Previous.is(tok::l_brace) &&
  305   if (Previous.is(tok::l_brace) && State.Stack.size() > 1 &&
  323   if (Previous.is(tok::l_square) && Previous.is(TT_ObjCMethodExpr))
  337   if (Previous.is(tok::semi) && State.LineContainsContinuedForLoopSection)
  344   if ((startsNextParameter(Current, Style) || Previous.is(tok::semi) ||
  359   if (((Previous.is(TT_DictLiteral) && Previous.is(tok::l_brace)) ||
  384   if (Current.is(TT_SelectorName) && !Previous.is(tok::at) &&
  420        Previous.is(tok::comma) || Current.NestingLevel < 2) &&
  457   if (Current.is(tok::lessless) && Current.isNot(TT_OverloadedOperator) &&
  480        (Current.is(tok::kw_operator) && !Previous.is(tok::coloncolon))) &&
  480        (Current.is(tok::kw_operator) && !Previous.is(tok::coloncolon))) &&
  481       !Previous.is(tok::kw_template) && State.Stack.back().BreakBeforeParameter)
  488       Previous.is(tok::l_brace) && !Current.isOneOf(tok::r_brace, tok::comment))
  491   if (Current.is(tok::lessless) &&
  492       ((Previous.is(tok::identifier) && Previous.TokenText == "endl") ||
  547   if (Current.is(tok::equal) &&
  548       (State.Line->First->is(tok::kw_for) || Current.NestingLevel == 0) &&
  568       Previous.is(tok::hash) && State.FirstIndent > 0 &&
  613        (Previous.is(tok::l_brace) && Previous.BlockKind != BK_Block &&
  643   if (Current.isMemberAccess() && Previous.is(tok::r_paren) &&
  659   if (!Current.is(tok::comment) && P &&
  661        (P->is(TT_ConditionalExpr) && P->is(tok::colon))) &&
  667         P->MustBreakBefore || P->is(tok::lessless) ||
  682   if (Current.isNot(tok::comment) && Previous.is(tok::l_paren) &&
  684       (Previous.Previous->is(tok::kw_for) || Previous.Previous->isIf())) {
  690              ((Previous.is(tok::comma) &&
  692               (Previous.is(tok::colon) && Previous.is(TT_ObjCMethodExpr)))) {
  754   if (NextNonComment->is(tok::lessless) &&
  775        !PreviousNonComment->is(tok::equal) ||
  799   } else if (PreviousNonComment && PreviousNonComment->is(tok::colon) &&
  825   if (NextNonComment->is(tok::question) ||
  826       (PreviousNonComment && PreviousNonComment->is(tok::question)))
  833     if (Current.is(tok::r_brace) && Current.MatchingParen &&
  852   if (Current.is(tok::lessless))
  864       !Style.isCpp() && Current.is(tok::r_brace) && State.Stack.size() > 1 &&
  938       State.Line->First->is(tok::kw_enum))
  942   if (NextNonComment->is(tok::l_brace) && NextNonComment->BlockKind == BK_Block)
  946        (Current.is(tok::greater) &&
  972   if (Current.is(tok::r_paren) && State.Stack.size() > 1 &&
  978   if (Current.is(tok::identifier) && Current.Next &&
  989   if (NextNonComment->is(tok::lessless) &&
  998       ((NextNonComment->is(tok::colon) &&
 1002   if (Previous.is(tok::comma) && State.Stack.back().VariablePos != 0)
 1038   if (NextNonComment->is(tok::colon) && NextNonComment->is(TT_ObjCMethodExpr))
 1048   if (NextNonComment->is(tok::identifier) && NextNonComment->FakeRParens == 0 &&
 1055   if (PreviousNonComment && PreviousNonComment->is(tok::colon) &&
 1069   if (Previous.is(tok::r_paren) && !Current.isBinaryOperator() &&
 1091   if (Current.is(tok::lessless) && Current.isNot(TT_OverloadedOperator)) {
 1105   if (Style.BreakBeforeTernaryOperators && Current.is(tok::question))
 1111     if (Previous && Previous->is(tok::question))
 1333                        Current.MatchingParen->Previous->is(tok::comma);
 1353     if (Current.is(tok::less) && Current.ParentBracket == tok::l_paren) {
 1361         Current.MatchingParen->getPreviousNonComment()->is(tok::comma);
 1424       Current.Previous->is(tok::at);
 1436        (Current.is(tok::r_brace) && State.NextToken != State.Line->First) ||
 1438        (Current.is(tok::greater) && Current.is(TT_DictLiteral))))
 1465   if (Current.is(tok::r_square)) {
 1564       (!Newline && Current.Next && Current.Next->is(tok::r_paren))
 1725   if (!Tok || !Tok->is(tok::l_paren))
 1735   if (!Tok || !Tok->is(tok::identifier))
tools/clang/lib/Format/Format.cpp
 1383           if (Tok->is(tok::coloncolon) && Tok->Previous->is(TT_TemplateOpener))
 1587         if (!Res->is(tok::comment) &&
 1596       if (Left->is(LK) && Right->is(RK)) {
 1596       if (Left->is(LK) && Right->is(RK)) {
 1774         if ((FormatTok->Previous && FormatTok->Previous->is(tok::at) &&
tools/clang/lib/Format/FormatToken.cpp
  192     if (ItemBegin->is(tok::l_brace))
  232   if (Token->NestingLevel != 0 && Token->is(tok::l_brace) && Commas.size() < 19)
tools/clang/lib/Format/FormatToken.h
  322     return is(K1) || is(K2);
  322     return is(K1) || is(K2);
  326     return is(K1) || isOneOf(K2, Ks...);
  328   template <typename T> bool isNot(T Kind) const { return !is(Kind); }
  331     return is(tok::kw_if) || endsSequence(tok::kw_constexpr, tok::kw_if) ||
  369            (!ColonRequired || (Next && Next->is(tok::colon)));
  376     return is(tok::at) && Next &&
  388     if (is(TT_DictLiteral) && is(tok::less))
  398     if (is(TT_DictLiteral) && is(tok::greater))
  433     return is(tok::comment) &&
  460     if (!is(tok::string_literal))
  489     while (Tok && Tok->is(tok::comment))
  497     while (Tok && Tok->is(tok::comment))
  508            (is(tok::l_brace) &&
  511            (is(tok::less) && (Style.Language == FormatStyle::LK_Proto ||
  525     return T && T->is(tok::kw_auto);
  539     if (is(tok::comment))
  557     if (is(tok::comment) && Next)
  559     return is(K1) && Next && Next->startsSequenceInternal(Tokens...);
  563     if (is(tok::comment) && Next)
  565     return is(K1);
  569     if (is(tok::comment) && Previous)
  571     return is(K1);
  576     if (is(tok::comment) && Previous)
  578     return is(K1) && Previous && Previous->endsSequenceInternal(Tokens...);
  895     return Tok.is(tok::identifier) &&
  950       return Tok.is(tok::identifier) &&
tools/clang/lib/Format/FormatTokenLexer.cpp
  136   if (!At->is(tok::at) || !String->is(tok::string_literal))
  136   if (!At->is(tok::at) || !String->is(tok::string_literal))
  154   if (!Hash->is(tok::hash) || !Identifier->is(tok::identifier))
  154   if (!Hash->is(tok::hash) || !Identifier->is(tok::identifier))
  176   if (!(At->is(tok::at) || At->TokenText == "$") ||
  177       !String->is(tok::string_literal))
  180   if (Tokens.size() >= 2 && At->is(tok::at)) {
  211   if (!FirstQuestion->is(tok::question) || !SecondQuestion->is(tok::question))
  211   if (!FirstQuestion->is(tok::question) || !SecondQuestion->is(tok::question))
  228   if (!At->is(tok::at))
  249       !Question->is(tok::question))
  264   if (!Identifier->is(tok::identifier))
  281     FourthTokenIsLess = (Tokens.end() - 4)[0]->is(tok::less);
  284   if (First[2]->is(tok::less) || First[1]->isNot(tok::less) ||
  307   if (!First[0]->is(Kinds[0]))
  311     if (!First[i]->is(Kinds[i]) || First[i]->WhitespaceRange.getBegin() !=
  421   if (BacktickToken->is(tok::l_brace)) {
  425   if (BacktickToken->is(tok::r_brace)) {
  432   } else if (BacktickToken->is(tok::unknown) &&
  510   if (!Last->is(tok::r_paren))
  514   if (!String->is(tok::string_literal) || String->IsMultiline)
  517   if (!Tokens[Tokens.size() - 3]->is(tok::l_paren))
  708       FormatTok->is(tok::comment) && FormatTok->TokenText.startswith("//")) {
  817     } else if (FormatTok->is(tok::identifier)) {
  835   if (Tok.is(tok::unknown)) {
  848       Tok.is(tok::char_constant)) {
  852   if (Tok.is(tok::comment) && (Tok.TokenText == "// clang-format on" ||
  859   if (Tok.is(tok::comment) && (Tok.TokenText == "// clang-format off" ||
tools/clang/lib/Format/NamespaceEndCommentsFixer.cpp
   40     assert(Tok && Tok->is(tok::l_paren) && "expected an opening parenthesis");
   52     while (Tok && !Tok->is(tok::l_brace) && !Tok->is(tok::coloncolon)) {
   52     while (Tok && !Tok->is(tok::l_brace) && !Tok->is(tok::coloncolon)) {
   58     while (Tok && !Tok->is(tok::l_brace)) {
   60       if (Tok->is(tok::kw_inline))
   85   return RBraceTok->Next && RBraceTok->Next->is(tok::comment);
  164   if (NamespaceTok->is(tok::l_brace)) {
  207     if (RBraceTok->Next && RBraceTok->Next->is(tok::semi)) {
  238     if (EndCommentNextTok && EndCommentNextTok->is(tok::comment))
tools/clang/lib/Format/SortJavaScriptImports.cpp
  216     while (Tok && Tok->is(tok::comment))
  335     Reference.IsExport = Current->is(tok::kw_export);
  396     if (Current->is(tok::identifier)) {
  410       if (Current->is(tok::r_brace))
tools/clang/lib/Format/TokenAnnotator.cpp
   48   if (Left->Previous && Left->Previous->is(tok::greater) &&
   54   return Left->Previous && Left->Previous->is(tok::r_square) &&
   85       if (Previous.Previous->is(tok::r_paren) && Contexts.size() > 1 &&
  106         CurrentToken->is(tok::question))
  110       if (CurrentToken->is(tok::greater)) {
  127       if (CurrentToken->is(tok::question) &&
  151           if (CurrentToken->is(tok::colon) ||
  178           MaybeSel->Previous->is(tok::at)) {
  214                (!Left->Previous || !Left->Previous->is(tok::identifier))) {
  219     } else if (Left->Previous && Left->Previous->is(tok::kw___attribute)) {
  252         Left->Previous && Left->Previous->is(tok::kw_for);
  264           if (PrevPrev && PrevPrev->is(tok::identifier) &&
  266               CurrentToken->is(tok::identifier) && Next->isNot(tok::equal)) {
  277       if (CurrentToken->is(tok::comma))
  281       if (CurrentToken->is(tok::r_paren)) {
  283             (CurrentToken->Next->is(tok::l_paren) ||
  284              (CurrentToken->Next->is(tok::l_square) && Line.MustBeDeclaration)))
  285           Left->Type = Left->Next->is(tok::caret) ? TT_ObjCBlockLParen
  290         if (CurrentToken->Next && CurrentToken->Next->is(tok::l_brace) &&
  291             Left->Previous && Left->Previous->is(tok::l_paren)) {
  332       if (CurrentToken->is(tok::l_brace))
  334       if (CurrentToken->is(tok::comma) && CurrentToken->Next &&
  340           !CurrentToken->is(tok::l_brace))
  355       if (CurrentToken->is(tok::comma))
  377     if (AttrTok->is(tok::r_square))
  412     if (Tok.Previous && Tok.Previous->is(tok::at)) {
  428       if (AttrTok->is(tok::colon) ||
  432       if (AttrTok->is(tok::ellipsis))
  501       } else if (CurrentToken->is(tok::r_square) && Parent &&
  565       if (CurrentToken->is(tok::r_square)) {
  571                    CurrentToken->Next->is(tok::l_paren)) ||
  627       if (CurrentToken->is(tok::colon)) {
  639           if (Parent && Parent->is(tok::r_paren))
  645       if (CurrentToken->is(tok::comma) && Left->is(TT_ObjCMethodExpr) &&
  674         if (CurrentToken->is(tok::r_brace)) {
  687           if ((CurrentToken->is(tok::colon) &&
  693                 Previous->is(tok::string_literal))
  696           if (CurrentToken->is(tok::colon) ||
  700         if (CurrentToken->is(tok::comma) &&
  714     if (Current->is(tok::l_brace) && Current->BlockKind == BK_Block)
  716     if (Current->is(tok::comma)) {
  728       if (CurrentToken->is(tok::colon)) {
  740     if (CurrentToken && CurrentToken->is(tok::less)) {
  796             Tok->Previous->is(tok::identifier) && Tok->Previous->is(TT_Unknown);
  801                BeforePrevious->is(tok::colon))) ||
  802             BeforePrevious->is(tok::r_square) ||
  818       } else if (CurrentToken && CurrentToken->is(tok::numeric_constant)) {
  830                    Tok->Next->Next->is(tok::colon)))) {
  848       if (Tok->is(tok::kw_if) && CurrentToken &&
  851       if (CurrentToken && CurrentToken->is(tok::l_paren)) {
  860         if ((Tok->Previous && Tok->Previous->is(tok::period)) ||
  861             (Tok->Next && Tok->Next->is(tok::colon)))
  877       if (Tok->Previous && Tok->Previous->is(tok::r_paren) &&
 1011     if (CurrentToken && CurrentToken->is(tok::less)) {
 1051     if (!CurrentToken || !CurrentToken->is(tok::l_paren))
 1112       if (Tok->is(tok::l_paren))
 1126     if (CurrentToken->is(tok::hash))
 1146     if (CurrentToken->is(tok::less) && Line.Last->is(tok::greater)) {
 1146     if (CurrentToken->is(tok::less) && Line.Last->is(tok::greater)) {
 1156       if (CurrentToken && CurrentToken->is(tok::identifier)) {
 1172       if (CurrentToken->is(tok::kw_virtual))
 1181         if (Line.First->is(tok::kw_export) &&
 1210     return Tok.TokenText == "goog" && Tok.Next && Tok.Next->is(tok::period) &&
 1217            Tok.Next->Next->Next && Tok.Next->Next->Next->is(tok::l_paren);
 1323     } else if (Current.is(tok::lessless) &&
 1324                (!Current.Previous || !Current.Previous->is(tok::kw_operator))) {
 1345     } else if (Current.is(tok::kw_new)) {
 1359       if (Current.is(tok::exclaim)) {
 1385     } else if (Current.is(tok::semi)) {
 1392     } else if (Current.is(tok::arrow) &&
 1395     } else if (Current.is(tok::arrow) && AutoFound && Line.MustBeDeclaration &&
 1397                !Current.Previous->is(tok::kw_operator)) {
 1407       if (Current.is(TT_UnaryOperator) && Current.is(tok::caret))
 1413     } else if (Current.is(tok::question)) {
 1424                (!Current.is(tok::greater) &&
 1427     } else if (Current.is(tok::comment)) {
 1438     } else if (Current.is(tok::r_paren)) {
 1450               if (BeforeParen->is(tok::identifier) &&
 1458     } else if (Current.is(tok::at) && Current.Next &&
 1475     } else if (Current.is(tok::period)) {
 1508       if (Current.Previous->is(tok::at) &&
 1516       } else if (Current.Previous->is(tok::period) &&
 1542     while (PreviousNotConst && PreviousNotConst->is(tok::kw_const))
 1548     bool IsPPKeyword = PreviousNotConst->is(tok::identifier) &&
 1550                        PreviousNotConst->Previous->is(tok::hash);
 1558     if (PreviousNotConst->is(tok::r_paren) && PreviousNotConst->MatchingParen &&
 1560         PreviousNotConst->MatchingParen->Previous->is(tok::kw_decltype))
 1583       if (LeftOfParens->is(tok::r_paren)) {
 1604     if (Tok.Next->is(tok::question))
 1617     if (Style.Language == FormatStyle::LK_Java && Tok.Next->is(tok::l_paren))
 1662     if (!NextIsUnary || Tok.Next->is(tok::plus) ||
 1688         (NextToken->is(tok::l_brace) && !NextToken->getNextNonComment()))
 1691     if (PrevToken->is(tok::coloncolon))
 1702     if (NextToken->is(tok::l_square) && NextToken->isNot(TT_LambdaLSquare))
 1704     if (NextToken->is(tok::kw_operator) && !IsExpression)
 1709     if (PrevToken->is(tok::r_paren) && PrevToken->MatchingParen) {
 1731     if (Tok.is(tok::ampamp) && NextToken && NextToken->is(tok::l_paren))
 1731     if (Tok.is(tok::ampamp) && NextToken && NextToken->is(tok::l_paren))
 1737     if (NextNextToken && NextNextToken->is(tok::arrow))
 1812     while (Current && (Current->is(tok::kw_return) ||
 1813                        (Current->is(tok::colon) &&
 1857            Precedence == prec::Assignment && Current->is(tok::colon))) {
 1906             NextNonComment->is(tok::less))))
 1915           (Current->is(tok::comment) && NextNonComment &&
 1927       if (Current->is(TT_BinaryOperator) || Current->is(tok::comma))
 1946       while (Previous->is(tok::comment) && Previous->Previous)
 1974     if (!Current || !Current->is(tok::question))
 2009       if (!Tok->is(tok::comment)) {
 2090         if (Next->Next && Next->Next->is(tok::l_square) && Next->Next->Next &&
 2091             Next->Next->Next->is(tok::r_square))
 2103   if (Current.is(tok::kw_operator)) {
 2104     if (Current.Previous && Current.Previous->is(tok::coloncolon))
 2113       } else if (Next->is(tok::coloncolon)) {
 2117         if (Next->is(tok::kw_operator)) {
 2121         if (!Next->is(tok::identifier))
 2123       } else if (Next->is(tok::l_paren)) {
 2132   if (!Next || !Next->is(tok::l_paren) || !Next->MatchingParen)
 2135   if (Line.Last->is(tok::l_brace))
 2149     if (Tok->is(tok::kw_const) || Tok->isSimpleTypeSpecifier() ||
 2217           if (Parameter->Previous && Parameter->Previous->is(tok::comma)) {
 2319   if (Left.is(tok::semi))
 2327     if (Left.is(tok::comma) && Left.NestingLevel == 0)
 2342   if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral))
 2344   if (Right.is(tok::l_square)) {
 2347     if (Left.is(tok::r_square))
 2350     if (Right.is(TT_LambdaLSquare) && Left.is(tok::equal))
 2358   if (Left.is(tok::coloncolon) ||
 2359       (Right.is(tok::period) && Style.Language == FormatStyle::LK_Proto))
 2362       Right.is(tok::kw_operator)) {
 2375   if (Left.is(tok::equal) && Right.is(tok::l_brace))
 2375   if (Left.is(tok::equal) && Right.is(tok::l_brace))
 2381   if (Left.is(tok::comment))
 2425     return (Left.is(tok::r_paren) ? 100 : 120) + (is_short_annotation ? 50 : 0);
 2429   if (Line.startsWith(tok::kw_for) && Left.is(tok::equal))
 2436   if (Left.is(tok::colon) && Left.is(TT_ObjCMethodExpr))
 2442   if (Line.Type == LT_ObjCDecl && Left.is(tok::l_paren) && Left.Previous &&
 2446   if (Left.is(tok::l_paren) && InFunctionDecl &&
 2449   if (Left.is(tok::l_paren) && Left.Previous &&
 2450       (Left.Previous->is(tok::kw_for) || Left.Previous->isIf()))
 2452   if (Left.is(tok::equal) && InFunctionDecl)
 2454   if (Right.is(tok::r_brace))
 2461     if (Left.is(tok::l_brace) && !Style.Cpp11BracedListStyle)
 2475   if (Right.is(tok::plus) && Left.isLabelString() &&
 2478   if (Left.is(tok::comma))
 2480   if (Right.is(tok::lessless) && Left.isLabelString() &&
 2483   if (Right.is(tok::lessless)) {
 2485     if (!Left.is(tok::r_paren) || Right.OperatorIndex > 0)
 2514   if (Left.is(tok::kw_return) && Right.isNot(tok::semi))
 2521   if (Right.is(tok::hashhash))
 2522     return Left.is(tok::hash);
 2524     return Right.is(tok::hash);
 2525   if ((Left.is(tok::l_paren) && Right.is(tok::r_paren)) ||
 2525   if ((Left.is(tok::l_paren) && Right.is(tok::r_paren)) ||
 2526       (Left.is(tok::l_brace) && Left.BlockKind != BK_Block &&
 2527        Right.is(tok::r_brace) && Right.BlockKind != BK_Block))
 2529   if (Left.is(tok::l_paren) || Right.is(tok::r_paren))
 2529   if (Left.is(tok::l_paren) || Right.is(tok::r_paren))
 2536   if (Right.is(tok::less) && Line.Type == LT_ObjCDecl) {
 2539                                 Right.MatchingParen->Next->is(tok::colon);
 2542   if (Right.is(tok::less) && Left.is(tok::kw_template))
 2542   if (Right.is(tok::less) && Left.is(tok::kw_template))
 2546   if (Left.is(tok::at) &&
 2551   if (Left.is(tok::colon))
 2553   if (Left.is(tok::coloncolon))
 2555   if (Left.is(tok::less) || Right.isOneOf(tok::greater, tok::less)) {
 2560       if (Left.is(tok::less) && Right.is(tok::greater))
 2560       if (Left.is(tok::less) && Right.is(tok::greater))
 2566   if (Right.is(tok::ellipsis))
 2567     return Left.Tok.isLiteral() || (Left.is(tok::identifier) && Left.Previous &&
 2568                                     Left.Previous->is(tok::kw_case));
 2569   if (Left.is(tok::l_square) && Right.is(tok::amp))
 2569   if (Left.is(tok::l_square) && Right.is(tok::amp))
 2572     if (Left.is(tok::r_paren) && Line.MightBeFunctionDecl) {
 2587                 (Left.NestingLevel == 1 && Line.First->is(tok::kw_for)))))));
 2598            (Right.is(tok::l_brace) && Right.BlockKind == BK_Block) ||
 2606   if (Right.is(tok::star) && Left.is(tok::l_paren))
 2606   if (Right.is(tok::star) && Left.is(tok::l_paren))
 2617   if (Left.is(tok::l_square))
 2623   if (Right.is(tok::r_square))
 2633   if (Right.is(tok::l_square) &&
 2639   if (Left.is(tok::l_brace) && Right.is(tok::r_brace))
 2639   if (Left.is(tok::l_brace) && Right.is(tok::r_brace))
 2641   if ((Left.is(tok::l_brace) && Left.BlockKind != BK_Block) ||
 2642       (Right.is(tok::r_brace) && Right.MatchingParen &&
 2649   if (Right.is(tok::l_paren)) {
 2650     if ((Left.is(tok::r_paren) && Left.is(TT_AttributeParen)) ||
 2651         (Left.is(tok::r_square) && Left.is(TT_AttributeSquare)))
 2653     return Line.Type == LT_ObjCDecl || Left.is(tok::semi) ||
 2663             (Left.is(tok::identifier) || Left.isFunctionLikeKeyword() ||
 2664              Left.is(tok::r_paren) || Left.isSimpleTypeSpecifier() ||
 2665              (Left.is(tok::r_square) && Left.MatchingParen &&
 2669   if (Left.is(tok::at) && Right.Tok.getObjCKeywordID() != tok::objc_not_keyword)
 2677       Right.is(tok::l_brace) && Right.getNextNonComment() &&
 2680   if (Left.is(tok::period) || Right.is(tok::period))
 2680   if (Left.is(tok::period) || Right.is(tok::period))
 2682   if (Right.is(tok::hash) && Left.is(tok::identifier) && Left.TokenText == "L")
 2682   if (Right.is(tok::hash) && Left.is(tok::identifier) && Left.TokenText == "L")
 2686       (Left.MatchingParen->Previous->is(tok::period) ||
 2687        Left.MatchingParen->Previous->is(tok::coloncolon)))
 2692   if (Left.is(TT_TemplateCloser) && Right.is(tok::l_square))
 2694   if (Left.is(tok::l_brace) && Left.endsSequence(TT_DictLiteral, tok::at))
 2697   if (Right.is(tok::r_brace) && Right.MatchingParen &&
 2704       (!Right.Next || Right.Next->is(tok::semi)))
 2718     if (Left.is(tok::kw_operator))
 2719       return Right.is(tok::coloncolon);
 2720     if (Right.is(tok::l_brace) && Right.BlockKind == BK_BracedInit &&
 2725     if (Right.is(tok::period) &&
 2729     if (Right.is(tok::l_paren) &&
 2735     if (Left.is(tok::slash) || Right.is(tok::slash))
 2735     if (Left.is(tok::slash) || Right.is(tok::slash))
 2742     if (Left.is(tok::percent))
 2746     if (Left.is(tok::numeric_constant) && Right.is(tok::percent))
 2746     if (Left.is(tok::numeric_constant) && Right.is(tok::percent))
 2753     if (Right.is(tok::l_paren))
 2754       if (Left.is(tok::kw_using))
 2760     if (Right.is(tok::l_paren) && Left.is(Keywords.kw_await) && Left.Previous &&
 2761         Left.Previous->is(tok::kw_for))
 2763     if (Left.is(Keywords.kw_async) && Right.is(tok::l_paren) &&
 2777     if (Left.is(tok::identifier) && Keywords.IsJavaScriptIdentifier(Left) &&
 2780     if (Right.is(tok::star) &&
 2787     if (Right.is(tok::l_paren)) {
 2793       if (Left.Previous && Left.Previous->is(tok::period) &&
 2813         (!Left.Previous || !Left.Previous->is(tok::period)))
 2816         Left.Previous->is(tok::period) && Right.is(tok::l_paren))
 2816         Left.Previous->is(tok::period) && Right.is(tok::l_paren))
 2821     if (Left.is(tok::kw_default) && Left.Previous &&
 2822         Left.Previous->is(tok::kw_export))
 2824     if (Left.is(Keywords.kw_is) && Right.is(tok::l_brace))
 2830     if ((Left.is(tok::l_brace) || Right.is(tok::r_brace)) &&
 2830     if ((Left.is(tok::l_brace) || Right.is(tok::r_brace)) &&
 2833     if (Left.is(tok::ellipsis))
 2848     if (Left.is(tok::r_square) && Right.is(tok::l_brace))
 2848     if (Left.is(tok::r_square) && Right.is(tok::l_brace))
 2850     if (Left.is(Keywords.kw_synchronized) && Right.is(tok::l_paren))
 2864     if (Left.is(tok::r_paren) && canBeObjCSelectorComponent(Right))
 2871       (Right.is(tok::equal) || Left.is(tok::equal)))
 2871       (Right.is(tok::equal) || Left.is(tok::equal)))
 2879   if (Left.is(tok::comma))
 2881   if (Right.is(tok::comma))
 2892   if (Right.is(tok::colon)) {
 2894         !Right.getNextNonComment() || Right.getNextNonComment()->is(tok::semi))
 2898     if (Left.is(tok::question))
 2900     if (Right.is(TT_InlineASMColon) && Left.is(tok::coloncolon))
 2912     if (!Right.is(tok::l_paren)) {
 2913       if (Left.is(tok::exclaim) && Left.TokenText == "not")
 2915       if (Left.is(tok::tilde) && Left.TokenText == "compl")
 2918     return (Style.SpaceAfterLogicalNot && Left.is(tok::exclaim)) ||
 2928   if (Left.is(tok::greater) && Right.is(tok::greater)) {
 2928   if (Left.is(tok::greater) && Right.is(tok::greater)) {
 2937       (Right.is(tok::period) && Right.isNot(TT_DesignatedInitializerPeriod)))
 2942   if (Style.Language == FormatStyle::LK_Java && Right.is(tok::coloncolon) &&
 2943       (Left.is(tok::identifier) || Left.is(tok::kw_this)))
 2943       (Left.is(tok::identifier) || Left.is(tok::kw_this)))
 2945   if (Right.is(tok::coloncolon) && Left.is(tok::identifier))
 2945   if (Right.is(tok::coloncolon) && Left.is(tok::identifier))
 2950   if (Right.is(tok::coloncolon) && !Left.isOneOf(tok::l_brace, tok::comment))
 2956            (Left.is(tok ::l_paren) && Style.SpacesInParentheses);
 2967   if ((Right.is(TT_BinaryOperator) && !Left.is(tok::l_paren)) ||
 2969        !Right.is(tok::r_paren)))
 2971   if (Left.is(TT_TemplateCloser) && Right.is(tok::l_paren) &&
 2974   if (Right.is(TT_TemplateOpener) && Left.is(tok::r_paren) &&
 2977   if (Right.is(tok::less) && Left.isNot(tok::l_paren) &&
 2989   return Tok.is(tok::l_brace) && Tok.BlockKind == BK_Block &&
 3001     if (Right.is(tok::string_literal) && Left.is(tok::plus) && Left.Previous &&
 3001     if (Right.is(tok::string_literal) && Left.is(tok::plus) && Left.Previous &&
 3002         Left.Previous->is(tok::string_literal))
 3004     if (Left.is(TT_DictLiteral) && Left.is(tok::l_brace) && Line.Level == 0 &&
 3005         Left.Previous && Left.Previous->is(tok::equal) &&
 3014     if (Left.is(tok::l_brace) && Line.Level == 0 &&
 3022     if (Right.is(tok::r_brace) && Left.is(tok::l_brace) &&
 3022     if (Right.is(tok::r_brace) && Left.is(tok::l_brace) &&
 3031     if (Right.is(tok::plus) && Left.is(tok::string_literal) && Right.Next &&
 3031     if (Right.is(tok::plus) && Left.is(tok::string_literal) && Right.Next &&
 3032         Right.Next->is(tok::string_literal))
 3051           Left.is(tok::l_paren))) &&
 3058                Right.MatchingParen->is(tok::l_paren))))
 3060     if (BeforeClosingBrace && (BeforeClosingBrace->is(tok::comma) ||
 3065   if (Right.is(tok::comment))
 3073   if (Right.is(tok::lessless) && Right.Next &&
 3074       Right.Previous->is(tok::string_literal) &&
 3075       Right.Next->is(tok::string_literal))
 3094   if (Right.is(tok::string_literal) && Right.TokenText.startswith("R\""))
 3099   if ((Right.Previous->is(tok::l_brace) ||
 3100        (Right.Previous->is(tok::less) && Right.Previous->Previous &&
 3101         Right.Previous->Previous->is(tok::equal))) &&
 3134       ((Left.is(TT_AttributeSquare) && Left.is(tok::r_square)) ||
 3135        (Left.is(tok::r_square) && Right.is(TT_AttributeSquare) &&
 3136         Right.is(tok::l_square))))
 3144       (Line.Last->is(tok::l_brace) || Style.BreakAfterJavaFieldAnnotations))
 3179       Right.is(TT_SelectorName) && !Right.is(tok::r_square) && Right.Next) {
 3182     if (Right.Previous && Right.Previous->is(tok::at))
 3189     if (LBrace && LBrace->is(tok::colon)) {
 3191       if (LBrace && LBrace->is(tok::at)) {
 3206         ((LBrace->is(tok::l_brace) &&
 3208            (LBrace->Next && LBrace->Next->is(tok::r_brace)))) ||
 3209          LBrace->is(TT_ArrayInitializerLSquare) || LBrace->is(tok::less))) {
 3240       Left.is(tok::l_paren) && Left.BlockParameterCount > 0 &&
 3289     if (Left.is(TT_JsFatArrow) && Right.is(tok::l_brace))
 3294     if (Left.is(tok::exclaim) && Right.is(tok::colon))
 3294     if (Left.is(tok::exclaim) && Right.is(tok::colon))
 3308       if (!Next || !Next->is(tok::colon))
 3342     if (Left.is(tok::identifier) && Right.is(TT_TemplateString)) {
 3349   if (Left.is(tok::at))
 3354     return !Right.is(tok::l_paren);
 3360       Right.is(tok::kw_operator))
 3373   if (Left.is(tok::question) && Right.is(tok::colon))
 3373   if (Left.is(tok::question) && Right.is(tok::colon))
 3375   if (Right.is(TT_ConditionalExpr) || Right.is(tok::question))
 3377   if (Left.is(TT_ConditionalExpr) || Left.is(tok::question))
 3383   if (Right.is(TT_ObjCMethodExpr) && !Right.is(tok::r_square) &&
 3387   if (Right.is(tok::colon) &&
 3390   if (Left.is(tok::colon) && Left.isOneOf(TT_DictLiteral, TT_ObjCMethodExpr)) {
 3419       if (((Right.is(tok::l_brace) || Right.is(tok::less)) &&
 3419       if (((Right.is(tok::l_brace) || Right.is(tok::less)) &&
 3426   if (Right.is(tok::r_square) && Right.MatchingParen &&
 3429   if (Right.is(TT_SelectorName) || (Right.is(tok::identifier) && Right.Next &&
 3432   if (Left.is(tok::r_paren) && Line.Type == LT_ObjCProperty)
 3446       Left.is(tok::kw_operator))
 3448   if (Left.is(tok::equal) && !Right.isOneOf(tok::kw_default, tok::kw_delete) &&
 3451   if (Left.is(tok::equal) && Right.is(tok::l_brace) &&
 3451   if (Left.is(tok::equal) && Right.is(tok::l_brace) &&
 3454   if (Left.is(tok::l_paren) && Left.is(TT_AttributeParen))
 3456   if (Left.is(tok::l_paren) && Left.Previous &&
 3462   if (Right.is(tok::r_paren) || Right.is(TT_TemplateCloser))
 3464   if (Right.is(tok::r_square) && Right.MatchingParen &&
 3470   if (Right.is(tok::r_brace))
 3479   if (Right.is(tok::kw___attribute) ||
 3480       (Right.is(tok::l_square) && Right.is(TT_AttributeSquare)))
 3483   if (Left.is(tok::identifier) && Right.is(tok::string_literal))
 3483   if (Left.is(tok::identifier) && Right.is(tok::string_literal))
 3486   if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral))
 3505   if ((Left.is(tok::greater) && Right.is(tok::greater)) ||
 3505   if ((Left.is(tok::greater) && Right.is(tok::greater)) ||
 3506       (Left.is(tok::less) && Right.is(tok::less)))
 3506       (Left.is(tok::less) && Right.is(tok::less)))
 3515   if (Right.is(tok::kw_typename) && Left.isNot(tok::kw_const))
 3523   if ((Left.is(TT_AttributeSquare) && Right.is(tok::l_square)) ||
 3524       (Left.is(tok::r_square) && Right.is(TT_AttributeSquare)))
 3531          (Left.is(tok::r_paren) &&
 3533          (Left.is(tok::l_paren) && !Right.is(tok::r_paren)) ||
 3533          (Left.is(tok::l_paren) && !Right.is(tok::r_paren)) ||
tools/clang/lib/Format/UnwrappedLineFormatter.cpp
   26          NextNext && NextNext->is(tok::l_brace);
   85     if ((!Line.First->is(tok::comment) || IndentForLevel[Line.Level] == -1) &&
  102          RootToken.Next && RootToken.Next->is(tok::colon)))
  225         I[1]->First->is(tok::r_brace))
  229     if (TheLine->Last->is(tok::l_brace) && TheLine->First == TheLine->Last &&
  231       bool EmptyBlock = I[1]->First->is(tok::r_brace);
  234       if (Tok && Tok->is(tok::comment))
  242       if (Tok && Tok->is(tok::kw_typedef))
  256          I[1]->First->is(tok::r_brace)) ||
  286           I[i + 1]->First->SpacesRequiredBefore = !I[i]->Last->is(tok::r_brace);
  301     if (TheLine->Last->is(tok::l_brace) && TheLine->First != TheLine->Last &&
  308     if (I[1]->First->is(tok::l_brace) &&
  311          (TheLine->First->is(tok::r_brace) && TheLine->First->Next &&
  322     } else if (I[1]->First->is(tok::l_brace) &&
  332     if (TheLine->First->is(tok::l_brace) && TheLine->First == TheLine->Last &&
  346     if (TheLine->First->is(tok::l_brace) && I != AnnotatedLines.begin() &&
  347         I[-1]->First->is(tok::at) && I[-1]->First->Next) {
  354     if (TheLine->First->is(tok::l_brace) && I != AnnotatedLines.begin() &&
  358     if (TheLine->Last->is(tok::l_brace)) {
  360                      (I[1]->First->is(tok::r_brace) &&
  380            I[2]->First->is(tok::r_brace))) {
  389     if (TheLine->First->is(tok::kw_if)) {
  431         I[1]->First->is(tok::l_brace) &&
  449           I[2]->First->is(tok::kw_else))
  462     if (I[0]->Last->is(tok::l_brace) || I[1]->First->is(tok::l_brace))
  462     if (I[0]->Last->is(tok::l_brace) || I[1]->First->is(tok::l_brace))
  481       if (Line->First->is(tok::comment)) {
  496       if (Line->Last->is(tok::comment))
  521         (Line.First->Next && Line.First->Next->is(tok::kw_else)))
  524     if (Line.First->is(tok::kw_default)) {
  526       if (Tok && Tok->is(tok::colon))
  539           !I[1]->First->is(tok::r_brace))
  545           I + 2 != E && !I[2]->First->is(tok::r_brace))
  550           !I[1]->First->is(tok::r_brace))
  556           I + 2 != E && !I[2]->First->is(tok::r_brace))
  568     if (Line.Last->is(tok::l_brace)) {
  570       if (Tok->is(tok::r_brace) && !Tok->MustBreakBefore &&
  572            Tok->getNextNonComment()->is(tok::semi))) {
  605           if (Tok->is(tok::l_brace) && Tok->BlockKind != BK_BracedInit)
  616         if (Tok->Next && Tok->Next->is(tok::kw_else))
  632     } else if (I[1]->First->is(tok::l_brace)) {
  643            I[2]->First->is(tok::r_brace))) {
  662         !I[1]->First->HasUnescapedNewline && !I[1]->First->is(tok::eof)) {
  786     if (Previous.is(tok::comment))
 1108         bool LastLine = Line->First->is(tok::eof);
 1182   if (RootToken.is(tok::eof)) {
 1192   if (RootToken.is(tok::r_brace) &&
 1194        (RootToken.Next->is(tok::semi) && !RootToken.Next->Next)) &&
 1208       PreviousLine->Last->is(tok::l_brace) &&
tools/clang/lib/Format/UnwrappedLineParser.cpp
   60   return FormatTok.is(tok::comment) && !FormatTok.TokenText.startswith("/*");
  360       } while (Next && Next->is(tok::comment));
  411     } while (NextTok->is(tok::comment));
  427         else if (PrevTok->is(tok::r_paren))
  460               (Style.isCpp() && NextTok->is(tok::l_paren)) ||
  464               (NextTok->is(tok::identifier) &&
  466               (NextTok->is(tok::semi) &&
  469           if (NextTok->is(tok::l_square)) {
  545   if (MacroBlock && FormatTok->is(tok::l_paren))
  566                  : !FormatTok->is(tok::r_brace)) {
  577   if (MacroBlock && FormatTok->is(tok::l_paren))
  609   return I->Tok->is(tok::l_paren);
  627   return I->Tok->is(tok::l_paren);
  634   if (InitialToken.is(tok::kw_class))
  636   if (InitialToken.is(tok::kw_union))
  638   if (InitialToken.is(tok::kw_struct))
  752   if (!IfDef && (FormatTok->is(tok::kw_false) || FormatTok->TokenText == "0"))
  763       if (!Line.Tokens.front().Tok->is(tok::comment)) {
  799       PeekNext->is(tok::eof) &&
  886   return FormatTok->is(tok::identifier) &&
  948   if (PreviousMustBeValue || Previous->is(tok::r_paren)) {
  953                                 return LineNode.Tok->is(tok::at);
  958   if (Next->is(tok::exclaim) && PreviousMustBeValue)
  968   if ((PreviousMustBeValue || Previous->is(tok::r_paren)) &&
  974   assert(!FormatTok->is(tok::l_brace));
  978     if (FormatTok->is(tok::string_literal))
  986     if (FormatTok->is(tok::l_brace)) {
  990         if (FormatTok->is(tok::r_brace)) {
 1034     if (FormatTok->is(tok::colon)) {
 1099         if (FormatTok->is(tok::kw_public))
 1101         if (!FormatTok->is(tok::string_literal))
 1104         if (FormatTok->is(tok::semi))
 1114       if (FormatTok->is(tok::colon)) {
 1201       if (Previous && Previous->is(tok::less)) {
 1233         if (FormatTok->is(tok::semi))
 1243           FormatTok->is(tok::kw_class))
 1271       if (FormatTok->is(tok::l_paren))
 1273       if (FormatTok->is(tok::l_brace))
 1353           (TokenCount == 2 && Line->Tokens.front().Tok->is(tok::comment))) {
 1361         bool FunctionLike = FormatTok->is(tok::l_paren);
 1384         if (FormatTok->is(tok::l_brace))
 1418   assert(FormatTok->is(tok::l_square));
 1519   if (FormatTok->is(tok::l_square)) {
 1535   if (FormatTok->is(tok::star)) {
 1541   if (FormatTok->is(tok::identifier))
 1550   if (FormatTok->is(tok::colon)) {
 1556     if (FormatTok->is(tok::l_brace))
 1563   if (FormatTok->is(tok::semi))
 1597         if (FormatTok->is(tok::l_brace)) {
 1602       if (FormatTok->is(tok::l_brace)) {
 1616       if (FormatTok->is(tok::l_brace)) {
 1628         if (FormatTok->is(tok::l_brace))
 1681       if (Style.Language == FormatStyle::LK_Java && FormatTok->is(tok::l_brace))
 1797       if (FormatTok->is(tok::eof))
 1810   if (FormatTok->is(tok::colon)) {
 1813     while (FormatTok->is(tok::identifier)) {
 1815       if (FormatTok->is(tok::l_paren))
 1817       if (FormatTok->is(tok::comma))
 1822   if (Style.Language == FormatStyle::LK_Java && FormatTok->is(tok::l_paren)) {
 1825   if (FormatTok->is(tok::l_brace)) {
 1833   } else if (!FormatTok->is(tok::kw_catch)) {
 1843     if (FormatTok->is(tok::at))
 1855       if (FormatTok->is(tok::l_paren)) {
 1886       if (FormatTok->is(tok::l_square))
 1910   assert(FormatTok->is(tok::kw_new) && "'new' expected");
 1922     if (FormatTok->is(tok::l_paren)) {
 1926       if (FormatTok->is(tok::l_brace))
 2001     if (FormatTok->is(tok::semi))
 2062   if (Style.Language == FormatStyle::LK_Proto && FormatTok->is(tok::equal))
 2074     if (FormatTok->is(tok::l_paren))
 2076     if (FormatTok->is(tok::identifier)) {
 2080       if (Style.isCpp() && FormatTok->is(tok::identifier))
 2104     if (FormatTok->is(tok::semi))
 2123     if (Tok->is(tok::r_brace))
 2150     if (FormatTok->is(tok::l_brace)) {
 2154     } else if (FormatTok->is(tok::l_paren)) {
 2156     } else if (FormatTok->is(tok::comma)) {
 2159     } else if (FormatTok->is(tok::semi)) {
 2163     } else if (FormatTok->is(tok::r_brace)) {
 2196       if (FormatTok->is(tok::l_brace)) {
 2202         FormatTok->is(tok::identifier) &&
 2222       if (FormatTok->is(tok::l_brace)) {
 2287     if (FormatTok->is(tok::l_brace)) {
 2291     } else if (FormatTok->is(tok::r_brace)) {
 2365   if (FormatTok->is(tok::l_paren))
 2393   assert(IsImport || FormatTok->is(tok::kw_export));
 2397   if (FormatTok->is(tok::kw_default))
 2419     if (FormatTok->is(tok::semi))
 2426     if (FormatTok->is(tok::l_brace)) {
 2438   if (FormatTok->is(tok::l_paren))
 2440   if (FormatTok->is(tok::semi))
 2586     if (PreviousToken && PreviousToken->is(tok::l_brace) &&
 2598   if (PreviousToken && PreviousToken->is(tok::l_brace)) {
tools/clang/lib/Format/UsingDeclarationsSorter.cpp
   88   assert(UsingTok && UsingTok->is(tok::kw_using) && "Expecting a using token");
   91   if (Tok && Tok->is(tok::kw_typename)) {
   95   if (Tok && Tok->is(tok::coloncolon)) {
  100   while (Tok && Tok->is(tok::identifier)) {
  201         FirstTok->is(tok::comment) ? FirstTok->getNextNonComment() : FirstTok;
tools/clang/lib/Format/WhitespaceManager.cpp
  167         (Changes[i].NewlinesBefore > 0 || Changes[i].Tok->is(tok::eof) ||
  168          (Changes[i].IsInsideToken && Changes[i].Tok->is(tok::comment))) &&
  169         Changes[i - 1].Tok->is(tok::comment) &&
  205   Changes.back().IsTrailingComment = Changes.back().Tok->is(tok::comment);
  216     if (Change.Tok->is(tok::comment)) {
  262            Changes[PreviousNonComment].Tok->is(tok::comment))
  387     if (Changes[i].Tok->is(tok::comma)) {
  492     if (Current->is(tok::r_paren) && Current->MatchingParen) {
  497     if (!Current || !Current->is(tok::identifier))
  571         return C.Tok->is(tok::equal);
  597           if (Next->is(tok::comment))
  643                                   Changes[i - 1].Tok->is(tok::r_brace) &&
  650         if (Changes[j].Tok->is(tok::comment))