Lines Matching refs:Tok

161   tok::TokenKind Kind  = Tok.getKind();
194 if (Tok.is(tok::semi))
200 if (Tok.isNot(tok::identifier))
209 SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
215 if (Tok.is(tok::r_brace)) {
216 Diag(Tok, diag::err_expected_statement);
231 bool HasLeadingEmptyMacro = Tok.hasLeadingEmptyMacro();
333 Diag(Tok, diag::err_pragma_fp_contract_scope);
381 Token OldToken = Tok;
390 if (Tok.is(tok::semi))
395 if (Tok.is(tok::colon) && getCurScope()->isSwitchScope() &&
412 assert(Tok.is(tok::kw___try) && "Expected '__try'");
427 if(Tok.isNot(tok::l_brace))
428 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace);
436 if (Tok.is(tok::identifier) &&
437 Tok.getIdentifierInfo() == getSEHExceptKeyword()) {
440 } else if (Tok.is(tok::kw___finally)) {
444 return StmtError(Diag(Tok,diag::err_seh_expected_handler));
532 assert(Tok.is(tok::identifier) && Tok.getIdentifierInfo() &&
535 Token IdentTok = Tok; // Save the whole token.
538 assert(Tok.is(tok::colon) && "Not a label!");
545 if (Tok.is(tok::kw___attribute)) {
556 if (!getLangOpts().CPlusPlus || Tok.is(tok::semi))
570 Diag(Tok, diag::err_expected_after) << "__attribute__" << tok::semi;
599 assert((MissingCase || Tok.is(tok::kw_case)) && "Not a case stmt!");
631 if (Tok.is(tok::code_completion)) {
713 } while (Tok.is(tok::kw_case));
718 if (Tok.isNot(tok::r_brace)) {
750 assert(Tok.is(tok::kw_default) && "Not a default stmt!");
770 if (Tok.isNot(tok::r_brace)) {
822 assert(Tok.is(tok::l_brace) && "Not a compount stmt!");
838 switch (Tok.getKind()) {
886 Tok.getLocation(),
907 while (Tok.is(tok::kw___label__)) {
912 if (Tok.isNot(tok::identifier)) {
913 Diag(Tok, diag::err_expected) << tok::identifier;
917 IdentifierInfo *II = Tok.getIdentifierInfo();
928 StmtResult R = Actions.ActOnDeclStmt(Res, LabelLoc, Tok.getLocation());
935 while (Tok.isNot(tok::r_brace) && !isEofOrEom()) {
936 if (Tok.is(tok::annot_pragma_unused)) {
942 if (Tok.isNot(tok::kw___extension__)) {
950 while (Tok.is(tok::kw___extension__))
963 SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
989 SourceLocation CloseLoc = Tok.getLocation();
1034 if (ExprResult.isInvalid() && !DeclResult && Tok.isNot(tok::r_paren)) {
1038 if (Tok.isNot(tok::r_paren))
1048 while (Tok.is(tok::r_paren)) {
1049 Diag(Tok, diag::err_extraneous_rparen_in_condition)
1050 << FixItHint::CreateRemoval(Tok.getLocation());
1066 assert(Tok.is(tok::kw_if) && "Not an if stmt!");
1069 if (Tok.isNot(tok::l_paren)) {
1070 Diag(Tok, diag::err_expected_lparen_after) << "if";
1117 ParseScope InnerScope(this, Scope::DeclScope, C99orCXX, Tok.is(tok::l_brace));
1120 SourceLocation ThenStmtLoc = Tok.getLocation();
1133 if (Tok.is(tok::kw_else)) {
1135 *TrailingElseLoc = Tok.getLocation();
1138 ElseStmtLoc = Tok.getLocation();
1149 ParseScope InnerScope(this, Scope::DeclScope, C99orCXX, Tok.is(tok::l_brace));
1155 } else if (Tok.is(tok::code_completion)) {
1190 assert(Tok.is(tok::kw_switch) && "Not a switch stmt!");
1193 if (Tok.isNot(tok::l_paren)) {
1194 Diag(Tok, diag::err_expected_lparen_after) << "switch";
1232 if (Tok.is(tok::l_brace)) {
1252 ParseScope InnerScope(this, Scope::DeclScope, C99orCXX, Tok.is(tok::l_brace));
1274 assert(Tok.is(tok::kw_while) && "Not a while stmt!");
1275 SourceLocation WhileLoc = Tok.getLocation();
1278 if (Tok.isNot(tok::l_paren)) {
1279 Diag(Tok, diag::err_expected_lparen_after) << "while";
1325 ParseScope InnerScope(this, Scope::DeclScope, C99orCXX, Tok.is(tok::l_brace));
1345 assert(Tok.is(tok::kw_do) && "Not a do stmt!");
1367 ParseScope InnerScope(this, Scope::DeclScope, C99orCXX, Tok.is(tok::l_brace));
1375 if (Tok.isNot(tok::kw_while)) {
1377 Diag(Tok, diag::err_expected_while);
1385 if (Tok.isNot(tok::l_paren)) {
1386 Diag(Tok, diag::err_expected_lparen_after) << "do/while";
1410 assert(Tok.is(tok::identifier));
1420 bool Result = Tok.is(tok::colon);
1448 assert(Tok.is(tok::kw_for) && "Not a for stmt!");
1451 if (Tok.isNot(tok::l_paren)) {
1452 Diag(Tok, diag::err_expected_lparen_after) << "for";
1495 if (Tok.is(tok::code_completion)) {
1507 if (Tok.is(tok::semi)) { // for (;
1511 } else if (getLangOpts().CPlusPlus && Tok.is(tok::identifier) &&
1514 IdentifierInfo *Name = Tok.getIdentifierInfo();
1519 if (Tok.is(tok::l_brace))
1537 Diag(Tok, diag::ext_c99_variable_decl_in_for_loop);
1543 SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
1548 FirstPart = Actions.ActOnDeclStmt(DG, DeclStart, Tok.getLocation());
1554 } else if (Tok.is(tok::semi)) { // for (int x = 4;
1561 if (Tok.is(tok::code_completion)) {
1568 Diag(Tok, diag::err_expected_semi_for);
1584 if (Tok.is(tok::semi)) {
1589 if (Tok.is(tok::code_completion)) {
1595 } else if (getLangOpts().CPlusPlus11 && Tok.is(tok::colon) && FirstPart.get()) {
1598 Diag(Tok, diag::err_for_range_expected_decl)
1604 Diag(Tok, diag::err_expected_semi_for);
1608 if (Tok.is(tok::semi))
1619 if (Tok.is(tok::semi)) { // for (...;;
1621 } else if (Tok.is(tok::r_paren)) {
1637 if (Tok.isNot(tok::semi)) {
1639 Diag(Tok, diag::err_expected_semi_for);
1645 if (Tok.is(tok::semi)) {
1650 if (Tok.isNot(tok::r_paren)) { // for (...;...;)
1695 Tok.is(tok::l_brace));
1736 assert(Tok.is(tok::kw_goto) && "Not a goto stmt!");
1740 if (Tok.is(tok::identifier)) {
1741 LabelDecl *LD = Actions.LookupOrCreateLabel(Tok.getIdentifierInfo(),
1742 Tok.getLocation());
1743 Res = Actions.ActOnGotoStmt(GotoLoc, Tok.getLocation(), LD);
1745 } else if (Tok.is(tok::star)) {
1747 Diag(Tok, diag::ext_gnu_indirect_goto);
1756 Diag(Tok, diag::err_expected) << tok::identifier;
1789 assert(Tok.is(tok::kw_return) && "Not a return stmt!");
1793 if (Tok.isNot(tok::semi)) {
1794 if (Tok.is(tok::code_completion)) {
1800 if (Tok.is(tok::l_brace) && getLangOpts().CPlusPlus) {
1824 while (Tok.is(tok::annot_pragma_loop_hint)) {
1848 assert(Tok.is(tok::l_brace));
1849 SourceLocation LBraceLoc = Tok.getLocation();
1881 assert(Tok.is(tok::kw_try) && "Expected 'try'");
1888 if (Tok.is(tok::colon))
1899 SourceLocation LBraceLoc = Tok.getLocation();
1913 assert(Tok.is(tok::l_brace));
1942 assert(Tok.is(tok::kw_try) && "Expected 'try'");
1965 if (Tok.isNot(tok::l_brace))
1966 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace);
1977 if ((Tok.is(tok::identifier) &&
1978 Tok.getIdentifierInfo() == getSEHExceptKeyword()) ||
1979 Tok.is(tok::kw___finally)) {
1982 if(Tok.getIdentifierInfo() == getSEHExceptKeyword()) {
2005 if (Tok.isNot(tok::kw_catch))
2006 return StmtError(Diag(Tok, diag::err_expected_catch));
2007 while (Tok.is(tok::kw_catch)) {
2032 assert(Tok.is(tok::kw_catch) && "Expected 'catch'");
2049 if (Tok.isNot(tok::ellipsis)) {
2069 if (Tok.isNot(tok::l_brace))
2070 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace);
2090 if (!Tok.is(tok::l_brace)) {
2091 Diag(Tok, diag::err_expected) << tok::l_brace;
2111 Diag(Tok, diag::err_expected) << tok::l_brace;
2129 while (Tok.isNot(tok::r_brace)) {