mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Parse concurrency syntax when parsing for syntax-tree-only mode.
This allows the syntax parser library and SwiftSyntax to successfully parse code using this experimental feature without requiring an API to pass compiler flags into the parser.
This commit is contained in:
@@ -824,7 +824,7 @@ Parser::parseFunctionSignature(Identifier SimpleName,
|
||||
void Parser::parseAsyncThrows(
|
||||
SourceLoc existingArrowLoc, SourceLoc &asyncLoc, SourceLoc &throwsLoc,
|
||||
bool *rethrows) {
|
||||
if (Context.LangOpts.EnableExperimentalConcurrency &&
|
||||
if (shouldParseExperimentalConcurrency() &&
|
||||
Tok.isContextualKeyword("async")) {
|
||||
asyncLoc = consumeToken();
|
||||
|
||||
@@ -857,7 +857,7 @@ void Parser::parseAsyncThrows(
|
||||
.fixItInsert(existingArrowLoc, (keyword + " ").str());
|
||||
}
|
||||
|
||||
if (Context.LangOpts.EnableExperimentalConcurrency &&
|
||||
if (shouldParseExperimentalConcurrency() &&
|
||||
Tok.isContextualKeyword("async")) {
|
||||
asyncLoc = consumeToken();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user