Lines Matching refs:tok

42   if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) {
77 assert(Tok.isOneOf(tok::kw_export, tok::kw_template) &&
116 TryConsumeToken(tok::kw_export, ExportLoc);
120 if (!TryConsumeToken(tok::kw_template, TemplateLoc)) {
132 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch);
133 TryConsumeToken(tok::semi);
142 if (TryConsumeToken(tok::kw_requires)) {
148 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch);
149 TryConsumeToken(tok::semi);
160 } while (Tok.isOneOf(tok::kw_export, tok::kw_template));
163 if (Tok.is(tok::kw_concept))
192 if (Tok.is(tok::kw_static_assert)) {
210 if (Tok.is(tok::kw_using)) {
225 if (Tok.is(tok::semi)) {
255 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch);
256 if (Tok.is(tok::semi))
269 if (Tok.is(tok::kw_requires))
333 if (Tok.is(tok::comma)) {
336 SkipUntil(tok::semi);
359 assert(Tok.is(tok::kw_concept) &&
365 if (TryConsumeToken(tok::kw_bool, BoolKWLoc))
378 SkipUntil(tok::semi);
393 SkipUntil(tok::semi);
399 SkipUntil(tok::semi);
408 if (!TryConsumeToken(tok::equal)) {
409 Diag(Tok.getLocation(), diag::err_expected) << tok::equal;
410 SkipUntil(tok::semi);
417 SkipUntil(tok::semi);
443 if (!TryConsumeToken(tok::less, LAngleLoc)) {
451 if (!Tok.is(tok::greater) && !Tok.is(tok::greatergreater)) {
456 if (Tok.is(tok::greatergreater)) {
462 Tok.setKind(tok::greater);
465 } else if (!TryConsumeToken(tok::greater, RAngleLoc) && Failed) {
466 Diag(Tok.getLocation(), diag::err_expected) << tok::greater;
491 SkipUntil(tok::comma, tok::greater, tok::greatergreater,
496 if (Tok.is(tok::comma)) {
498 } else if (Tok.isOneOf(tok::greater, tok::greatergreater)) {
506 SkipUntil(tok::comma, tok::greater, tok::greatergreater,
517 if (Tok.is(tok::kw_class)) {
521 case tok::equal:
522 case tok::comma:
523 case tok::greater:
524 case tok::greatergreater:
525 case tok::ellipsis:
528 case tok::identifier:
538 case tok::equal:
539 case tok::comma:
540 case tok::greater:
541 case tok::greatergreater:
556 !GetLookAheadToken(Tok.is(tok::annot_cxxscope) ? 2 : 1)
557 .isOneOf(tok::kw_auto, tok::kw_decltype))
562 if (Tok.isNot(tok::kw_typename) && Tok.isNot(tok::kw_typedef))
574 if (Next.getKind() == tok::identifier)
578 case tok::equal:
579 case tok::comma:
580 case tok::greater:
581 case tok::greatergreater:
582 case tok::ellipsis:
585 case tok::kw_typename:
586 case tok::kw_typedef:
587 case tok::kw_class:
623 if (Tok.is(tok::kw_typedef)) {
632 Tok.setKind(tok::kw_typename);
655 SkipUntil(tok::comma, tok::greater, tok::greatergreater,
664 if (Tok.is(tok::kw_template))
676 const Token &T = Tok.is(tok::annot_cxxscope) ? NextToken() : Tok;
677 if (T.isNot(tok::annot_template_id))
696 bool WasScopeAnnotation = Tok.is(tok::annot_cxxscope);
712 if (Tok.is(tok::identifier)) {
760 assert((Tok.isOneOf(tok::kw_class, tok::kw_typename) ||
772 if (Tok.is(tok::annot_template_id)) {
784 TypenameKeyword = Tok.is(tok::kw_typename);
790 if (TryConsumeToken(tok::ellipsis, EllipsisLoc)) {
800 if (Tok.is(tok::identifier)) {
803 } else if (Tok.isOneOf(tok::equal, tok::comma, tok::greater,
804 tok::greatergreater)) {
808 Diag(Tok.getLocation(), diag::err_expected) << tok::identifier;
814 if (TryConsumeToken(tok::ellipsis, EllipsisLoc))
822 if (TryConsumeToken(tok::equal, EqualLoc))
856 assert(Tok.is(tok::kw_template) && "Expected 'template' keyword");
875 if (!TryConsumeToken(tok::kw_class)) {
876 bool Replace = Tok.isOneOf(tok::kw_typename, tok::kw_struct);
877 const Token &Next = Tok.is(tok::kw_struct) ? NextToken() : Tok;
878 if (Tok.is(tok::kw_typename)) {
886 } else if (Next.isOneOf(tok::identifier, tok::comma, tok::greater,
887 tok::greatergreater, tok::ellipsis)) {
900 if (TryConsumeToken(tok::ellipsis, EllipsisLoc))
909 if (Tok.is(tok::identifier)) {
912 } else if (Tok.isOneOf(tok::equal, tok::comma, tok::greater,
913 tok::greatergreater)) {
917 Diag(Tok.getLocation(), diag::err_expected) << tok::identifier;
923 if (TryConsumeToken(tok::ellipsis, EllipsisLoc))
937 if (TryConsumeToken(tok::equal, EqualLoc)) {
942 SkipUntil(tok::comma, tok::greater, tok::greatergreater,
978 if (TryConsumeToken(tok::ellipsis, EllipsisLoc))
986 if (TryConsumeToken(tok::equal, EqualLoc)) {
998 SkipUntil(tok::comma, tok::greater, StopAtSemi | StopBeforeMatch);
1049 tok::TokenKind RemainingToken;
1055 Diag(getEndOfPreviousToken(), diag::err_expected) << tok::greater;
1056 Diag(LAngleLoc, diag::note_matching) << tok::less;
1059 case tok::greater:
1067 case tok::greatergreater:
1068 RemainingToken = tok::greater;
1071 case tok::greatergreatergreater:
1072 RemainingToken = tok::greatergreater;
1075 case tok::greaterequal:
1076 RemainingToken = tok::equal;
1082 if (NextToken().is(tok::equal) &&
1084 RemainingToken = tok::equalequal;
1089 case tok::greatergreaterequal:
1090 RemainingToken = tok::greaterequal;
1110 (RemainingToken == tok::greater ||
1111 RemainingToken == tok::greatergreater) &&
1112 (Next.isOneOf(tok::greater, tok::greatergreater,
1113 tok::greatergreatergreater, tok::equal, tok::greaterequal,
1114 tok::greatergreaterequal, tok::equalequal)) &&
1138 (Tok.is(tok::greatergreater) || Tok.is(tok::greatergreatergreater)))
1140 else if (Tok.is(tok::greaterequal))
1160 Greater.setKind(tok::greater);
1219 assert(Tok.is(tok::less) && "Must have already parsed the template-name");
1228 if (!Tok.isOneOf(tok::greater, tok::greatergreater,
1229 tok::greatergreatergreater, tok::greaterequal,
1230 tok::greatergreaterequal))
1236 SkipUntil(tok::greater, tok::greatergreater,
1237 tok::greatergreatergreater, StopAtSemi | StopBeforeMatch);
1239 SkipUntil(tok::greater, StopAtSemi | StopBeforeMatch);
1296 assert((Tok.is(tok::less) || TypeConstraint) &&
1311 if (!TypeConstraint || Tok.is(tok::less)) {
1333 Tok.setKind(tok::annot_typename);
1344 Tok.setKind(tok::annot_template_id);
1391 assert(Tok.is(tok::annot_template_id) && "Requires template-id tokens");
1410 Tok.setKind(tok::annot_typename);
1424 return Tok.isOneOf(tok::comma, tok::greater, tok::greatergreater,
1425 tok::greatergreatergreater);
1430 if (!Tok.is(tok::identifier) && !Tok.is(tok::coloncolon) &&
1431 !Tok.is(tok::annot_cxxscope))
1452 if (SS.isSet() && Tok.is(tok::kw_template)) {
1457 if (Tok.is(tok::identifier)) {
1463 TryConsumeToken(tok::ellipsis, EllipsisLoc);
1475 } else if (Tok.is(tok::identifier)) {
1482 TryConsumeToken(tok::ellipsis, EllipsisLoc);
1573 if (TryConsumeToken(tok::ellipsis, EllipsisLoc))
1584 } while (TryConsumeToken(tok::comma));
1670 assert(Tok.isOneOf(tok::l_brace, tok::colon, tok::kw_try) &&
1683 if (Tok.is(tok::kw_try)) {
1686 if (Tok.is(tok::colon))
1691 if (Tok.is(tok::l_brace)) {
1707 tok::TokenKind kind = Tok.getKind();
1710 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false);
1714 if (kind == tok::kw_try) {
1715 while (Tok.is(tok::kw_catch)) {
1716 ConsumeAndStoreUntil(tok::l_brace, Toks, /*StopAtSemi=*/false);
1717 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false);
1729 if (SkipUntil(tok::greater, tok::greatergreater, tok::greatergreatergreater,
1747 assert(Tok.is(tok::less) && "not at a potential angle bracket");
1758 if (NextToken().is(tok::greater) ||
1760 NextToken().isOneOf(tok::greatergreater, tok::greatergreatergreater))) {
1803 if (OpToken.is(tok::comma) && isTypeIdUnambiguously() &&
1812 if (OpToken.is(tok::greater) && Tok.is(tok::l_paren) &&
1813 NextToken().is(tok::r_paren)) {
1823 if (OpToken.is(tok::greater) ||
1825 OpToken.isOneOf(tok::greatergreater, tok::greatergreatergreater)))