• Home
  • Raw
  • Download

Lines Matching refs:CurrentToken

37       : Style(Style), Line(Line), CurrentToken(Line.First), AutoFound(false),  in AnnotatingParser()
40 resetTokenMetadata(CurrentToken); in AnnotatingParser()
45 if (!CurrentToken || !CurrentToken->Previous) in parseAngle()
47 if (NonTemplateLess.count(CurrentToken->Previous)) in parseAngle()
50 const FormatToken& Previous = *CurrentToken->Previous; in parseAngle()
60 FormatToken *Left = CurrentToken->Previous; in parseAngle()
75 CurrentToken->is(tok::question)) in parseAngle()
78 while (CurrentToken) { in parseAngle()
79 if (CurrentToken->is(tok::greater)) { in parseAngle()
80 Left->MatchingParen = CurrentToken; in parseAngle()
81 CurrentToken->MatchingParen = Left; in parseAngle()
82 CurrentToken->Type = TT_TemplateCloser; in parseAngle()
86 if (CurrentToken->is(tok::question) && in parseAngle()
91 if (CurrentToken->isOneOf(tok::r_paren, tok::r_square, tok::r_brace) || in parseAngle()
92 (CurrentToken->isOneOf(tok::colon, tok::question) && InExprContext)) in parseAngle()
100 if (CurrentToken->Previous->isOneOf(tok::pipepipe, tok::ampamp) && in parseAngle()
101 CurrentToken->Previous->is(TT_BinaryOperator) && in parseAngle()
105 updateParameterCount(Left, CurrentToken); in parseAngle()
113 if (!CurrentToken) in parseParens()
115 FormatToken *Left = CurrentToken->Previous; in parseParens()
124 if (CurrentToken->is(tok::caret)) { in parseParens()
190 bool ProbablyFunctionType = CurrentToken->isOneOf(tok::star, tok::amp); in parseParens()
195 while (CurrentToken) { in parseParens()
200 if (LookForDecls && CurrentToken->Next) { in parseParens()
201 FormatToken *Prev = CurrentToken->getPreviousNonComment(); in parseParens()
204 FormatToken *Next = CurrentToken->Next; in parseParens()
207 CurrentToken->is(tok::identifier) && Next->isNot(tok::equal)) { in parseParens()
214 if (CurrentToken->Previous->is(TT_PointerOrReference) && in parseParens()
215 CurrentToken->Previous->Previous->isOneOf(tok::l_paren, in parseParens()
218 if (CurrentToken->is(tok::comma)) in parseParens()
220 if (CurrentToken->Previous->is(TT_BinaryOperator)) in parseParens()
222 if (CurrentToken->is(tok::r_paren)) { in parseParens()
223 if (MightBeFunctionType && ProbablyFunctionType && CurrentToken->Next && in parseParens()
224 (CurrentToken->Next->is(tok::l_paren) || in parseParens()
225 (CurrentToken->Next->is(tok::l_square) && Line.MustBeDeclaration))) in parseParens()
227 Left->MatchingParen = CurrentToken; in parseParens()
228 CurrentToken->MatchingParen = Left; in parseParens()
230 if (CurrentToken->Next && CurrentToken->Next->is(tok::l_brace) && in parseParens()
235 for (FormatToken *Tok = Left; Tok != CurrentToken; Tok = Tok->Next) { in parseParens()
243 CurrentToken->Type = TT_ObjCMethodExpr; in parseParens()
251 CurrentToken->Type = TT_AttributeParen; in parseParens()
253 CurrentToken->Type = TT_JavaAnnotation; in parseParens()
255 CurrentToken->Type = TT_LeadingJavaAnnotation; in parseParens()
267 if (CurrentToken->isOneOf(tok::r_square, tok::r_brace)) in parseParens()
270 if (CurrentToken->is(tok::l_brace)) in parseParens()
272 if (CurrentToken->is(tok::comma) && CurrentToken->Next && in parseParens()
273 !CurrentToken->Next->HasUnescapedNewline && in parseParens()
274 !CurrentToken->Next->isTrailingComment()) in parseParens()
276 if (CurrentToken->isOneOf(tok::kw_const, tok::kw_auto) || in parseParens()
277 CurrentToken->isSimpleTypeSpecifier()) in parseParens()
279 if (CurrentToken->isOneOf(tok::semi, tok::colon)) in parseParens()
281 if (MightBeObjCForRangeLoop && CurrentToken->is(Keywords.kw_in)) in parseParens()
282 CurrentToken->Type = TT_ObjCForIn; in parseParens()
285 if (CurrentToken->is(tok::comma)) in parseParens()
288 FormatToken *Tok = CurrentToken; in parseParens()
292 if (CurrentToken && CurrentToken->HasUnescapedNewline) in parseParens()
299 if (!CurrentToken) in parseSquare()
305 FormatToken *Left = CurrentToken->Previous; in parseSquare()
311 CurrentToken->isNot(tok::l_brace) && in parseSquare()
346 while (CurrentToken) { in parseSquare()
347 if (CurrentToken->is(tok::r_square)) { in parseSquare()
348 if (CurrentToken->Next && CurrentToken->Next->is(tok::l_paren) && in parseSquare()
355 if (StartsObjCMethodExpr && CurrentToken->Previous != Left) { in parseSquare()
356 CurrentToken->Type = TT_ObjCMethodExpr; in parseSquare()
363 Left->MatchingParen = CurrentToken; in parseSquare()
364 CurrentToken->MatchingParen = Left; in parseSquare()
374 if (CurrentToken->isOneOf(tok::r_paren, tok::r_brace)) in parseSquare()
376 if (CurrentToken->is(tok::colon)) { in parseSquare()
386 if (CurrentToken->is(tok::comma) && Left->is(TT_ObjCMethodExpr) && in parseSquare()
389 FormatToken *Tok = CurrentToken; in parseSquare()
398 if (CurrentToken) { in parseBrace()
399 FormatToken *Left = CurrentToken->Previous; in parseBrace()
411 while (CurrentToken) { in parseBrace()
412 if (CurrentToken->is(tok::r_brace)) { in parseBrace()
413 Left->MatchingParen = CurrentToken; in parseBrace()
414 CurrentToken->MatchingParen = Left; in parseBrace()
418 if (CurrentToken->isOneOf(tok::r_paren, tok::r_square)) in parseBrace()
420 updateParameterCount(Left, CurrentToken); in parseBrace()
421 if (CurrentToken->isOneOf(tok::colon, tok::l_brace)) { in parseBrace()
422 FormatToken *Previous = CurrentToken->getPreviousNonComment(); in parseBrace()
423 if (((CurrentToken->is(tok::colon) && in parseBrace()
430 if (CurrentToken->is(tok::colon) || in parseBrace()
455 while (CurrentToken) { in parseConditional()
456 if (CurrentToken->is(tok::colon)) { in parseConditional()
457 CurrentToken->Type = TT_ConditionalExpr; in parseConditional()
468 if (CurrentToken && CurrentToken->is(tok::less)) { in parseTemplateDeclaration()
469 CurrentToken->Type = TT_TemplateOpener; in parseTemplateDeclaration()
473 if (CurrentToken) in parseTemplateDeclaration()
474 CurrentToken->Previous->ClosesTemplateDeclaration = true; in parseTemplateDeclaration()
481 FormatToken *Tok = CurrentToken; in consumeToken()
519 } else if (CurrentToken && CurrentToken->is(tok::numeric_constant)) { in consumeToken()
546 if (CurrentToken && CurrentToken->is(tok::l_paren)) { in consumeToken()
598 CurrentToken = Tok; in consumeToken()
614 while (CurrentToken && in consumeToken()
615 !CurrentToken->isOneOf(tok::l_paren, tok::semi, tok::r_paren)) { in consumeToken()
616 if (CurrentToken->isOneOf(tok::star, tok::amp)) in consumeToken()
617 CurrentToken->Type = TT_PointerOrReference; in consumeToken()
619 if (CurrentToken && in consumeToken()
620 CurrentToken->Previous->isOneOf(TT_BinaryOperator, tok::comma)) in consumeToken()
621 CurrentToken->Previous->Type = TT_OverloadedOperator; in consumeToken()
623 if (CurrentToken) { in consumeToken()
624 CurrentToken->Type = TT_OverloadedOperatorLParen; in consumeToken()
625 if (CurrentToken->Previous->is(TT_BinaryOperator)) in consumeToken()
626 CurrentToken->Previous->Type = TT_OverloadedOperator; in consumeToken()
668 if (CurrentToken && CurrentToken->is(tok::less)) { in parseIncludeDirective()
670 while (CurrentToken) { in parseIncludeDirective()
671 if (CurrentToken->isNot(tok::comment) || CurrentToken->Next) in parseIncludeDirective()
672 CurrentToken->Type = TT_ImplicitStringLiteral; in parseIncludeDirective()
683 while (CurrentToken) { in parseWarningOrError()
684 CurrentToken->Type = TT_ImplicitStringLiteral; in parseWarningOrError()
691 if (CurrentToken && in parsePragma()
692 CurrentToken->isOneOf(Keywords.kw_mark, Keywords.kw_option)) { in parsePragma()
693 bool IsMark = CurrentToken->is(Keywords.kw_mark); in parsePragma()
696 while (CurrentToken) { in parsePragma()
697 if (IsMark || CurrentToken->Previous->is(TT_BinaryOperator)) in parsePragma()
698 CurrentToken->Type = TT_ImplicitStringLiteral; in parsePragma()
705 bool IsFirstToken = CurrentToken->IsFirst; in parsePreprocessorDirective()
708 if (!CurrentToken) in parsePreprocessorDirective()
715 while (CurrentToken) { in parsePreprocessorDirective()
717 CurrentToken->Type = TT_ImplicitStringLiteral; in parsePreprocessorDirective()
723 if (CurrentToken->Tok.is(tok::numeric_constant)) { in parsePreprocessorDirective()
724 CurrentToken->SpacesRequiredBefore = 1; in parsePreprocessorDirective()
729 if (!CurrentToken->Tok.getIdentifierInfo()) in parsePreprocessorDirective()
731 switch (CurrentToken->Tok.getIdentifierInfo()->getPPKeywordID()) { in parsePreprocessorDirective()
754 while (CurrentToken) in parsePreprocessorDirective()
762 if (CurrentToken->is(tok::hash)) in parseLine()
768 IdentifierInfo *Info = CurrentToken->Tok.getIdentifierInfo(); in parseLine()
770 CurrentToken->is(Keywords.kw_package)) || in parseLine()
772 CurrentToken->Next && in parseLine()
773 CurrentToken->Next->isOneOf(tok::string_literal, tok::identifier, in parseLine()
782 if (CurrentToken->is(tok::less) && Line.Last->is(tok::greater)) { in parseLine()
790 CurrentToken->is(Keywords.kw_option)) { in parseLine()
792 if (CurrentToken && CurrentToken->is(tok::identifier)) in parseLine()
801 CurrentToken->is(Keywords.kw_import)) in parseLine()
804 while (CurrentToken) { in parseLine()
805 if (CurrentToken->is(tok::kw_virtual)) in parseLine()
815 CurrentToken->is(Keywords.kw_from) && CurrentToken->Next && in parseLine()
816 CurrentToken->Next->isStringLiteral()) in parseLine()
818 if (isClosureImportStatement(*CurrentToken)) in parseLine()
858 if (!CurrentToken->isOneOf(TT_LambdaLSquare, TT_ForEachMacro, in resetTokenMetadata()
862 CurrentToken->Type = TT_Unknown; in resetTokenMetadata()
863 CurrentToken->Role.reset(); in resetTokenMetadata()
864 CurrentToken->MatchingParen = nullptr; in resetTokenMetadata()
865 CurrentToken->FakeLParens.clear(); in resetTokenMetadata()
866 CurrentToken->FakeRParens = 0; in resetTokenMetadata()
870 if (CurrentToken) { in next()
871 CurrentToken->NestingLevel = Contexts.size() - 1; in next()
872 CurrentToken->BindingStrength = Contexts.back().BindingStrength; in next()
873 modifyContext(*CurrentToken); in next()
874 determineTokenType(*CurrentToken); in next()
875 CurrentToken = CurrentToken->Next; in next()
878 resetTokenMetadata(CurrentToken); in next()
1338 FormatToken *CurrentToken; member in clang::format::__anonfa90e1520111::AnnotatingParser