Skip to content

Commit 36573f3

Browse files
authored
Merge pull request #61179 from DougGregor/swift-compiler-support-new-header
2 parents c654ada + 1bbbfd9 commit 36573f3

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

include/swift/Basic/Features.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ EXPERIMENTAL_FEATURE(ParserRoundTrip)
134134
/// Swift parser.
135135
EXPERIMENTAL_FEATURE(ParserValidation)
136136

137+
/// Whether to fold sequence expressions in the syntax tree produced by the
138+
/// Swift Swift parser.
139+
EXPERIMENTAL_FEATURE(ParserSequenceFolding)
140+
137141
#undef EXPERIMENTAL_FEATURE
138142
#undef UPCOMING_FEATURE
139143
#undef SUPPRESSIBLE_LANGUAGE_FEATURE

lib/AST/ASTPrinter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2945,6 +2945,10 @@ static bool usesFeatureParserValidation(Decl *decl) {
29452945
return false;
29462946
}
29472947

2948+
static bool usesFeatureParserSequenceFolding(Decl *decl) {
2949+
return false;
2950+
}
2951+
29482952
static void suppressingFeatureSpecializeAttributeWithAvailability(
29492953
PrintOptions &options,
29502954
llvm::function_ref<void()> action) {

lib/Parse/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if (SWIFT_SWIFT_PARSER)
5757

5858
target_include_directories(swiftParse
5959
PRIVATE
60-
${CMAKE_CURRENT_SOURCE_DIR}/../../../swift-syntax/Sources/SwiftParser
60+
${CMAKE_CURRENT_SOURCE_DIR}/../../../swift-syntax/Sources/SwiftCompilerSupport
6161
)
6262

6363
target_compile_definitions(swiftParse

lib/Parse/ParseRequests.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "swift/SyntaxParse/SyntaxTreeCreator.h"
2828

2929
#ifdef SWIFT_SWIFT_PARSER
30-
#include "SwiftParserCompilerSupport.h"
30+
#include "SwiftCompilerSupport.h"
3131
#endif
3232

3333
using namespace swift;
@@ -202,11 +202,14 @@ SourceFileParsingResult ParseSourceFileRequest::evaluate(Evaluator &evaluator,
202202
unsigned int flags = 0;
203203

204204
if (ctx.LangOpts.hasFeature(Feature::ParserRoundTrip))
205-
flags |= SPCC_RoundTrip;
205+
flags |= SCC_RoundTrip;
206206

207207
if (!ctx.Diags.hadAnyError() &&
208208
ctx.LangOpts.hasFeature(Feature::ParserValidation))
209-
flags |= SPCC_ParseDiagnostics;
209+
flags |= SCC_ParseDiagnostics;
210+
211+
if (ctx.LangOpts.hasFeature(Feature::ParserSequenceFolding))
212+
flags |= SCC_FoldSequences;
210213

211214
int roundTripResult =
212215
swift_parser_consistencyCheck(

0 commit comments

Comments
 (0)