Lines Matching refs:CurrentToken
75 : Style(Style), Line(Line), CurrentToken(Line.First), AutoFound(false), in AnnotatingParser()
78 resetTokenMetadata(CurrentToken); in AnnotatingParser()
83 if (!CurrentToken || !CurrentToken->Previous) in parseAngle()
85 if (NonTemplateLess.count(CurrentToken->Previous)) in parseAngle()
88 const FormatToken &Previous = *CurrentToken->Previous; // The '<'. in parseAngle()
98 FormatToken *Left = CurrentToken->Previous; in parseAngle()
113 CurrentToken->is(tok::question)) in parseAngle()
116 while (CurrentToken) { in parseAngle()
117 if (CurrentToken->is(tok::greater)) { in parseAngle()
120 if (CurrentToken->Next && CurrentToken->Next->is(tok::greater) && in parseAngle()
124 Left->MatchingParen = CurrentToken; in parseAngle()
125 CurrentToken->MatchingParen = Left; in parseAngle()
134 CurrentToken->setType(TT_DictLiteral); in parseAngle()
136 CurrentToken->setType(TT_TemplateCloser); in parseAngle()
140 if (CurrentToken->is(tok::question) && in parseAngle()
145 if (CurrentToken->isOneOf(tok::r_paren, tok::r_square, tok::r_brace) || in parseAngle()
146 (CurrentToken->isOneOf(tok::colon, tok::question) && InExprContext && in parseAngle()
156 if (CurrentToken->Previous->isOneOf(tok::pipepipe, tok::ampamp) && in parseAngle()
157 CurrentToken->Previous->is(TT_BinaryOperator) && in parseAngle()
161 updateParameterCount(Left, CurrentToken); in parseAngle()
163 if (FormatToken *Previous = CurrentToken->getPreviousNonComment()) { in parseAngle()
164 if (CurrentToken->is(tok::colon) || in parseAngle()
165 (CurrentToken->isOneOf(tok::l_brace, tok::less) && in parseAngle()
177 while (CurrentToken) { in parseUntouchableParens()
178 CurrentToken->Finalized = true; in parseUntouchableParens()
179 switch (CurrentToken->Tok.getKind()) { in parseUntouchableParens()
198 if (!CurrentToken) in parseParens()
200 FormatToken *Left = CurrentToken->Previous; in parseParens()
301 CurrentToken->isOneOf(tok::star, tok::amp, tok::caret); in parseParens()
307 while (CurrentToken) { in parseParens()
312 if (LookForDecls && CurrentToken->Next) { in parseParens()
313 FormatToken *Prev = CurrentToken->getPreviousNonComment(); in parseParens()
316 FormatToken *Next = CurrentToken->Next; in parseParens()
319 CurrentToken->is(tok::identifier) && Next->isNot(tok::equal)) { in parseParens()
326 if (CurrentToken->Previous->is(TT_PointerOrReference) && in parseParens()
327 CurrentToken->Previous->Previous->isOneOf(tok::l_paren, in parseParens()
330 if (CurrentToken->is(tok::comma)) in parseParens()
332 if (CurrentToken->Previous->is(TT_BinaryOperator)) in parseParens()
334 if (CurrentToken->is(tok::r_paren)) { in parseParens()
335 if (MightBeFunctionType && ProbablyFunctionType && CurrentToken->Next && in parseParens()
336 (CurrentToken->Next->is(tok::l_paren) || in parseParens()
337 (CurrentToken->Next->is(tok::l_square) && Line.MustBeDeclaration))) in parseParens()
340 Left->MatchingParen = CurrentToken; in parseParens()
341 CurrentToken->MatchingParen = Left; in parseParens()
343 if (CurrentToken->Next && CurrentToken->Next->is(tok::l_brace) && in parseParens()
348 for (FormatToken *Tok = Left; Tok != CurrentToken; Tok = Tok->Next) { in parseParens()
356 CurrentToken->setType(TT_ObjCMethodExpr); in parseParens()
364 CurrentToken->setType(TT_AttributeParen); in parseParens()
366 CurrentToken->setType(TT_TypeDeclarationParen); in parseParens()
368 CurrentToken->setType(TT_JavaAnnotation); in parseParens()
370 CurrentToken->setType(TT_LeadingJavaAnnotation); in parseParens()
372 CurrentToken->setType(TT_AttributeSquare); in parseParens()
384 if (CurrentToken->isOneOf(tok::r_square, tok::r_brace)) in parseParens()
387 if (CurrentToken->is(tok::l_brace)) in parseParens()
389 if (CurrentToken->is(tok::comma) && CurrentToken->Next && in parseParens()
390 !CurrentToken->Next->HasUnescapedNewline && in parseParens()
391 !CurrentToken->Next->isTrailingComment()) in parseParens()
393 if ((CurrentToken->Previous->isOneOf(tok::kw_const, tok::kw_auto) || in parseParens()
394 CurrentToken->Previous->isSimpleTypeSpecifier()) && in parseParens()
395 !CurrentToken->is(tok::l_brace)) in parseParens()
397 if (CurrentToken->isOneOf(tok::semi, tok::colon)) { in parseParens()
404 if (MightBeObjCForRangeLoop && CurrentToken->is(Keywords.kw_in)) { in parseParens()
405 PossibleObjCForInToken = CurrentToken; in parseParens()
410 if (CurrentToken->is(tok::comma)) in parseParens()
413 FormatToken *Tok = CurrentToken; in parseParens()
417 if (CurrentToken && CurrentToken->HasUnescapedNewline) in parseParens()
506 if (!CurrentToken) in parseSquare()
513 FormatToken *Left = CurrentToken->Previous; in parseSquare()
540 !CurrentToken->isOneOf(tok::l_brace, tok::r_square) && in parseSquare()
570 } else if (CurrentToken->is(tok::r_square) && Parent && in parseSquare()
633 while (CurrentToken) { in parseSquare()
634 if (CurrentToken->is(tok::r_square)) { in parseSquare()
636 CurrentToken->setType(TT_AttributeSquare); in parseSquare()
638 CurrentToken->setType(TT_AttributeSquare); in parseSquare()
639 else if (((CurrentToken->Next && in parseSquare()
640 CurrentToken->Next->is(tok::l_paren)) || in parseSquare()
641 (CurrentToken->Previous && in parseSquare()
642 CurrentToken->Previous->Previous == Left)) && in parseSquare()
651 if (StartsObjCMethodExpr && CurrentToken->Previous != Left) { in parseSquare()
652 CurrentToken->setType(TT_ObjCMethodExpr); in parseSquare()
655 if (!ColonFound && CurrentToken->Previous && in parseSquare()
656 CurrentToken->Previous->is(TT_Unknown) && in parseSquare()
657 canBeObjCSelectorComponent(*CurrentToken->Previous)) in parseSquare()
658 CurrentToken->Previous->setType(TT_SelectorName); in parseSquare()
666 if (CurrentToken->getType() == TT_ObjCMethodExpr && in parseSquare()
667 CurrentToken->Next && CurrentToken->Next->is(TT_LambdaArrow)) in parseSquare()
668 CurrentToken->Next->setType(TT_Unknown); in parseSquare()
669 Left->MatchingParen = CurrentToken; in parseSquare()
670 CurrentToken->MatchingParen = Left; in parseSquare()
676 FormatToken *Previous = CurrentToken->getPreviousNonComment(); in parseSquare()
694 if (CurrentToken->isOneOf(tok::r_paren, tok::r_brace)) in parseSquare()
696 if (CurrentToken->is(tok::colon)) { in parseSquare()
698 CurrentToken->endsSequence(tok::colon, tok::identifier, in parseSquare()
702 CurrentToken->setType(TT_AttributeColon); in parseSquare()
714 if (CurrentToken->is(tok::comma) && Left->is(TT_ObjCMethodExpr) && in parseSquare()
717 FormatToken *Tok = CurrentToken; in parseSquare()
726 if (CurrentToken) { in parseBrace()
727 FormatToken *Left = CurrentToken->Previous; in parseBrace()
742 while (CurrentToken) { in parseBrace()
743 if (CurrentToken->is(tok::r_brace)) { in parseBrace()
744 Left->MatchingParen = CurrentToken; in parseBrace()
745 CurrentToken->MatchingParen = Left; in parseBrace()
749 if (CurrentToken->isOneOf(tok::r_paren, tok::r_square)) in parseBrace()
751 updateParameterCount(Left, CurrentToken); in parseBrace()
752 if (CurrentToken->isOneOf(tok::colon, tok::l_brace, tok::less)) { in parseBrace()
753 FormatToken *Previous = CurrentToken->getPreviousNonComment(); in parseBrace()
756 if ((CurrentToken->is(tok::colon) && in parseBrace()
765 if (CurrentToken->is(tok::colon) || in parseBrace()
769 if (CurrentToken->is(tok::comma) && in parseBrace()
796 while (CurrentToken) { in parseConditional()
797 if (CurrentToken->is(tok::colon)) { in parseConditional()
798 CurrentToken->setType(TT_ConditionalExpr); in parseConditional()
809 if (CurrentToken && CurrentToken->is(tok::less)) { in parseTemplateDeclaration()
810 CurrentToken->setType(TT_TemplateOpener); in parseTemplateDeclaration()
814 if (CurrentToken) in parseTemplateDeclaration()
815 CurrentToken->Previous->ClosesTemplateDeclaration = true; in parseTemplateDeclaration()
822 FormatToken *Tok = CurrentToken; in consumeToken()
896 } else if (CurrentToken && CurrentToken->is(tok::numeric_constant)) { in consumeToken()
931 if (Tok->is(tok::kw_if) && CurrentToken && in consumeToken()
932 CurrentToken->isOneOf(tok::kw_constexpr, tok::identifier)) in consumeToken()
934 if (CurrentToken && CurrentToken->is(tok::l_paren)) { in consumeToken()
947 if (CurrentToken && CurrentToken->is(Keywords.kw_await)) in consumeToken()
1009 CurrentToken = Tok; in consumeToken()
1031 while (CurrentToken && in consumeToken()
1032 !CurrentToken->isOneOf(tok::l_paren, tok::semi, tok::r_paren)) { in consumeToken()
1033 if (CurrentToken->isOneOf(tok::star, tok::amp)) in consumeToken()
1034 CurrentToken->setType(TT_PointerOrReference); in consumeToken()
1036 if (CurrentToken && CurrentToken->is(tok::comma) && in consumeToken()
1037 CurrentToken->Previous->isNot(tok::kw_operator)) in consumeToken()
1039 if (CurrentToken && CurrentToken->Previous->isOneOf( in consumeToken()
1042 CurrentToken->Previous->setType(TT_OverloadedOperator); in consumeToken()
1044 if (CurrentToken && CurrentToken->is(tok::l_paren)) in consumeToken()
1045 CurrentToken->setType(TT_OverloadedOperatorLParen); in consumeToken()
1046 if (CurrentToken && CurrentToken->Previous->is(TT_BinaryOperator)) in consumeToken()
1047 CurrentToken->Previous->setType(TT_OverloadedOperator); in consumeToken()
1121 while (CurrentToken) { in parseCSharpGenericTypeConstraint()
1122 if (CurrentToken->is(tok::less)) { in parseCSharpGenericTypeConstraint()
1124 CurrentToken->setType(TT_TemplateOpener); in parseCSharpGenericTypeConstraint()
1127 } else if (CurrentToken->is(tok::greater)) { in parseCSharpGenericTypeConstraint()
1128 CurrentToken->setType(TT_TemplateCloser); in parseCSharpGenericTypeConstraint()
1131 } else if (CurrentToken->is(tok::comma) && OpenAngleBracketsCount == 0) { in parseCSharpGenericTypeConstraint()
1134 CurrentToken->setType(TT_CSharpGenericTypeConstraintComma); in parseCSharpGenericTypeConstraint()
1136 } else if (CurrentToken->is(Keywords.kw_where)) { in parseCSharpGenericTypeConstraint()
1137 CurrentToken->setType(TT_CSharpGenericTypeConstraint); in parseCSharpGenericTypeConstraint()
1139 } else if (CurrentToken->is(tok::colon)) { in parseCSharpGenericTypeConstraint()
1140 CurrentToken->setType(TT_CSharpGenericTypeConstraintColon); in parseCSharpGenericTypeConstraint()
1149 if (CurrentToken && CurrentToken->is(tok::less)) { in parseIncludeDirective()
1151 while (CurrentToken) { in parseIncludeDirective()
1154 if (CurrentToken->isNot(tok::comment) && in parseIncludeDirective()
1155 !CurrentToken->TokenText.startswith("//")) in parseIncludeDirective()
1156 CurrentToken->setType(TT_ImplicitStringLiteral); in parseIncludeDirective()
1167 while (CurrentToken) { in parseWarningOrError()
1168 CurrentToken->setType(TT_ImplicitStringLiteral); in parseWarningOrError()
1175 if (CurrentToken && in parsePragma()
1176 CurrentToken->isOneOf(Keywords.kw_mark, Keywords.kw_option)) { in parsePragma()
1177 bool IsMark = CurrentToken->is(Keywords.kw_mark); in parsePragma()
1180 while (CurrentToken) { in parsePragma()
1181 if (IsMark || CurrentToken->Previous->is(TT_BinaryOperator)) in parsePragma()
1182 CurrentToken->setType(TT_ImplicitStringLiteral); in parsePragma()
1189 if (!CurrentToken || !CurrentToken->is(tok::l_paren)) in parseHasInclude()
1197 bool IsFirstToken = CurrentToken->IsFirst; in parsePreprocessorDirective()
1200 if (!CurrentToken) in parsePreprocessorDirective()
1207 while (CurrentToken) { in parsePreprocessorDirective()
1209 CurrentToken->setType(TT_ImplicitStringLiteral); in parsePreprocessorDirective()
1215 if (CurrentToken->Tok.is(tok::numeric_constant)) { in parsePreprocessorDirective()
1216 CurrentToken->SpacesRequiredBefore = 1; in parsePreprocessorDirective()
1221 if (!CurrentToken->Tok.getIdentifierInfo()) in parsePreprocessorDirective()
1223 switch (CurrentToken->Tok.getIdentifierInfo()->getPPKeywordID()) { in parsePreprocessorDirective()
1247 while (CurrentToken) { in parsePreprocessorDirective()
1248 FormatToken *Tok = CurrentToken; in parsePreprocessorDirective()
1261 if (!CurrentToken) in parseLine()
1264 if (CurrentToken->is(tok::hash)) in parseLine()
1270 IdentifierInfo *Info = CurrentToken->Tok.getIdentifierInfo(); in parseLine()
1272 CurrentToken->is(Keywords.kw_package)) || in parseLine()
1274 CurrentToken->Next && in parseLine()
1275 CurrentToken->Next->isOneOf(tok::string_literal, tok::identifier, in parseLine()
1284 if (CurrentToken->is(tok::less) && Line.Last->is(tok::greater)) { in parseLine()
1292 CurrentToken->isOneOf(Keywords.kw_option, Keywords.kw_package)) { in parseLine()
1294 if (CurrentToken && CurrentToken->is(tok::identifier)) { in parseLine()
1295 while (CurrentToken) in parseLine()
1306 CurrentToken->is(Keywords.kw_import)) in parseLine()
1309 while (CurrentToken) { in parseLine()
1310 if (CurrentToken->is(tok::kw_virtual)) in parseLine()
1320 CurrentToken->is(Keywords.kw_from) && CurrentToken->Next && in parseLine()
1321 CurrentToken->Next->isStringLiteral()) in parseLine()
1323 if (isClosureImportStatement(*CurrentToken)) in parseLine()
1364 if (!CurrentToken->isOneOf( in resetTokenMetadata()
1371 CurrentToken->setType(TT_Unknown); in resetTokenMetadata()
1372 CurrentToken->Role.reset(); in resetTokenMetadata()
1373 CurrentToken->MatchingParen = nullptr; in resetTokenMetadata()
1374 CurrentToken->FakeLParens.clear(); in resetTokenMetadata()
1375 CurrentToken->FakeRParens = 0; in resetTokenMetadata()
1379 if (CurrentToken) { in next()
1380 CurrentToken->NestingLevel = Contexts.size() - 1; in next()
1381 CurrentToken->BindingStrength = Contexts.back().BindingStrength; in next()
1382 modifyContext(*CurrentToken); in next()
1383 determineTokenType(*CurrentToken); in next()
1384 CurrentToken = CurrentToken->Next; in next()
1387 resetTokenMetadata(CurrentToken); in next()
1565 if (Style.isCSharp() && CurrentToken->is(tok::question)) { in determineTokenType()
1566 if (CurrentToken->TokenText == "??") { in determineTokenType()
1570 if (CurrentToken->TokenText == "?.") { in determineTokenType()
1574 if (CurrentToken->TokenText == "?[") { in determineTokenType()
2051 FormatToken *CurrentToken; member in clang::format::__anon24cb7f400111::AnnotatingParser