• Home
  • Raw
  • Download

Lines Matching refs:tok

129     WantTypeSpecifiers = nextTok.isOneOf(tok::l_paren, tok::less, tok::l_square,  in StatementFilterCCC()
130 tok::identifier, tok::star, tok::amp); in StatementFilterCCC()
132 nextTok.isOneOf(tok::l_paren, tok::identifier, tok::arrow, tok::period); in StatementFilterCCC()
134 nextTok.isOneOf(tok::l_paren, tok::semi, tok::identifier, tok::l_brace); in StatementFilterCCC()
141 if (NextToken.is(tok::equal)) in ValidateCandidate()
143 if (NextToken.is(tok::period) && in ValidateCandidate()
165 tok::TokenKind Kind = Tok.getKind(); in ParseStatementOrDeclarationAfterAttributes()
168 case tok::at: // May be a @try or @throw statement in ParseStatementOrDeclarationAfterAttributes()
175 case tok::code_completion: in ParseStatementOrDeclarationAfterAttributes()
180 case tok::identifier: { in ParseStatementOrDeclarationAfterAttributes()
182 if (Next.is(tok::colon)) { // C99 6.8.1: labeled-statement in ParseStatementOrDeclarationAfterAttributes()
189 if (Next.isNot(tok::coloncolon)) { in ParseStatementOrDeclarationAfterAttributes()
197 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseStatementOrDeclarationAfterAttributes()
198 if (Tok.is(tok::semi)) in ParseStatementOrDeclarationAfterAttributes()
204 if (Tok.isNot(tok::identifier)) in ParseStatementOrDeclarationAfterAttributes()
220 if (Tok.is(tok::r_brace)) { in ParseStatementOrDeclarationAfterAttributes()
228 case tok::kw_case: // C99 6.8.1: labeled-statement in ParseStatementOrDeclarationAfterAttributes()
230 case tok::kw_default: // C99 6.8.1: labeled-statement in ParseStatementOrDeclarationAfterAttributes()
233 case tok::l_brace: // C99 6.8.2: compound-statement in ParseStatementOrDeclarationAfterAttributes()
235 case tok::semi: { // C99 6.8.3p3: expression[opt] ';' in ParseStatementOrDeclarationAfterAttributes()
240 case tok::kw_if: // C99 6.8.4.1: if-statement in ParseStatementOrDeclarationAfterAttributes()
242 case tok::kw_switch: // C99 6.8.4.2: switch-statement in ParseStatementOrDeclarationAfterAttributes()
245 case tok::kw_while: // C99 6.8.5.1: while-statement in ParseStatementOrDeclarationAfterAttributes()
247 case tok::kw_do: // C99 6.8.5.2: do-statement in ParseStatementOrDeclarationAfterAttributes()
251 case tok::kw_for: // C99 6.8.5.3: for-statement in ParseStatementOrDeclarationAfterAttributes()
254 case tok::kw_goto: // C99 6.8.6.1: goto-statement in ParseStatementOrDeclarationAfterAttributes()
258 case tok::kw_continue: // C99 6.8.6.2: continue-statement in ParseStatementOrDeclarationAfterAttributes()
262 case tok::kw_break: // C99 6.8.6.3: break-statement in ParseStatementOrDeclarationAfterAttributes()
266 case tok::kw_return: // C99 6.8.6.4: return-statement in ParseStatementOrDeclarationAfterAttributes()
270 case tok::kw_co_return: // C++ Coroutines: co_return statement in ParseStatementOrDeclarationAfterAttributes()
275 case tok::kw_asm: { in ParseStatementOrDeclarationAfterAttributes()
285 case tok::kw___if_exists: in ParseStatementOrDeclarationAfterAttributes()
286 case tok::kw___if_not_exists: in ParseStatementOrDeclarationAfterAttributes()
293 case tok::kw_try: // C++ 15: try-block in ParseStatementOrDeclarationAfterAttributes()
296 case tok::kw___try: in ParseStatementOrDeclarationAfterAttributes()
300 case tok::kw___leave: in ParseStatementOrDeclarationAfterAttributes()
305 case tok::annot_pragma_vis: in ParseStatementOrDeclarationAfterAttributes()
310 case tok::annot_pragma_pack: in ParseStatementOrDeclarationAfterAttributes()
315 case tok::annot_pragma_msstruct: in ParseStatementOrDeclarationAfterAttributes()
320 case tok::annot_pragma_align: in ParseStatementOrDeclarationAfterAttributes()
325 case tok::annot_pragma_weak: in ParseStatementOrDeclarationAfterAttributes()
330 case tok::annot_pragma_weakalias: in ParseStatementOrDeclarationAfterAttributes()
335 case tok::annot_pragma_redefine_extname: in ParseStatementOrDeclarationAfterAttributes()
340 case tok::annot_pragma_fp_contract: in ParseStatementOrDeclarationAfterAttributes()
346 case tok::annot_pragma_opencl_extension: in ParseStatementOrDeclarationAfterAttributes()
351 case tok::annot_pragma_captured: in ParseStatementOrDeclarationAfterAttributes()
355 case tok::annot_pragma_openmp: in ParseStatementOrDeclarationAfterAttributes()
359 case tok::annot_pragma_ms_pointers_to_members: in ParseStatementOrDeclarationAfterAttributes()
364 case tok::annot_pragma_ms_pragma: in ParseStatementOrDeclarationAfterAttributes()
369 case tok::annot_pragma_ms_vtordisp: in ParseStatementOrDeclarationAfterAttributes()
374 case tok::annot_pragma_loop_hint: in ParseStatementOrDeclarationAfterAttributes()
378 case tok::annot_pragma_dump: in ParseStatementOrDeclarationAfterAttributes()
384 if (!TryConsumeToken(tok::semi) && !Res.isInvalid()) { in ParseStatementOrDeclarationAfterAttributes()
388 ExpectAndConsume(tok::semi, diag::err_expected_semi_after_stmt, SemiError); in ParseStatementOrDeclarationAfterAttributes()
390 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseStatementOrDeclarationAfterAttributes()
407 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseExprStatement()
408 if (Tok.is(tok::semi)) in ParseExprStatement()
413 if (Tok.is(tok::colon) && getCurScope()->isSwitchScope() && in ParseExprStatement()
439 assert(Tok.is(tok::kw___try) && "Expected '__try'"); in ParseSEHTryBlock()
442 if (Tok.isNot(tok::l_brace)) in ParseSEHTryBlock()
443 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace); in ParseSEHTryBlock()
451 if (Tok.is(tok::identifier) && in ParseSEHTryBlock()
455 } else if (Tok.is(tok::kw___finally)) { in ParseSEHTryBlock()
481 if (ExpectAndConsume(tok::l_paren)) in ParseSEHExceptBlock()
509 if (ExpectAndConsume(tok::r_paren)) in ParseSEHExceptBlock()
512 if (Tok.isNot(tok::l_brace)) in ParseSEHExceptBlock()
513 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace); in ParseSEHExceptBlock()
533 if (Tok.isNot(tok::l_brace)) in ParseSEHFinallyBlock()
534 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace); in ParseSEHFinallyBlock()
565 assert(Tok.is(tok::identifier) && Tok.getIdentifierInfo() && in ParseLabeledStatement()
571 assert(Tok.is(tok::colon) && "Not a label!"); in ParseLabeledStatement()
578 if (Tok.is(tok::kw___attribute)) { in ParseLabeledStatement()
589 if (!getLangOpts().CPlusPlus || Tok.is(tok::semi)) in ParseLabeledStatement()
604 Diag(Tok, diag::err_expected_after) << "__attribute__" << tok::semi; in ParseLabeledStatement()
633 assert((MissingCase || Tok.is(tok::kw_case)) && "Not a case stmt!"); in ParseCaseStatement()
665 if (Tok.is(tok::code_completion)) { in ParseCaseStatement()
687 if (SkipUntil(tok::colon, tok::r_brace, StopAtSemi | StopBeforeMatch)) { in ParseCaseStatement()
688 TryConsumeToken(tok::colon, ColonLoc); in ParseCaseStatement()
701 if (TryConsumeToken(tok::ellipsis, DotDotDotLoc)) { in ParseCaseStatement()
705 if (SkipUntil(tok::colon, tok::r_brace, StopAtSemi | StopBeforeMatch)) { in ParseCaseStatement()
706 TryConsumeToken(tok::colon, ColonLoc); in ParseCaseStatement()
715 if (TryConsumeToken(tok::colon, ColonLoc)) { in ParseCaseStatement()
716 } else if (TryConsumeToken(tok::semi, ColonLoc) || in ParseCaseStatement()
717 TryConsumeToken(tok::coloncolon, ColonLoc)) { in ParseCaseStatement()
720 << "'case'" << tok::colon in ParseCaseStatement()
725 << "'case'" << tok::colon in ParseCaseStatement()
753 } while (Tok.is(tok::kw_case)); in ParseCaseStatement()
758 if (Tok.isNot(tok::r_brace)) { in ParseCaseStatement()
791 assert(Tok.is(tok::kw_default) && "Not a default stmt!"); in ParseDefaultStatement()
795 if (TryConsumeToken(tok::colon, ColonLoc)) { in ParseDefaultStatement()
796 } else if (TryConsumeToken(tok::semi, ColonLoc)) { in ParseDefaultStatement()
799 << "'default'" << tok::colon in ParseDefaultStatement()
804 << "'default'" << tok::colon in ParseDefaultStatement()
811 if (Tok.isNot(tok::r_brace)) { in ParseDefaultStatement()
859 assert(Tok.is(tok::l_brace) && "Not a compount stmt!"); in ParseCompoundStatement()
876 case tok::annot_pragma_vis: in ParseCompoundStatementLeadingPragmas()
879 case tok::annot_pragma_pack: in ParseCompoundStatementLeadingPragmas()
882 case tok::annot_pragma_msstruct: in ParseCompoundStatementLeadingPragmas()
885 case tok::annot_pragma_align: in ParseCompoundStatementLeadingPragmas()
888 case tok::annot_pragma_weak: in ParseCompoundStatementLeadingPragmas()
891 case tok::annot_pragma_weakalias: in ParseCompoundStatementLeadingPragmas()
894 case tok::annot_pragma_redefine_extname: in ParseCompoundStatementLeadingPragmas()
897 case tok::annot_pragma_opencl_extension: in ParseCompoundStatementLeadingPragmas()
900 case tok::annot_pragma_fp_contract: in ParseCompoundStatementLeadingPragmas()
903 case tok::annot_pragma_ms_pointers_to_members: in ParseCompoundStatementLeadingPragmas()
906 case tok::annot_pragma_ms_pragma: in ParseCompoundStatementLeadingPragmas()
909 case tok::annot_pragma_ms_vtordisp: in ParseCompoundStatementLeadingPragmas()
912 case tok::annot_pragma_dump: in ParseCompoundStatementLeadingPragmas()
937 BalancedDelimiterTracker T(*this, tok::l_brace); in ParseCompoundStatementBody()
950 while (Tok.is(tok::kw___label__)) { in ParseCompoundStatementBody()
955 if (Tok.isNot(tok::identifier)) { in ParseCompoundStatementBody()
956 Diag(Tok, diag::err_expected) << tok::identifier; in ParseCompoundStatementBody()
964 if (!TryConsumeToken(tok::comma)) in ParseCompoundStatementBody()
978 while (!tryParseMisplacedModuleImport() && Tok.isNot(tok::r_brace) && in ParseCompoundStatementBody()
979 Tok.isNot(tok::eof)) { in ParseCompoundStatementBody()
980 if (Tok.is(tok::annot_pragma_unused)) { in ParseCompoundStatementBody()
986 if (Tok.isNot(tok::kw___extension__)) { in ParseCompoundStatementBody()
994 while (Tok.is(tok::kw___extension__)) in ParseCompoundStatementBody()
1016 SkipUntil(tok::semi); in ParseCompoundStatementBody()
1060 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseParenExprOrCondition()
1078 if (Cond.isInvalid() && Tok.isNot(tok::r_paren)) { in ParseParenExprOrCondition()
1079 SkipUntil(tok::semi); in ParseParenExprOrCondition()
1082 if (Tok.isNot(tok::r_paren)) in ParseParenExprOrCondition()
1092 while (Tok.is(tok::r_paren)) { in ParseParenExprOrCondition()
1110 assert(Tok.is(tok::kw_if) && "Not an if stmt!"); in ParseIfStatement()
1114 if (Tok.is(tok::kw_constexpr)) { in ParseIfStatement()
1121 if (Tok.isNot(tok::l_paren)) { in ParseIfStatement()
1123 SkipUntil(tok::semi); in ParseIfStatement()
1173 ParseScope InnerScope(this, Scope::DeclScope, C99orCXX, Tok.is(tok::l_brace)); in ParseIfStatement()
1195 if (Tok.is(tok::kw_else)) { in ParseIfStatement()
1212 Tok.is(tok::l_brace)); in ParseIfStatement()
1221 } else if (Tok.is(tok::code_completion)) { in ParseIfStatement()
1256 assert(Tok.is(tok::kw_switch) && "Not a switch stmt!"); in ParseSwitchStatement()
1259 if (Tok.isNot(tok::l_paren)) { in ParseSwitchStatement()
1261 SkipUntil(tok::semi); in ParseSwitchStatement()
1299 if (Tok.is(tok::l_brace)) { in ParseSwitchStatement()
1301 SkipUntil(tok::r_brace); in ParseSwitchStatement()
1303 SkipUntil(tok::semi); in ParseSwitchStatement()
1319 ParseScope InnerScope(this, Scope::DeclScope, C99orCXX, Tok.is(tok::l_brace)); in ParseSwitchStatement()
1341 assert(Tok.is(tok::kw_while) && "Not a while stmt!"); in ParseWhileStatement()
1345 if (Tok.isNot(tok::l_paren)) { in ParseWhileStatement()
1347 SkipUntil(tok::semi); in ParseWhileStatement()
1390 ParseScope InnerScope(this, Scope::DeclScope, C99orCXX, Tok.is(tok::l_brace)); in ParseWhileStatement()
1410 assert(Tok.is(tok::kw_do) && "Not a do stmt!"); in ParseDoStatement()
1432 ParseScope InnerScope(this, Scope::DeclScope, C99orCXX, Tok.is(tok::l_brace)); in ParseDoStatement()
1440 if (Tok.isNot(tok::kw_while)) { in ParseDoStatement()
1444 SkipUntil(tok::semi, StopBeforeMatch); in ParseDoStatement()
1450 if (Tok.isNot(tok::l_paren)) { in ParseDoStatement()
1452 SkipUntil(tok::semi, StopBeforeMatch); in ParseDoStatement()
1457 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseDoStatement()
1475 assert(Tok.is(tok::identifier)); in isForRangeIdentifier()
1478 if (Next.is(tok::colon)) in isForRangeIdentifier()
1481 if (Next.isOneOf(tok::l_square, tok::kw_alignas)) { in isForRangeIdentifier()
1485 bool Result = Tok.is(tok::colon); in isForRangeIdentifier()
1516 assert(Tok.is(tok::kw_for) && "Not a for stmt!"); in ParseForStatement()
1520 if (Tok.is(tok::kw_co_await)) in ParseForStatement()
1523 if (Tok.isNot(tok::l_paren)) { in ParseForStatement()
1525 SkipUntil(tok::semi); in ParseForStatement()
1553 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseForStatement()
1565 if (Tok.is(tok::code_completion)) { in ParseForStatement()
1577 if (Tok.is(tok::semi)) { // for (; in ParseForStatement()
1581 } else if (getLangOpts().CPlusPlus && Tok.is(tok::identifier) && in ParseForStatement()
1589 if (Tok.is(tok::l_brace)) in ParseForStatement()
1621 } else if (Tok.is(tok::semi)) { // for (int x = 4; in ParseForStatement()
1628 if (Tok.is(tok::code_completion)) { in ParseForStatement()
1651 if (Tok.is(tok::semi)) { in ParseForStatement()
1656 if (Tok.is(tok::code_completion)) { in ParseForStatement()
1662 } else if (getLangOpts().CPlusPlus11 && Tok.is(tok::colon) && FirstPart.get()) { in ParseForStatement()
1667 SkipUntil(tok::r_paren, StopBeforeMatch); in ParseForStatement()
1674 SkipUntil(tok::r_paren, StopAtSemi | StopBeforeMatch); in ParseForStatement()
1675 if (Tok.is(tok::semi)) in ParseForStatement()
1685 if (Tok.is(tok::semi)) { // for (...;; in ParseForStatement()
1687 } else if (Tok.is(tok::r_paren)) { in ParseForStatement()
1704 if (Tok.isNot(tok::semi)) { in ParseForStatement()
1709 SkipUntil(tok::r_paren, StopAtSemi | StopBeforeMatch); in ParseForStatement()
1712 if (Tok.is(tok::semi)) { in ParseForStatement()
1717 if (Tok.isNot(tok::r_paren)) { // for (...;...;) in ParseForStatement()
1775 Tok.is(tok::l_brace)); in ParseForStatement()
1816 assert(Tok.is(tok::kw_goto) && "Not a goto stmt!"); in ParseGotoStatement()
1820 if (Tok.is(tok::identifier)) { in ParseGotoStatement()
1825 } else if (Tok.is(tok::star)) { in ParseGotoStatement()
1831 SkipUntil(tok::semi, StopBeforeMatch); in ParseGotoStatement()
1836 Diag(Tok, diag::err_expected) << tok::identifier; in ParseGotoStatement()
1872 assert((Tok.is(tok::kw_return) || Tok.is(tok::kw_co_return)) && in ParseReturnStatement()
1874 bool IsCoreturn = Tok.is(tok::kw_co_return); in ParseReturnStatement()
1878 if (Tok.isNot(tok::semi)) { in ParseReturnStatement()
1880 if (Tok.is(tok::code_completion) && !IsCoreturn) { in ParseReturnStatement()
1886 if (Tok.is(tok::l_brace) && getLangOpts().CPlusPlus) { in ParseReturnStatement()
1896 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseReturnStatement()
1913 while (Tok.is(tok::annot_pragma_loop_hint)) { in ParsePragmaLoopHint()
1936 assert(Tok.is(tok::l_brace)); in ParseFunctionStatementBody()
1969 assert(Tok.is(tok::kw_try) && "Expected 'try'"); in ParseFunctionTryBlock()
1976 if (Tok.is(tok::colon)) in ParseFunctionTryBlock()
2011 bool IsTryCatch = Tok.is(tok::kw_try); in trySkippingFunctionBody()
2015 return Tok.is(tok::code_completion); in trySkippingFunctionBody()
2025 if (!SkipUntil(tok::r_brace, StopAtCodeCompletion)) { in trySkippingFunctionBody()
2029 while (IsTryCatch && Tok.is(tok::kw_catch)) { in trySkippingFunctionBody()
2030 if (!SkipUntil(tok::l_brace, StopAtCodeCompletion) || in trySkippingFunctionBody()
2031 !SkipUntil(tok::r_brace, StopAtCodeCompletion)) { in trySkippingFunctionBody()
2046 assert(Tok.is(tok::kw_try) && "Expected 'try'"); in ParseCXXTryBlock()
2069 if (Tok.isNot(tok::l_brace)) in ParseCXXTryBlockCommon()
2070 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace); in ParseCXXTryBlockCommon()
2080 if ((Tok.is(tok::identifier) && in ParseCXXTryBlockCommon()
2082 Tok.is(tok::kw___finally)) { in ParseCXXTryBlockCommon()
2108 if (Tok.isNot(tok::kw_catch)) in ParseCXXTryBlockCommon()
2110 while (Tok.is(tok::kw_catch)) { in ParseCXXTryBlockCommon()
2135 assert(Tok.is(tok::kw_catch) && "Expected 'catch'"); in ParseCXXCatchBlock()
2139 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseCXXCatchBlock()
2152 if (Tok.isNot(tok::ellipsis)) { in ParseCXXCatchBlock()
2172 if (Tok.isNot(tok::l_brace)) in ParseCXXCatchBlock()
2173 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace); in ParseCXXCatchBlock()
2193 if (!Tok.is(tok::l_brace)) { in ParseMicrosoftIfExistsStatement()
2194 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseMicrosoftIfExistsStatement()
2212 BalancedDelimiterTracker Braces(*this, tok::l_brace); in ParseMicrosoftIfExistsStatement()
2214 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseMicrosoftIfExistsStatement()
2232 while (Tok.isNot(tok::r_brace)) { in ParseMicrosoftIfExistsStatement()
2249 if (!(Tok.is(tok::kw_for) || Tok.is(tok::kw_while) || Tok.is(tok::kw_do))) { in ParseOpenCLUnrollHintAttribute()