• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/clang/lib/Parse/

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)) {
149 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch);
150 TryConsumeToken(tok::semi);
161 } while (Tok.isOneOf(tok::kw_export, tok::kw_template));
164 if (Tok.is(tok::kw_concept))
193 if (Tok.is(tok::kw_static_assert)) {
211 if (Tok.is(tok::kw_using)) {
226 if (Tok.is(tok::semi)) {
256 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch);
257 if (Tok.is(tok::semi))
270 if (Tok.is(tok::kw_requires))
334 if (Tok.is(tok::comma)) {
337 SkipUntil(tok::semi);
360 assert(Tok.is(tok::kw_concept) &&
366 if (TryConsumeToken(tok::kw_bool, BoolKWLoc))
379 SkipUntil(tok::semi);
394 SkipUntil(tok::semi);
400 SkipUntil(tok::semi);
409 if (!TryConsumeToken(tok::equal)) {
410 Diag(Tok.getLocation(), diag::err_expected) << tok::equal;
411 SkipUntil(tok::semi);
418 SkipUntil(tok::semi);
444 if (!TryConsumeToken(tok::less, LAngleLoc)) {
452 if (!Tok.is(tok::greater) && !Tok.is(tok::greatergreater)) {
457 if (Tok.is(tok::greatergreater)) {
463 Tok.setKind(tok::greater);
466 } else if (!TryConsumeToken(tok::greater, RAngleLoc) && Failed) {
467 Diag(Tok.getLocation(), diag::err_expected) << tok::greater;
492 SkipUntil(tok::comma, tok::greater, tok::greatergreater,
497 if (Tok.is(tok::comma)) {
499 } else if (Tok.isOneOf(tok::greater, tok::greatergreater)) {
507 SkipUntil(tok::comma, tok::greater, tok::greatergreater,
518 if (Tok.is(tok::kw_class)) {
522 case tok::equal:
523 case tok::comma:
524 case tok::greater:
525 case tok::greatergreater:
526 case tok::ellipsis:
529 case tok::identifier:
539 case tok::equal:
540 case tok::comma:
541 case tok::greater:
542 case tok::greatergreater:
557 !GetLookAheadToken(Tok.is(tok::annot_cxxscope) ? 2 : 1)
558 .isOneOf(tok::kw_auto, tok::kw_decltype))
563 if (Tok.isNot(tok::kw_typename) && Tok.isNot(tok::kw_typedef))
575 if (Next.getKind() == tok::identifier)
579 case tok::equal:
580 case tok::comma:
581 case tok::greater:
582 case tok::greatergreater:
583 case tok::ellipsis:
586 case tok::kw_typename:
587 case tok::kw_typedef:
588 case tok::kw_class:
624 if (Tok.is(tok::kw_typedef)) {
633 Tok.setKind(tok::kw_typename);
656 SkipUntil(tok::comma, tok::greater, tok::greatergreater,
665 if (Tok.is(tok::kw_template))
677 const Token &T = Tok.is(tok::annot_cxxscope) ? NextToken() : Tok;
678 if (T.isNot(tok::annot_template_id))
697 bool WasScopeAnnotation = Tok.is(tok::annot_cxxscope);
713 if (Tok.is(tok::identifier)) {
761 assert((Tok.isOneOf(tok::kw_class, tok::kw_typename) ||
773 if (Tok.is(tok::annot_template_id)) {
785 TypenameKeyword = Tok.is(tok::kw_typename);
791 if (TryConsumeToken(tok::ellipsis, EllipsisLoc)) {
801 if (Tok.is(tok::identifier)) {
804 } else if (Tok.isOneOf(tok::equal, tok::comma, tok::greater,
805 tok::greatergreater)) {
809 Diag(Tok.getLocation(), diag::err_expected) << tok::identifier;
815 if (TryConsumeToken(tok::ellipsis, EllipsisLoc))
823 if (TryConsumeToken(tok::equal, EqualLoc))
857 assert(Tok.is(tok::kw_template) && "Expected 'template' keyword");
876 if (!TryConsumeToken(tok::kw_class)) {
877 bool Replace = Tok.isOneOf(tok::kw_typename, tok::kw_struct);
878 const Token &Next = Tok.is(tok::kw_struct) ? NextToken() : Tok;
879 if (Tok.is(tok::kw_typename)) {
887 } else if (Next.isOneOf(tok::identifier, tok::comma, tok::greater,
888 tok::greatergreater, tok::ellipsis)) {
901 if (TryConsumeToken(tok::ellipsis, EllipsisLoc))
910 if (Tok.is(tok::identifier)) {
913 } else if (Tok.isOneOf(tok::equal, tok::comma, tok::greater,
914 tok::greatergreater)) {
918 Diag(Tok.getLocation(), diag::err_expected) << tok::identifier;
924 if (TryConsumeToken(tok::ellipsis, EllipsisLoc))
938 if (TryConsumeToken(tok::equal, EqualLoc)) {
943 SkipUntil(tok::comma, tok::greater, tok::greatergreater,
979 if (TryConsumeToken(tok::ellipsis, EllipsisLoc))
987 if (TryConsumeToken(tok::equal, EqualLoc)) {
999 SkipUntil(tok::comma, tok::greater, StopAtSemi | StopBeforeMatch);
1050 tok::TokenKind RemainingToken;
1056 Diag(getEndOfPreviousToken(), diag::err_expected) << tok::greater;
1057 Diag(LAngleLoc, diag::note_matching) << tok::less;
1060 case tok::greater:
1068 case tok::greatergreater:
1069 RemainingToken = tok::greater;
1072 case tok::greatergreatergreater:
1073 RemainingToken = tok::greatergreater;
1076 case tok::greaterequal:
1077 RemainingToken = tok::equal;
1083 if (NextToken().is(tok::equal) &&
1085 RemainingToken = tok::equalequal;
1090 case tok::greatergreaterequal:
1091 RemainingToken = tok::greaterequal;
1111 (RemainingToken == tok::greater ||
1112 RemainingToken == tok::greatergreater) &&
1113 (Next.isOneOf(tok::greater, tok::greatergreater,
1114 tok::greatergreatergreater, tok::equal, tok::greaterequal,
1115 tok::greatergreaterequal, tok::equalequal)) &&
1139 (Tok.is(tok::greatergreater) || Tok.is(tok::greatergreatergreater)))
1141 else if (Tok.is(tok::greaterequal))
1161 Greater.setKind(tok::greater);
1220 assert(Tok.is(tok::less) && "Must have already parsed the template-name");
1229 if (!Tok.isOneOf(tok::greater, tok::greatergreater,
1230 tok::greatergreatergreater, tok::greaterequal,
1231 tok::greatergreaterequal))
1237 SkipUntil(tok::greater, tok::greatergreater,
1238 tok::greatergreatergreater, StopAtSemi | StopBeforeMatch);
1240 SkipUntil(tok::greater, StopAtSemi | StopBeforeMatch);
1297 assert((Tok.is(tok::less) || TypeConstraint) &&
1312 if (!TypeConstraint || Tok.is(tok::less)) {
1334 Tok.setKind(tok::annot_typename);
1345 Tok.setKind(tok::annot_template_id);
1392 assert(Tok.is(tok::annot_template_id) && "Requires template-id tokens");
1411 Tok.setKind(tok::annot_typename);
1425 return Tok.isOneOf(tok::comma, tok::greater, tok::greatergreater,
1426 tok::greatergreatergreater);
1431 if (!Tok.is(tok::identifier) && !Tok.is(tok::coloncolon) &&
1432 !Tok.is(tok::annot_cxxscope))
1453 if (SS.isSet() && Tok.is(tok::kw_template)) {
1458 if (Tok.is(tok::identifier)) {
1464 TryConsumeToken(tok::ellipsis, EllipsisLoc);
1476 } else if (Tok.is(tok::identifier)) {
1483 TryConsumeToken(tok::ellipsis, EllipsisLoc);
1574 if (TryConsumeToken(tok::ellipsis, EllipsisLoc))
1585 } while (TryConsumeToken(tok::comma));
1671 assert(Tok.isOneOf(tok::l_brace, tok::colon, tok::kw_try) &&
1684 if (Tok.is(tok::kw_try)) {
1687 if (Tok.is(tok::colon))
1692 if (Tok.is(tok::l_brace)) {
1708 tok::TokenKind kind = Tok.getKind();
1711 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false);
1715 if (kind == tok::kw_try) {
1716 while (Tok.is(tok::kw_catch)) {
1717 ConsumeAndStoreUntil(tok::l_brace, Toks, /*StopAtSemi=*/false);
1718 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false);
1730 if (SkipUntil(tok::greater, tok::greatergreater, tok::greatergreatergreater,
1748 assert(Tok.is(tok::less) && "not at a potential angle bracket");
1759 if (NextToken().is(tok::greater) ||
1761 NextToken().isOneOf(tok::greatergreater, tok::greatergreatergreater))) {
1804 if (OpToken.is(tok::comma) && isTypeIdUnambiguously() &&
1813 if (OpToken.is(tok::greater) && Tok.is(tok::l_paren) &&
1814 NextToken().is(tok::r_paren)) {
1824 if (OpToken.is(tok::greater) ||
1826 OpToken.isOneOf(tok::greatergreater, tok::greatergreatergreater)))