• Home
  • Raw
  • Download

Lines Matching refs:tok

34   if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) {  in ParseDeclarationStartingWithTemplate()
65 assert(Tok.isOneOf(tok::kw_export, tok::kw_template) && in ParseTemplateDeclarationOrSpecialization()
105 TryConsumeToken(tok::kw_export, ExportLoc); in ParseTemplateDeclarationOrSpecialization()
109 if (!TryConsumeToken(tok::kw_template, TemplateLoc)) { in ParseTemplateDeclarationOrSpecialization()
120 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseTemplateDeclarationOrSpecialization()
121 TryConsumeToken(tok::semi); in ParseTemplateDeclarationOrSpecialization()
130 if (TryConsumeToken(tok::kw_requires)) { in ParseTemplateDeclarationOrSpecialization()
135 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseTemplateDeclarationOrSpecialization()
136 TryConsumeToken(tok::semi); in ParseTemplateDeclarationOrSpecialization()
147 } while (Tok.isOneOf(tok::kw_export, tok::kw_template)); in ParseTemplateDeclarationOrSpecialization()
182 if (Tok.is(tok::kw_static_assert)) { in ParseSingleDeclarationAfterTemplate()
200 if (Tok.is(tok::kw_using)) in ParseSingleDeclarationAfterTemplate()
211 if (Tok.is(tok::semi)) { in ParseSingleDeclarationAfterTemplate()
239 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseSingleDeclarationAfterTemplate()
240 if (Tok.is(tok::semi)) in ParseSingleDeclarationAfterTemplate()
306 if (Tok.is(tok::comma)) { in ParseSingleDeclarationAfterTemplate()
309 SkipUntil(tok::semi); in ParseSingleDeclarationAfterTemplate()
335 if (!TryConsumeToken(tok::less, LAngleLoc)) { in ParseTemplateParameters()
342 if (!Tok.is(tok::greater) && !Tok.is(tok::greatergreater)) in ParseTemplateParameters()
345 if (Tok.is(tok::greatergreater)) { in ParseTemplateParameters()
351 Tok.setKind(tok::greater); in ParseTemplateParameters()
354 } else if (!TryConsumeToken(tok::greater, RAngleLoc) && Failed) { in ParseTemplateParameters()
355 Diag(Tok.getLocation(), diag::err_expected) << tok::greater; in ParseTemplateParameters()
379 SkipUntil(tok::comma, tok::greater, tok::greatergreater, in ParseTemplateParameterList()
384 if (Tok.is(tok::comma)) { in ParseTemplateParameterList()
386 } else if (Tok.isOneOf(tok::greater, tok::greatergreater)) { in ParseTemplateParameterList()
394 SkipUntil(tok::comma, tok::greater, tok::greatergreater, in ParseTemplateParameterList()
405 if (Tok.is(tok::kw_class)) { in isStartOfTemplateTypeParameter()
409 case tok::equal: in isStartOfTemplateTypeParameter()
410 case tok::comma: in isStartOfTemplateTypeParameter()
411 case tok::greater: in isStartOfTemplateTypeParameter()
412 case tok::greatergreater: in isStartOfTemplateTypeParameter()
413 case tok::ellipsis: in isStartOfTemplateTypeParameter()
416 case tok::identifier: in isStartOfTemplateTypeParameter()
426 case tok::equal: in isStartOfTemplateTypeParameter()
427 case tok::comma: in isStartOfTemplateTypeParameter()
428 case tok::greater: in isStartOfTemplateTypeParameter()
429 case tok::greatergreater: in isStartOfTemplateTypeParameter()
437 if (Tok.isNot(tok::kw_typename)) in isStartOfTemplateTypeParameter()
449 if (Next.getKind() == tok::identifier) in isStartOfTemplateTypeParameter()
453 case tok::equal: in isStartOfTemplateTypeParameter()
454 case tok::comma: in isStartOfTemplateTypeParameter()
455 case tok::greater: in isStartOfTemplateTypeParameter()
456 case tok::greatergreater: in isStartOfTemplateTypeParameter()
457 case tok::ellipsis: in isStartOfTemplateTypeParameter()
484 if (Tok.is(tok::kw_template)) in ParseTemplateParameter()
503 assert(Tok.isOneOf(tok::kw_class, tok::kw_typename) && in ParseTypeParameter()
507 bool TypenameKeyword = Tok.is(tok::kw_typename); in ParseTypeParameter()
512 if (TryConsumeToken(tok::ellipsis, EllipsisLoc)) { in ParseTypeParameter()
522 if (Tok.is(tok::identifier)) { in ParseTypeParameter()
525 } else if (Tok.isOneOf(tok::equal, tok::comma, tok::greater, in ParseTypeParameter()
526 tok::greatergreater)) { in ParseTypeParameter()
530 Diag(Tok.getLocation(), diag::err_expected) << tok::identifier; in ParseTypeParameter()
536 if (TryConsumeToken(tok::ellipsis, EllipsisLoc)) in ParseTypeParameter()
544 if (TryConsumeToken(tok::equal, EqualLoc)) in ParseTypeParameter()
566 assert(Tok.is(tok::kw_template) && "Expected 'template' keyword"); in ParseTemplateTemplateParameter()
585 if (!TryConsumeToken(tok::kw_class)) { in ParseTemplateTemplateParameter()
586 bool Replace = Tok.isOneOf(tok::kw_typename, tok::kw_struct); in ParseTemplateTemplateParameter()
587 const Token &Next = Tok.is(tok::kw_struct) ? NextToken() : Tok; in ParseTemplateTemplateParameter()
588 if (Tok.is(tok::kw_typename)) { in ParseTemplateTemplateParameter()
596 } else if (Next.isOneOf(tok::identifier, tok::comma, tok::greater, in ParseTemplateTemplateParameter()
597 tok::greatergreater, tok::ellipsis)) { in ParseTemplateTemplateParameter()
610 if (TryConsumeToken(tok::ellipsis, EllipsisLoc)) in ParseTemplateTemplateParameter()
619 if (Tok.is(tok::identifier)) { in ParseTemplateTemplateParameter()
622 } else if (Tok.isOneOf(tok::equal, tok::comma, tok::greater, in ParseTemplateTemplateParameter()
623 tok::greatergreater)) { in ParseTemplateTemplateParameter()
627 Diag(Tok.getLocation(), diag::err_expected) << tok::identifier; in ParseTemplateTemplateParameter()
633 if (TryConsumeToken(tok::ellipsis, EllipsisLoc)) in ParseTemplateTemplateParameter()
647 if (TryConsumeToken(tok::equal, EqualLoc)) { in ParseTemplateTemplateParameter()
652 SkipUntil(tok::comma, tok::greater, tok::greatergreater, in ParseTemplateTemplateParameter()
687 if (TryConsumeToken(tok::ellipsis, EllipsisLoc)) in ParseNonTypeTemplateParameter()
695 if (TryConsumeToken(tok::equal, EqualLoc)) { in ParseNonTypeTemplateParameter()
707 SkipUntil(tok::comma, tok::greater, StopAtSemi | StopBeforeMatch); in ParseNonTypeTemplateParameter()
757 tok::TokenKind RemainingToken; in ParseGreaterThanInTemplateList()
762 Diag(Tok.getLocation(), diag::err_expected) << tok::greater; in ParseGreaterThanInTemplateList()
765 case tok::greater: in ParseGreaterThanInTemplateList()
773 case tok::greatergreater: in ParseGreaterThanInTemplateList()
774 RemainingToken = tok::greater; in ParseGreaterThanInTemplateList()
777 case tok::greatergreatergreater: in ParseGreaterThanInTemplateList()
778 RemainingToken = tok::greatergreater; in ParseGreaterThanInTemplateList()
781 case tok::greaterequal: in ParseGreaterThanInTemplateList()
782 RemainingToken = tok::equal; in ParseGreaterThanInTemplateList()
786 case tok::greatergreaterequal: in ParseGreaterThanInTemplateList()
787 RemainingToken = tok::greaterequal; in ParseGreaterThanInTemplateList()
817 if ((RemainingToken == tok::greater || in ParseGreaterThanInTemplateList()
818 RemainingToken == tok::greatergreater) && in ParseGreaterThanInTemplateList()
819 (Next.isOneOf(tok::greater, tok::greatergreater, in ParseGreaterThanInTemplateList()
820 tok::greatergreatergreater, tok::equal, in ParseGreaterThanInTemplateList()
821 tok::greaterequal, tok::greatergreaterequal, in ParseGreaterThanInTemplateList()
822 tok::equalequal)) && in ParseGreaterThanInTemplateList()
828 (Tok.is(tok::greatergreater) || Tok.is(tok::greatergreatergreater))) in ParseGreaterThanInTemplateList()
830 else if (Tok.is(tok::greaterequal)) in ParseGreaterThanInTemplateList()
837 if (RemainingToken == tok::equal && Next.is(tok::equal) && in ParseGreaterThanInTemplateList()
843 Tok.setKind(tok::equalequal); in ParseGreaterThanInTemplateList()
856 if (ObjCGenericList && PrevTok.getKind() == tok::greatergreater && in ParseGreaterThanInTemplateList()
857 RemainingToken == tok::greater && PP.IsPreviousCachedToken(PrevTok)) { in ParseGreaterThanInTemplateList()
872 Tok.setKind(tok::greater); in ParseGreaterThanInTemplateList()
906 assert(Tok.is(tok::less) && "Must have already parsed the template-name"); in ParseTemplateIdAfterTemplateName()
915 if (Tok.isNot(tok::greater) && Tok.isNot(tok::greatergreater)) in ParseTemplateIdAfterTemplateName()
921 SkipUntil(tok::greater, StopAtSemi); in ParseTemplateIdAfterTemplateName()
923 SkipUntil(tok::greater, StopAtSemi | StopBeforeMatch); in ParseTemplateIdAfterTemplateName()
975 assert(Template && Tok.is(tok::less) && in AnnotateTemplateIdToken()
993 TryConsumeToken(tok::greater); in AnnotateTemplateIdToken()
1008 TryConsumeToken(tok::greater); in AnnotateTemplateIdToken()
1012 Tok.setKind(tok::annot_typename); in AnnotateTemplateIdToken()
1023 Tok.setKind(tok::annot_template_id); in AnnotateTemplateIdToken()
1066 assert(Tok.is(tok::annot_template_id) && "Requires template-id tokens"); in AnnotateTemplateIdTokenAsType()
1085 Tok.setKind(tok::annot_typename); in AnnotateTemplateIdTokenAsType()
1098 return Tok.isOneOf(tok::comma, tok::greater, tok::greatergreater); in isEndOfTemplateArgument()
1103 if (!Tok.is(tok::identifier) && !Tok.is(tok::coloncolon) && in ParseTemplateTemplateArgument()
1104 !Tok.is(tok::annot_cxxscope)) in ParseTemplateTemplateArgument()
1124 if (SS.isSet() && Tok.is(tok::kw_template)) { in ParseTemplateTemplateArgument()
1129 if (Tok.is(tok::identifier)) { in ParseTemplateTemplateArgument()
1135 TryConsumeToken(tok::ellipsis, EllipsisLoc); in ParseTemplateTemplateArgument()
1148 } else if (Tok.is(tok::identifier)) { in ParseTemplateTemplateArgument()
1155 TryConsumeToken(tok::ellipsis, EllipsisLoc); in ParseTemplateTemplateArgument()
1244 if (!TryConsumeToken(tok::less)) in IsTemplateArgumentList()
1248 if (Tok.is(tok::greater)) in IsTemplateArgumentList()
1256 return Tok.isOneOf(tok::greater, tok::comma); in IsTemplateArgumentList()
1274 if (TryConsumeToken(tok::ellipsis, EllipsisLoc)) in ParseTemplateArgumentList()
1278 SkipUntil(tok::comma, tok::greater, StopAtSemi | StopBeforeMatch); in ParseTemplateArgumentList()
1287 } while (TryConsumeToken(tok::comma)); in ParseTemplateArgumentList()
1378 assert(Tok.isOneOf(tok::l_brace, tok::colon, tok::kw_try) && in ParseLateTemplatedFuncDef()
1391 if (Tok.is(tok::kw_try)) { in ParseLateTemplatedFuncDef()
1394 if (Tok.is(tok::colon)) in ParseLateTemplatedFuncDef()
1399 if (Tok.is(tok::l_brace)) { in ParseLateTemplatedFuncDef()
1422 tok::TokenKind kind = Tok.getKind(); in LexTemplateFunctionForLateParsing()
1425 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in LexTemplateFunctionForLateParsing()
1429 if (kind == tok::kw_try) { in LexTemplateFunctionForLateParsing()
1430 while (Tok.is(tok::kw_catch)) { in LexTemplateFunctionForLateParsing()
1431 ConsumeAndStoreUntil(tok::l_brace, Toks, /*StopAtSemi=*/false); in LexTemplateFunctionForLateParsing()
1432 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in LexTemplateFunctionForLateParsing()