Lines Matching refs:Next

93   const FormatToken *AttrTok = Tok.Next->Next;  in isCppAttribute()
113 AttrTok = AttrTok->Next; in isCppAttribute()
200 if (CurrentToken->Next && CurrentToken->Next->is(tok::greater) && in parseAngle()
203 CurrentToken->Next->getStartOfNonWhitespace().getLocWithOffset( in parseAngle()
222 if (CurrentToken->Next && CurrentToken->Next->Tok.isLiteral()) in parseAngle()
434 if (LookForDecls && CurrentToken->Next) { in parseParens()
438 FormatToken *Next = CurrentToken->Next; in parseParens() local
441 CurrentToken->is(tok::identifier) && Next->isNot(tok::equal)) { in parseParens()
459 ProbablyFunctionType && CurrentToken->Next && in parseParens()
460 (CurrentToken->Next->is(tok::l_paren) || in parseParens()
461 (CurrentToken->Next->is(tok::l_square) && in parseParens()
463 OpeningParen.setType(OpeningParen.Next->is(tok::caret) in parseParens()
470 if (CurrentToken->Next && CurrentToken->Next->is(tok::l_brace) && in parseParens()
476 Tok = Tok->Next) { in parseParens()
522 if (CurrentToken->is(tok::comma) && CurrentToken->Next && in parseParens()
523 !CurrentToken->Next->HasUnescapedNewline && in parseParens()
524 !CurrentToken->Next->isTrailingComment()) { in parseParens()
528 (CurrentToken->is(tok::l_paren) && CurrentToken->Next && in parseParens()
529 CurrentToken->Next->isOneOf(tok::star, tok::amp, tok::caret)); in parseParens()
577 const FormatToken *AttrTok = Tok.Next; in isCSharpAttributeSpecifier()
587 AttrTok = AttrTok->Next; in isCSharpAttributeSpecifier()
593 AttrTok = AttrTok->Next; in isCSharpAttributeSpecifier()
605 if (AttrTok->Next && in isCSharpAttributeSpecifier()
606 AttrTok->Next->startsSequence(tok::identifier, tok::l_paren)) { in isCSharpAttributeSpecifier()
751 } else if (((CurrentToken->Next && in parseSquare()
752 CurrentToken->Next->is(tok::l_paren)) || in parseSquare()
780 CurrentToken->Next && in parseSquare()
781 CurrentToken->Next->is(TT_TrailingReturnArrow)) { in parseSquare()
782 CurrentToken->Next->overwriteFixedType(TT_Unknown); in parseSquare()
1113 } else if (canBeObjCSelectorComponent(*Tok->Previous) && Tok->Next && in consumeToken()
1114 (Tok->Next->isOneOf(tok::r_paren, tok::comma) || in consumeToken()
1115 (canBeObjCSelectorComponent(*Tok->Next) && Tok->Next->Next && in consumeToken()
1116 Tok->Next->Next->is(tok::colon)))) { in consumeToken()
1149 (Tok->Next && Tok->Next->is(tok::colon))) { in consumeToken()
1298 auto Next = CurrentToken->getNextNonComment(); in consumeToken() local
1299 if (!Next) in consumeToken()
1301 if (Next->is(tok::less)) in consumeToken()
1326 if (Style.isJavaScript() && Tok->Next && in consumeToken()
1327 Tok->Next->isOneOf(tok::semi, tok::comma, tok::colon, tok::r_paren, in consumeToken()
1347 if (Tok->Next && in consumeToken()
1348 (Tok->Next->startsSequence(tok::question, tok::r_paren) || in consumeToken()
1349 Tok->Next->startsSequence(tok::question, tok::greater) || in consumeToken()
1350 Tok->Next->startsSequence(tok::question, tok::identifier, in consumeToken()
1357 if (Tok->Next && Tok->Next->is(tok::identifier) && Tok->Next->Next && in consumeToken()
1358 Tok->Next->Next->is(tok::equal)) { in consumeToken()
1369 (!Tok->Next || in consumeToken()
1370 !Tok->Next->isOneOf(tok::identifier, tok::string_literal) || in consumeToken()
1371 !Tok->Next->Next || in consumeToken()
1372 !Tok->Next->Next->isOneOf(tok::colon, tok::question))) { in consumeToken()
1419 if (Style.isCSharp() && Tok->is(Keywords.kw_where) && Tok->Next && in consumeToken()
1420 Tok->Next->isNot(tok::l_paren)) { in consumeToken()
1606 Info->getPPKeywordID() == tok::pp_import && CurrentToken->Next && in parseLine()
1607 CurrentToken->Next->isOneOf(tok::string_literal, tok::identifier, in parseLine()
1651 CurrentToken->is(Keywords.kw_from) && CurrentToken->Next && in parseLine()
1652 CurrentToken->Next->isStringLiteral()) { in parseLine()
1685 return Tok.TokenText == "goog" && Tok.Next && Tok.Next->is(tok::period) && in isClosureImportStatement()
1686 Tok.Next->Next && in isClosureImportStatement()
1687 (Tok.Next->Next->TokenText == "module" || in isClosureImportStatement()
1688 Tok.Next->Next->TokenText == "provide" || in isClosureImportStatement()
1689 Tok.Next->Next->TokenText == "require" || in isClosureImportStatement()
1690 Tok.Next->Next->TokenText == "requireType" || in isClosureImportStatement()
1691 Tok.Next->Next->TokenText == "forwardDeclare") && in isClosureImportStatement()
1692 Tok.Next->Next->Next && Tok.Next->Next->Next->is(tok::l_paren); in isClosureImportStatement()
1730 CurrentToken = CurrentToken->Next; in next()
1933 Current = Current->Next; in untilMatchingParen()
1943 FormatToken *TemplateCloser = Current.Next->Next; in isDeductionGuide()
1959 TemplateCloser = TemplateCloser->Next; in isDeductionGuide()
1963 if (TemplateCloser && TemplateCloser->Next && in isDeductionGuide()
1964 TemplateCloser->Next->is(tok::semi) && in isDeductionGuide()
1972 LeadingIdentifier->TokenText == Current.Next->TokenText; in isDeductionGuide()
2002 if (Current.Next && in determineTokenType()
2003 Current.Next->isOneOf(TT_BinaryOperator, Keywords.kw_as)) { in determineTokenType()
2109 if (Current.MatchingParen && Current.Next && in determineTokenType()
2110 !Current.Next->isBinaryOperator() && in determineTokenType()
2111 !Current.Next->isOneOf(tok::semi, tok::colon, tok::l_brace, in determineTokenType()
2114 if (FormatToken *AfterParen = Current.MatchingParen->Next; in determineTokenType()
2128 } else if (Current.is(tok::at) && Current.Next && !Style.isJavaScript() && in determineTokenType()
2132 switch (Current.Next->Tok.getObjCKeywordID()) { in determineTokenType()
2317 if (Tok.Previous == Tok.MatchingParen || !Tok.Next || !Tok.MatchingParen) in rParenEndsCast()
2379 if (Tok.Next->isOneOf(tok::question, tok::ampamp)) in rParenEndsCast()
2383 if (Tok.Next->is(Keywords.kw_in) && Style.isCSharp()) in rParenEndsCast()
2388 if (Tok.Next->isOneOf(tok::kw_noexcept, tok::kw_volatile, tok::kw_const, in rParenEndsCast()
2391 isCppAttribute(Style.isCpp(), *Tok.Next)) { in rParenEndsCast()
2397 if (Style.Language == FormatStyle::LK_Java && Tok.Next->is(tok::l_paren)) in rParenEndsCast()
2401 if (Tok.Next->isOneOf(tok::kw_sizeof, tok::kw_alignof) || in rParenEndsCast()
2402 (Tok.Next->Tok.isLiteral() && Tok.Next->isNot(tok::string_literal))) { in rParenEndsCast()
2444 Tok.Next->isOneOf(tok::equal, tok::semi, tok::l_brace, tok::greater); in rParenEndsCast()
2456 for (const FormatToken *Token = Tok.MatchingParen->Next; Token != &Tok; in rParenEndsCast()
2457 Token = Token->Next) { in rParenEndsCast()
2464 if (Tok.Next->isOneOf(tok::identifier, tok::kw_this)) in rParenEndsCast()
2468 if (Tok.Next->is(tok::l_paren) && Tok.Previous && Tok.Previous->Previous) { in rParenEndsCast()
2475 if (!Tok.Next->Next) in rParenEndsCast()
2481 const bool NextIsAmpOrStar = Tok.Next->isOneOf(tok::amp, tok::star); in rParenEndsCast()
2482 if (!(Tok.Next->isUnaryOperator() || NextIsAmpOrStar) || in rParenEndsCast()
2483 Tok.Next->is(tok::plus) || in rParenEndsCast()
2484 !Tok.Next->Next->isOneOf(tok::identifier, tok::numeric_constant)) { in rParenEndsCast()
2488 (Tok.Next->Next->is(tok::numeric_constant) || Line.InPPDirective)) { in rParenEndsCast()
2491 if (Line.InPPDirective && Tok.Next->is(tok::minus)) in rParenEndsCast()
2976 Current = Current->Next; in next()
2980 Current = Current->Next; in next()
3014 FormatToken *Next = Tok->getNextNonComment(); in verilogGroupDecl() local
3019 Tok = Next; in verilogGroupDecl()
3024 Tok = Next; in verilogGroupDecl()
3030 Tok = Next; in verilogGroupDecl()
3037 } else if (!Next) { in verilogGroupDecl()
3043 if (Next->isOneOf( in verilogGroupDecl()
3059 if (Next->is(tok::l_paren)) in verilogGroupDecl()
3060 Next = Next->MatchingParen; in verilogGroupDecl()
3061 if (Next) in verilogGroupDecl()
3062 Tok = Next->getNextNonComment(); in verilogGroupDecl()
3160 for (const auto *Tok = Line.First; Tok; Tok = Tok->Next) in maxNestingDepth()
3194 Tok = Tok->Next; in getFunctionName()
3201 assert(Tok->Next); in getFunctionName()
3202 Tok = Tok->Next->Next; in getFunctionName()
3209 Tok = Tok->Next; in getFunctionName()
3297 auto skipOperatorName = [](const FormatToken *Next) -> const FormatToken * { in isFunctionDeclarationName() argument
3298 for (; Next; Next = Next->Next) { in isFunctionDeclarationName()
3299 if (Next->is(TT_OverloadedOperatorLParen)) in isFunctionDeclarationName()
3300 return Next; in isFunctionDeclarationName()
3301 if (Next->is(TT_OverloadedOperator)) in isFunctionDeclarationName()
3303 if (Next->isOneOf(tok::kw_new, tok::kw_delete)) { in isFunctionDeclarationName()
3305 if (Next->Next && in isFunctionDeclarationName()
3306 Next->Next->startsSequence(tok::l_square, tok::r_square)) { in isFunctionDeclarationName()
3307 Next = Next->Next->Next; in isFunctionDeclarationName()
3311 if (Next->startsSequence(tok::l_square, tok::r_square)) { in isFunctionDeclarationName()
3313 Next = Next->Next; in isFunctionDeclarationName()
3316 if ((Next->isSimpleTypeSpecifier() || Next->is(tok::identifier)) && in isFunctionDeclarationName()
3317 Next->Next && Next->Next->isPointerOrReference()) { in isFunctionDeclarationName()
3319 Next = Next->Next; in isFunctionDeclarationName()
3322 if (Next->is(TT_TemplateOpener) && Next->MatchingParen) { in isFunctionDeclarationName()
3323 Next = Next->MatchingParen; in isFunctionDeclarationName()
3333 const FormatToken *Next = Current.Next; in isFunctionDeclarationName() local
3348 Next = skipOperatorName(Next); in isFunctionDeclarationName()
3352 for (; Next; Next = Next->Next) { in isFunctionDeclarationName()
3353 if (Next->is(TT_TemplateOpener) && Next->MatchingParen) { in isFunctionDeclarationName()
3354 Next = Next->MatchingParen; in isFunctionDeclarationName()
3355 } else if (Next->is(tok::coloncolon)) { in isFunctionDeclarationName()
3356 Next = Next->Next; in isFunctionDeclarationName()
3357 if (!Next) in isFunctionDeclarationName()
3359 if (Next->is(tok::kw_operator)) { in isFunctionDeclarationName()
3360 Next = skipOperatorName(Next->Next); in isFunctionDeclarationName()
3363 if (Next->isNot(tok::identifier)) in isFunctionDeclarationName()
3365 } else if (isCppAttribute(IsCpp, *Next)) { in isFunctionDeclarationName()
3366 Next = Next->MatchingParen; in isFunctionDeclarationName()
3367 if (!Next) in isFunctionDeclarationName()
3369 } else if (Next->is(tok::l_paren)) { in isFunctionDeclarationName()
3378 if (!Next || Next->isNot(tok::l_paren) || !Next->MatchingParen) in isFunctionDeclarationName()
3380 ClosingParen = Next->MatchingParen; in isFunctionDeclarationName()
3385 if (Next->Next == ClosingParen) in isFunctionDeclarationName()
3388 if (ClosingParen->Next && ClosingParen->Next->is(TT_PointerOrReference)) in isFunctionDeclarationName()
3401 if (IsCpp && Next->Next && Next->Next->is(tok::identifier) && in isFunctionDeclarationName()
3406 for (const FormatToken *Tok = Next->Next; Tok && Tok != ClosingParen; in isFunctionDeclarationName()
3407 Tok = Tok->Next) { in isFunctionDeclarationName()
3457 FormatToken *Current = First->Next; in calculateFormattingInformation()
3471 for (auto *Tok = Current; Tok; Tok = Tok->Next) { in calculateFormattingInformation()
3510 for (const auto *Tok = First; Tok; Tok = Tok->Next) { in calculateFormattingInformation()
3514 Tok = Tok->Next; in calculateFormattingInformation()
3519 for (Tok = Tok->Next; Tok && Tok != LeftParen->MatchingParen; in calculateFormattingInformation()
3520 Tok = Tok->Next) { in calculateFormattingInformation()
3523 auto *Next = Tok->Next; in calculateFormattingInformation() local
3525 Next && Next->isPointerOrReference() && Next->Next && in calculateFormattingInformation()
3526 Next->Next->is(tok::identifier); in calculateFormattingInformation()
3529 Next->setType(TT_BinaryOperator); in calculateFormattingInformation()
3530 Tok = Next; in calculateFormattingInformation()
3534 for (auto *Tok = ClosingParen->Next; Tok; Tok = Tok->Next) { in calculateFormattingInformation()
3543 const auto *Next = Tok->Next; in calculateFormattingInformation() local
3544 if (!Next || Next->isNot(tok::l_paren)) in calculateFormattingInformation()
3546 Tok = Next->MatchingParen; in calculateFormattingInformation()
3644 Current = Current->Next; in calculateFormattingInformation()
3649 for (Current = First; Current; Current = Current->Next) { in calculateFormattingInformation()
3692 if (CurrentToken->Next) in calculateArrayInitializerColumnList()
3693 CurrentToken->Next->MustBreakBefore = true; in calculateArrayInitializerColumnList()
3695 calculateInitializerColumnList(Line, CurrentToken->Next, Depth + 1); in calculateArrayInitializerColumnList()
3697 CurrentToken = CurrentToken->Next; in calculateArrayInitializerColumnList()
3710 CurrentToken = CurrentToken->Next; in calculateInitializerColumnList()
3716 CurrentToken = CurrentToken->Next; in calculateInitializerColumnList()
3757 if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral)) in splitPenalty()
3828 (!Right.Next || Right.Next->isNot(tok::l_paren))) { in splitPenalty()
4022 Right.MatchingParen->Next && in spaceRequiredBetween()
4023 Right.MatchingParen->Next->is(tok::colon); in spaceRequiredBetween()
4080 if (Left.isTypeOrIdentifier() && Right.Next && Right.Next->Next && in spaceRequiredBetween()
4081 Right.Next->Next->is(TT_RangeBasedForLoopColon)) { in spaceRequiredBetween()
4123 if (Left.Previous && Left.Previous->isTypeOrIdentifier() && Right.Next && in spaceRequiredBetween()
4124 Right.Next->is(TT_RangeBasedForLoopColon)) { in spaceRequiredBetween()
4390 (!Right.Next || Right.Next->is(tok::semi))) { in spaceRequiredBetween()
4578 const FormatToken *Next = Right.MatchingParen->getNextNonComment(); in spaceRequiredBefore() local
4581 if (Next && Next->is(TT_FatArrow)) in spaceRequiredBefore()
4701 const FormatToken *Next = Right.getNextNonComment(); in spaceRequiredBefore() local
4702 return !(Next && Next->is(tok::r_paren)); in spaceRequiredBefore()
4932 if (Right.Next && Right.Next->is(TT_StructuredBindingLSquare) && in spaceRequiredBefore()
4965 return Tok.MatchingParen && Tok.MatchingParen->Next && in IsFunctionArgument()
4966 Tok.MatchingParen->Next->isOneOf(tok::comma, tok::r_paren); in IsFunctionArgument()
4997 if (Right.Next && Right.Next->is(TT_FatArrow) && in mustBreakBefore()
5070 if (Right.is(tok::plus) && Left.is(tok::string_literal) && Right.Next && in mustBreakBefore()
5071 Right.Next->is(tok::string_literal)) { in mustBreakBefore()
5116 for (const auto *Tok = &Right; Tok; Tok = Tok->Next) { in mustBreakBefore()
5162 if (Right.is(tok::lessless) && Right.Next && Left.is(tok::string_literal) && in mustBreakBefore()
5163 Right.Next->is(tok::string_literal)) { in mustBreakBefore()
5261 if (AccessSpecifier && FirstNonComment->Next && in mustBreakBefore()
5262 FirstNonComment->Next->is(tok::kw_enum)) { in mustBreakBefore()
5269 ((AccessSpecifier && FirstNonComment->Next && in mustBreakBefore()
5270 FirstNonComment->Next->is(Keywords.kw_interface)) || in mustBreakBefore()
5353 Right.isNot(tok::r_square) && Right.Next) { in mustBreakBefore()
5362 FormatToken *LBrace = Right.Next; in mustBreakBefore()
5364 LBrace = LBrace->Next; in mustBreakBefore()
5366 LBrace = LBrace->Next; in mustBreakBefore()
5368 LBrace = LBrace->Next; in mustBreakBefore()
5382 (LBrace->Next && LBrace->Next->is(tok::r_brace)))) || in mustBreakBefore()
5469 const FormatToken *Next = Right.getNextNonComment(); in canBreakBefore() local
5477 if (!Next || Next->isNot(tok::colon)) in canBreakBefore()
5529 (!Right.Next || Right.Next->isNot(TT_FunctionDeclarationName))); in canBreakBefore()
5606 if (Right.is(TT_SelectorName) || (Right.is(tok::identifier) && Right.Next && in canBreakBefore()
5607 Right.Next->is(TT_ObjCMethodExpr))) { in canBreakBefore()
5683 auto Next = Right.Next; in canBreakBefore() local
5684 if (Next && Next->is(tok::r_paren)) in canBreakBefore()
5685 Next = Next->Next; in canBreakBefore()
5686 if (Next && Next->is(tok::l_paren)) in canBreakBefore()
5708 if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral)) in canBreakBefore()
5764 return Right.Next && Right.Next->is(tok::l_paren); in canBreakBefore()
5798 if (!Tok->Next) in printDebugInfo()
5800 Tok = Tok->Next; in printDebugInfo()