File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ using namespace swift::syntax;
3636// / isStartOfStmt - Return true if the current token starts a statement.
3737// /
3838bool Parser::isStartOfStmt () {
39+ // This needs to be kept in sync with `Parser::parseStmt()`. If a new token
40+ // kind is accepted here as start of statement, it should also be handled in
41+ // `Parser::parseStmt()`.
3942 switch (Tok.getKind ()) {
4043 default : return false ;
4144 case tok::kw_return:
@@ -588,7 +591,9 @@ ParserResult<Stmt> Parser::parseStmt() {
588591 if (isContextualYieldKeyword ()) {
589592 Tok.setKind (tok::kw_yield);
590593 }
591-
594+
595+ // This needs to handle everything that `Parser::isStartOfStmt()` accepts as
596+ // start of statement.
592597 switch (Tok.getKind ()) {
593598 case tok::pound_line:
594599 case tok::pound_sourceLocation:
You can’t perform that action at this time.
0 commit comments