Lines Matching refs:CurrentToken
37 : Style(Style), Line(Line), CurrentToken(Line.First), AutoFound(false), in AnnotatingParser()
40 resetTokenMetadata(CurrentToken); in AnnotatingParser()
45 if (!CurrentToken) in parseAngle()
47 FormatToken *Left = CurrentToken->Previous; in parseAngle()
62 CurrentToken->is(tok::question)) in parseAngle()
65 while (CurrentToken) { in parseAngle()
66 if (CurrentToken->is(tok::greater)) { in parseAngle()
67 Left->MatchingParen = CurrentToken; in parseAngle()
68 CurrentToken->MatchingParen = Left; in parseAngle()
69 CurrentToken->Type = TT_TemplateCloser; in parseAngle()
73 if (CurrentToken->is(tok::question) && in parseAngle()
78 if (CurrentToken->isOneOf(tok::r_paren, tok::r_square, tok::r_brace) || in parseAngle()
79 (CurrentToken->isOneOf(tok::colon, tok::question) && InExprContext)) in parseAngle()
87 if (CurrentToken->Previous->isOneOf(tok::pipepipe, tok::ampamp) && in parseAngle()
88 CurrentToken->Previous->is(TT_BinaryOperator) && in parseAngle()
92 updateParameterCount(Left, CurrentToken); in parseAngle()
100 if (!CurrentToken) in parseParens()
102 FormatToken *Left = CurrentToken->Previous; in parseParens()
111 if (CurrentToken->is(tok::caret)) { in parseParens()
158 bool MightBeFunctionType = CurrentToken->isOneOf(tok::star, tok::amp); in parseParens()
163 while (CurrentToken) { in parseParens()
168 if (LookForDecls && CurrentToken->Next) { in parseParens()
169 FormatToken *Prev = CurrentToken->getPreviousNonComment(); in parseParens()
172 FormatToken *Next = CurrentToken->Next; in parseParens()
175 CurrentToken->is(tok::identifier) && Next->isNot(tok::equal)) { in parseParens()
182 if (CurrentToken->Previous->is(TT_PointerOrReference) && in parseParens()
183 CurrentToken->Previous->Previous->isOneOf(tok::l_paren, in parseParens()
186 if (CurrentToken->Previous->is(TT_BinaryOperator)) in parseParens()
188 if (CurrentToken->is(tok::r_paren)) { in parseParens()
189 if (MightBeFunctionType && CurrentToken->Next && in parseParens()
190 (CurrentToken->Next->is(tok::l_paren) || in parseParens()
191 (CurrentToken->Next->is(tok::l_square) && in parseParens()
194 Left->MatchingParen = CurrentToken; in parseParens()
195 CurrentToken->MatchingParen = Left; in parseParens()
198 CurrentToken->Type = TT_ObjCMethodExpr; in parseParens()
206 CurrentToken->Type = TT_AttributeParen; in parseParens()
208 CurrentToken->Type = TT_JavaAnnotation; in parseParens()
210 CurrentToken->Type = TT_LeadingJavaAnnotation; in parseParens()
222 if (CurrentToken->isOneOf(tok::r_square, tok::r_brace)) in parseParens()
225 if (CurrentToken->is(tok::l_brace)) in parseParens()
227 if (CurrentToken->is(tok::comma) && CurrentToken->Next && in parseParens()
228 !CurrentToken->Next->HasUnescapedNewline && in parseParens()
229 !CurrentToken->Next->isTrailingComment()) in parseParens()
231 if (CurrentToken->isOneOf(tok::kw_const, tok::kw_auto) || in parseParens()
232 CurrentToken->isSimpleTypeSpecifier()) in parseParens()
234 if (CurrentToken->isOneOf(tok::semi, tok::colon)) in parseParens()
236 if (MightBeObjCForRangeLoop && CurrentToken->is(Keywords.kw_in)) in parseParens()
237 CurrentToken->Type = TT_ObjCForIn; in parseParens()
240 if (CurrentToken->is(tok::comma)) in parseParens()
243 FormatToken *Tok = CurrentToken; in parseParens()
247 if (CurrentToken && CurrentToken->HasUnescapedNewline) in parseParens()
254 if (!CurrentToken) in parseSquare()
260 FormatToken *Left = CurrentToken->Previous; in parseSquare()
266 CurrentToken->isNot(tok::l_brace) && in parseSquare()
298 while (CurrentToken) { in parseSquare()
299 if (CurrentToken->is(tok::r_square)) { in parseSquare()
300 if (CurrentToken->Next && CurrentToken->Next->is(tok::l_paren) && in parseSquare()
307 if (StartsObjCMethodExpr && CurrentToken->Previous != Left) { in parseSquare()
308 CurrentToken->Type = TT_ObjCMethodExpr; in parseSquare()
315 Left->MatchingParen = CurrentToken; in parseSquare()
316 CurrentToken->MatchingParen = Left; in parseSquare()
326 if (CurrentToken->isOneOf(tok::r_paren, tok::r_brace)) in parseSquare()
328 if (CurrentToken->is(tok::colon)) { in parseSquare()
338 if (CurrentToken->is(tok::comma) && Left->is(TT_ObjCMethodExpr) && in parseSquare()
341 FormatToken *Tok = CurrentToken; in parseSquare()
350 if (CurrentToken) { in parseBrace()
351 FormatToken *Left = CurrentToken->Previous; in parseBrace()
363 while (CurrentToken) { in parseBrace()
364 if (CurrentToken->is(tok::r_brace)) { in parseBrace()
365 Left->MatchingParen = CurrentToken; in parseBrace()
366 CurrentToken->MatchingParen = Left; in parseBrace()
370 if (CurrentToken->isOneOf(tok::r_paren, tok::r_square)) in parseBrace()
372 updateParameterCount(Left, CurrentToken); in parseBrace()
373 if (CurrentToken->isOneOf(tok::colon, tok::l_brace)) { in parseBrace()
374 FormatToken *Previous = CurrentToken->getPreviousNonComment(); in parseBrace()
375 if (((CurrentToken->is(tok::colon) && in parseBrace()
381 if (CurrentToken->is(tok::colon) || in parseBrace()
406 while (CurrentToken) { in parseConditional()
407 if (CurrentToken->is(tok::colon)) { in parseConditional()
408 CurrentToken->Type = TT_ConditionalExpr; in parseConditional()
419 if (CurrentToken && CurrentToken->is(tok::less)) { in parseTemplateDeclaration()
420 CurrentToken->Type = TT_TemplateOpener; in parseTemplateDeclaration()
424 if (CurrentToken) in parseTemplateDeclaration()
425 CurrentToken->Previous->ClosesTemplateDeclaration = true; in parseTemplateDeclaration()
432 FormatToken *Tok = CurrentToken; in consumeToken()
470 } else if (CurrentToken && CurrentToken->is(tok::numeric_constant)) { in consumeToken()
489 if (CurrentToken && CurrentToken->is(tok::l_paren)) { in consumeToken()
542 CurrentToken = Tok; in consumeToken()
558 while (CurrentToken && in consumeToken()
559 !CurrentToken->isOneOf(tok::l_paren, tok::semi, tok::r_paren)) { in consumeToken()
560 if (CurrentToken->isOneOf(tok::star, tok::amp)) in consumeToken()
561 CurrentToken->Type = TT_PointerOrReference; in consumeToken()
563 if (CurrentToken && CurrentToken->Previous->is(TT_BinaryOperator)) in consumeToken()
564 CurrentToken->Previous->Type = TT_OverloadedOperator; in consumeToken()
566 if (CurrentToken) { in consumeToken()
567 CurrentToken->Type = TT_OverloadedOperatorLParen; in consumeToken()
568 if (CurrentToken->Previous->is(TT_BinaryOperator)) in consumeToken()
569 CurrentToken->Previous->Type = TT_OverloadedOperator; in consumeToken()
611 if (CurrentToken && CurrentToken->is(tok::less)) { in parseIncludeDirective()
613 while (CurrentToken) { in parseIncludeDirective()
614 if (CurrentToken->isNot(tok::comment) || CurrentToken->Next) in parseIncludeDirective()
615 CurrentToken->Type = TT_ImplicitStringLiteral; in parseIncludeDirective()
626 while (CurrentToken) { in parseWarningOrError()
627 CurrentToken->Type = TT_ImplicitStringLiteral; in parseWarningOrError()
634 if (CurrentToken && in parsePragma()
635 CurrentToken->isOneOf(Keywords.kw_mark, Keywords.kw_option)) { in parsePragma()
636 bool IsMark = CurrentToken->is(Keywords.kw_mark); in parsePragma()
639 while (CurrentToken) { in parsePragma()
640 if (IsMark || CurrentToken->Previous->is(TT_BinaryOperator)) in parsePragma()
641 CurrentToken->Type = TT_ImplicitStringLiteral; in parsePragma()
650 if (!CurrentToken) in parsePreprocessorDirective()
652 if (CurrentToken->Tok.is(tok::numeric_constant)) { in parsePreprocessorDirective()
653 CurrentToken->SpacesRequiredBefore = 1; in parsePreprocessorDirective()
658 if (!CurrentToken->Tok.getIdentifierInfo()) in parsePreprocessorDirective()
660 switch (CurrentToken->Tok.getIdentifierInfo()->getPPKeywordID()) { in parsePreprocessorDirective()
683 while (CurrentToken) in parsePreprocessorDirective()
691 if (CurrentToken->is(tok::hash)) in parseLine()
697 IdentifierInfo *Info = CurrentToken->Tok.getIdentifierInfo(); in parseLine()
699 CurrentToken->is(Keywords.kw_package)) || in parseLine()
701 CurrentToken->Next && in parseLine()
702 CurrentToken->Next->isOneOf(tok::string_literal, tok::identifier, in parseLine()
711 if (CurrentToken->is(tok::less) && Line.Last->is(tok::greater)) { in parseLine()
719 CurrentToken->is(Keywords.kw_option)) { in parseLine()
721 if (CurrentToken && CurrentToken->is(tok::identifier)) in parseLine()
727 while (CurrentToken) { in parseLine()
728 if (CurrentToken->is(tok::kw_virtual)) in parseLine()
730 if (isImportStatement(*CurrentToken)) in parseLine()
769 if (!CurrentToken->isOneOf(TT_LambdaLSquare, TT_ForEachMacro, in resetTokenMetadata()
773 CurrentToken->Type = TT_Unknown; in resetTokenMetadata()
774 CurrentToken->Role.reset(); in resetTokenMetadata()
775 CurrentToken->MatchingParen = nullptr; in resetTokenMetadata()
776 CurrentToken->FakeLParens.clear(); in resetTokenMetadata()
777 CurrentToken->FakeRParens = 0; in resetTokenMetadata()
781 if (CurrentToken) { in next()
782 CurrentToken->NestingLevel = Contexts.size() - 1; in next()
783 CurrentToken->BindingStrength = Contexts.back().BindingStrength; in next()
784 modifyContext(*CurrentToken); in next()
785 determineTokenType(*CurrentToken); in next()
786 CurrentToken = CurrentToken->Next; in next()
789 resetTokenMetadata(CurrentToken); in next()
1254 FormatToken *CurrentToken; member in clang::format::__anon7c513deb0111::AnnotatingParser