Lines Matching refs:tok
32 assert(Tok.isOneOf(tok::l_brace, tok::colon, tok::kw_try, tok::equal) && in ParseCXXInlineMethodDef()
60 if (TryConsumeToken(tok::equal)) { in ParseCXXInlineMethodDef()
62 SkipUntil(tok::semi); in ParseCXXInlineMethodDef()
69 if (TryConsumeToken(tok::kw_delete, KWLoc)) { in ParseCXXInlineMethodDef()
79 } else if (TryConsumeToken(tok::kw_default, KWLoc)) { in ParseCXXInlineMethodDef()
92 if (Tok.is(tok::comma)) { in ParseCXXInlineMethodDef()
95 SkipUntil(tok::semi); in ParseCXXInlineMethodDef()
96 } else if (ExpectAndConsume(tok::semi, diag::err_expected_after, in ParseCXXInlineMethodDef()
98 SkipUntil(tok::semi); in ParseCXXInlineMethodDef()
142 tok::TokenKind kind = Tok.getKind(); in ParseCXXInlineMethodDef()
157 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in ParseCXXInlineMethodDef()
161 if (kind == tok::kw_try) { in ParseCXXInlineMethodDef()
162 while (Tok.is(tok::kw_catch)) { in ParseCXXInlineMethodDef()
163 ConsumeAndStoreUntil(tok::l_brace, Toks, /*StopAtSemi=*/false); in ParseCXXInlineMethodDef()
164 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in ParseCXXInlineMethodDef()
198 assert(Tok.isOneOf(tok::l_brace, tok::equal) && in ParseCXXNonStaticMemberInitializer()
206 tok::TokenKind kind = Tok.getKind(); in ParseCXXNonStaticMemberInitializer()
207 if (kind == tok::equal) { in ParseCXXNonStaticMemberInitializer()
212 if (kind == tok::l_brace) { in ParseCXXNonStaticMemberInitializer()
218 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/true); in ParseCXXNonStaticMemberInitializer()
228 Eof.setKind(tok::eof); in ParseCXXNonStaticMemberInitializer()
328 DefArgEnd.setKind(tok::eof); in ParseLexedMethodDeclaration()
341 assert(Tok.is(tok::equal) && "Default argument not starting with '='"); in ParseLexedMethodDeclaration()
351 if (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace)) { in ParseLexedMethodDeclaration()
360 if (Tok.isNot(tok::eof) || Tok.getEofData() != Param) { in ParseLexedMethodDeclaration()
375 while (Tok.isNot(tok::eof)) in ParseLexedMethodDeclaration()
378 if (Tok.is(tok::eof) && Tok.getEofData() == Param) in ParseLexedMethodDeclaration()
402 ExceptionSpecEnd.setKind(tok::eof); in ParseLexedMethodDeclaration()
444 if (Tok.isNot(tok::eof) || Tok.getEofData() != LM.Method) in ParseLexedMethodDeclaration()
457 while (Tok.isNot(tok::eof)) in ParseLexedMethodDeclaration()
461 if (Tok.is(tok::eof) && Tok.getEofData() == LM.Method) in ParseLexedMethodDeclaration()
507 BodyEnd.setKind(tok::eof); in ParseLexedMethodDef()
518 assert(Tok.isOneOf(tok::l_brace, tok::colon, tok::kw_try) in ParseLexedMethodDef()
526 if (Tok.is(tok::kw_try)) { in ParseLexedMethodDef()
529 while (Tok.isNot(tok::eof)) in ParseLexedMethodDef()
532 if (Tok.is(tok::eof) && Tok.getEofData() == LM.D) in ParseLexedMethodDef()
536 if (Tok.is(tok::colon)) { in ParseLexedMethodDef()
540 if (!Tok.is(tok::l_brace)) { in ParseLexedMethodDef()
544 while (Tok.isNot(tok::eof)) in ParseLexedMethodDef()
547 if (Tok.is(tok::eof) && Tok.getEofData() == LM.D) in ParseLexedMethodDef()
567 while (Tok.isNot(tok::eof)) in ParseLexedMethodDef()
570 if (Tok.is(tok::eof) && Tok.getEofData() == LM.D) in ParseLexedMethodDef()
645 if (Tok.isNot(tok::eof)) { in ParseLexedMemberInitializer()
655 while (Tok.isNot(tok::eof)) in ParseLexedMemberInitializer()
669 bool Parser::ConsumeAndStoreUntil(tok::TokenKind T1, tok::TokenKind T2, in ConsumeAndStoreUntil()
686 case tok::eof: in ConsumeAndStoreUntil()
687 case tok::annot_module_begin: in ConsumeAndStoreUntil()
688 case tok::annot_module_end: in ConsumeAndStoreUntil()
689 case tok::annot_module_include: in ConsumeAndStoreUntil()
693 case tok::l_paren: in ConsumeAndStoreUntil()
697 ConsumeAndStoreUntil(tok::r_paren, Toks, /*StopAtSemi=*/false); in ConsumeAndStoreUntil()
699 case tok::l_square: in ConsumeAndStoreUntil()
703 ConsumeAndStoreUntil(tok::r_square, Toks, /*StopAtSemi=*/false); in ConsumeAndStoreUntil()
705 case tok::l_brace: in ConsumeAndStoreUntil()
709 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in ConsumeAndStoreUntil()
717 case tok::r_paren: in ConsumeAndStoreUntil()
723 case tok::r_square: in ConsumeAndStoreUntil()
729 case tok::r_brace: in ConsumeAndStoreUntil()
736 case tok::code_completion: in ConsumeAndStoreUntil()
741 case tok::string_literal: in ConsumeAndStoreUntil()
742 case tok::wide_string_literal: in ConsumeAndStoreUntil()
743 case tok::utf8_string_literal: in ConsumeAndStoreUntil()
744 case tok::utf16_string_literal: in ConsumeAndStoreUntil()
745 case tok::utf32_string_literal: in ConsumeAndStoreUntil()
749 case tok::semi: in ConsumeAndStoreUntil()
770 if (Tok.is(tok::kw_try)) { in ConsumeAndStoreFunctionPrologue()
775 if (Tok.isNot(tok::colon)) { in ConsumeAndStoreFunctionPrologue()
781 ConsumeAndStoreUntil(tok::l_brace, tok::r_brace, Toks, in ConsumeAndStoreFunctionPrologue()
784 if (Tok.isNot(tok::l_brace)) in ConsumeAndStoreFunctionPrologue()
785 return Diag(Tok.getLocation(), diag::err_expected) << tok::l_brace; in ConsumeAndStoreFunctionPrologue()
809 if (Tok.is(tok::kw_decltype)) { in ConsumeAndStoreFunctionPrologue()
812 if (Tok.isNot(tok::l_paren)) in ConsumeAndStoreFunctionPrologue()
817 if (!ConsumeAndStoreUntil(tok::r_paren, Toks, /*StopAtSemi=*/true)) { in ConsumeAndStoreFunctionPrologue()
818 Diag(Tok.getLocation(), diag::err_expected) << tok::r_paren; in ConsumeAndStoreFunctionPrologue()
819 Diag(OpenLoc, diag::note_matching) << tok::l_paren; in ConsumeAndStoreFunctionPrologue()
825 if (Tok.is(tok::coloncolon)) { in ConsumeAndStoreFunctionPrologue()
829 if (Tok.is(tok::kw_template)) { in ConsumeAndStoreFunctionPrologue()
835 if (Tok.isOneOf(tok::identifier, tok::kw_template)) { in ConsumeAndStoreFunctionPrologue()
838 } else if (Tok.is(tok::code_completion)) { in ConsumeAndStoreFunctionPrologue()
849 } while (Tok.is(tok::coloncolon)); in ConsumeAndStoreFunctionPrologue()
851 if (Tok.is(tok::less)) in ConsumeAndStoreFunctionPrologue()
861 if (!ConsumeAndStoreUntil(tok::l_paren, tok::l_brace, Toks, in ConsumeAndStoreFunctionPrologue()
866 return Diag(Tok.getLocation(), diag::err_expected) << tok::l_brace; in ConsumeAndStoreFunctionPrologue()
868 } else if (Tok.isNot(tok::l_paren) && Tok.isNot(tok::l_brace)) { in ConsumeAndStoreFunctionPrologue()
872 << tok::l_paren << tok::l_brace; in ConsumeAndStoreFunctionPrologue()
874 return Diag(Tok.getLocation(), diag::err_expected) << tok::l_paren; in ConsumeAndStoreFunctionPrologue()
877 tok::TokenKind kind = Tok.getKind(); in ConsumeAndStoreFunctionPrologue()
879 bool IsLParen = (kind == tok::l_paren); in ConsumeAndStoreFunctionPrologue()
885 assert(kind == tok::l_brace && "Must be left paren or brace here."); in ConsumeAndStoreFunctionPrologue()
896 tok::TokenKind CloseKind = IsLParen ? tok::r_paren : tok::r_brace; in ConsumeAndStoreFunctionPrologue()
904 if (Tok.is(tok::ellipsis)) { in ConsumeAndStoreFunctionPrologue()
911 if (Tok.is(tok::comma)) { in ConsumeAndStoreFunctionPrologue()
914 } else if (Tok.is(tok::l_brace)) { in ConsumeAndStoreFunctionPrologue()
933 return Diag(Tok.getLocation(), diag::err_expected_either) << tok::l_brace in ConsumeAndStoreFunctionPrologue()
934 << tok::comma; in ConsumeAndStoreFunctionPrologue()
943 assert(Tok.is(tok::question)); in ConsumeAndStoreConditional()
947 while (Tok.isNot(tok::colon)) { in ConsumeAndStoreConditional()
948 if (!ConsumeAndStoreUntil(tok::question, tok::colon, Toks, in ConsumeAndStoreConditional()
954 if (Tok.is(tok::question) && !ConsumeAndStoreConditional(Toks)) in ConsumeAndStoreConditional()
968 tok::TokenKind EndKind) in UnannotatedTentativeParsingAction()
995 tok::TokenKind EndKind;
1017 case tok::comma: in ConsumeAndStoreInitializer()
1037 ? tok::semi : tok::r_paren); in ConsumeAndStoreInitializer()
1047 if (Result == TPResult::Ambiguous && Tok.isNot(tok::semi)) in ConsumeAndStoreInitializer()
1079 case tok::eof: in ConsumeAndStoreInitializer()
1080 case tok::annot_module_begin: in ConsumeAndStoreInitializer()
1081 case tok::annot_module_end: in ConsumeAndStoreInitializer()
1082 case tok::annot_module_include: in ConsumeAndStoreInitializer()
1086 case tok::less: in ConsumeAndStoreInitializer()
1092 case tok::question: in ConsumeAndStoreInitializer()
1099 case tok::greatergreatergreater: in ConsumeAndStoreInitializer()
1105 case tok::greatergreater: in ConsumeAndStoreInitializer()
1111 case tok::greater: in ConsumeAndStoreInitializer()
1116 case tok::kw_template: in ConsumeAndStoreInitializer()
1122 if (Tok.is(tok::identifier)) { in ConsumeAndStoreInitializer()
1125 if (Tok.is(tok::less)) { in ConsumeAndStoreInitializer()
1134 case tok::kw_operator: in ConsumeAndStoreInitializer()
1140 case tok::comma: in ConsumeAndStoreInitializer()
1141 case tok::greatergreatergreater: in ConsumeAndStoreInitializer()
1142 case tok::greatergreater: in ConsumeAndStoreInitializer()
1143 case tok::greater: in ConsumeAndStoreInitializer()
1144 case tok::less: in ConsumeAndStoreInitializer()
1153 case tok::l_paren: in ConsumeAndStoreInitializer()
1157 ConsumeAndStoreUntil(tok::r_paren, Toks, /*StopAtSemi=*/false); in ConsumeAndStoreInitializer()
1159 case tok::l_square: in ConsumeAndStoreInitializer()
1163 ConsumeAndStoreUntil(tok::r_square, Toks, /*StopAtSemi=*/false); in ConsumeAndStoreInitializer()
1165 case tok::l_brace: in ConsumeAndStoreInitializer()
1169 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in ConsumeAndStoreInitializer()
1178 case tok::r_paren: in ConsumeAndStoreInitializer()
1186 case tok::r_square: in ConsumeAndStoreInitializer()
1192 case tok::r_brace: in ConsumeAndStoreInitializer()
1199 case tok::code_completion: in ConsumeAndStoreInitializer()
1204 case tok::string_literal: in ConsumeAndStoreInitializer()
1205 case tok::wide_string_literal: in ConsumeAndStoreInitializer()
1206 case tok::utf8_string_literal: in ConsumeAndStoreInitializer()
1207 case tok::utf16_string_literal: in ConsumeAndStoreInitializer()
1208 case tok::utf32_string_literal: in ConsumeAndStoreInitializer()
1212 case tok::semi: in ConsumeAndStoreInitializer()