Skip to content

Commit 8e204f6

Browse files
committed
Remove SwiftSyntaxParser module
This removes the `SwiftSyntaxParser` module, which was just a wrapper around `SwiftParser` to ease the transition for clients that previously used `SwiftSyntaxParser`. Everybody should be using `SwiftParser` by now, so remove the deprecated module. This migrates all test cases that still provide value to other modules.
1 parent ab0015f commit 8e204f6

28 files changed

+393
-1156
lines changed

BUILD.bazel

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,6 @@ swift_syntax_library(
9595
],
9696
)
9797

98-
swift_syntax_library(
99-
name = "SwiftSyntaxParser",
100-
deps = [
101-
":SwiftParser",
102-
":SwiftSyntax",
103-
],
104-
)
105-
10698
swift_syntax_library(
10799
name = "SwiftRefactor",
108100
deps = [

CONTRIBUTING.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ If you can’t find it in your Schemes, you need to manually add it using Produc
4343
4444
### XCTests
4545
46-
The `SwiftSyntaxParser` module (the legacy parser) of this repository depends on the C++ parser library (`_InternalSwiftSyntaxParser.dylib`) to parse source code.
47-
The syntax node definitions of that parser library need to match those used by your SwiftSyntax checkout.
48-
Most of the time, the parser library included in the latest Swift Development Snapshot will fulfill this requirement.
49-
50-
To run the tests in Xcode, select the latest Swift Development Snapshot in Xcode -> Toolchains, select the SwiftSyntax-Package scheme and hit Product -> Test.
46+
To run the tests in Xcode, select the SwiftSyntax-Package scheme and hit Product -> Test.
5147
5248
You can also run the tests from the command line using
5349
```bash
@@ -68,7 +64,7 @@ Tip: Running SwiftSyntax’s self-parse tests takes the majority of testing time
6864

6965
### `lit`-based tests
7066

71-
A few tests of the `SwiftSyntaxParser` module (the legacy parser), which test the interaction between SwiftSyntax and the C++ parser library (`_InternalSwiftSyntaxParser.dylib`) are based LLVM’s `lit` and `FileCheck` tools.
67+
A few tests are based LLVM’s `lit` and `FileCheck` tools.
7268
To run these, build `FileCheck`, e.g. by building the Swift compiler and run the tests using the following command:
7369
```bash
7470
./build-script.py test --toolchain /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-<recent date>.xctoolchain/usr --skip-lit-tests --filecheck-exec /path/to/build/Release+Asserts/llvm-macosx-x86_64/bin/FileCheck

Package.swift

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ let package = Package(
4949
.library(name: "SwiftSyntax", type: .static, targets: ["SwiftSyntax"]),
5050
.library(name: "SwiftSyntaxBuilder", type: .static, targets: ["SwiftSyntaxBuilder"]),
5151
.library(name: "SwiftSyntaxMacros", type: .static, targets: ["SwiftSyntaxMacros"]),
52-
.library(name: "SwiftSyntaxParser", type: .static, targets: ["SwiftSyntaxParser"]),
5352
],
5453
targets: [
5554
// MARK: - Internal helper targets
@@ -63,6 +62,11 @@ let package = Package(
6362
dependencies: ["SwiftBasicFormat", "SwiftSyntax", "SwiftSyntaxBuilder"]
6463
),
6564

65+
.testTarget(
66+
name: "SwiftSyntaxTestSupportTest",
67+
dependencies: ["_SwiftSyntaxTestSupport", "SwiftParser"]
68+
),
69+
6670
// MARK: - Library targets
6771
// Formatting style:
6872
// - One section for each target and its test target
@@ -236,29 +240,15 @@ let package = Package(
236240

237241
.executableTarget(
238242
name: "lit-test-helper",
239-
dependencies: ["IDEUtils", "SwiftSyntax", "SwiftSyntaxParser"]
243+
dependencies: ["IDEUtils", "SwiftSyntax", "SwiftParser"]
240244
),
241245

242246
// MARK: PerformanceTest
243247
// TODO: Should be included in SwiftParserTest/SwiftSyntaxTest
244248

245249
.testTarget(
246250
name: "PerformanceTest",
247-
dependencies: ["IDEUtils", "SwiftParser", "SwiftSyntax", "SwiftSyntaxParser"],
248-
exclude: ["Inputs"]
249-
),
250-
251-
// MARK: SwiftSyntaxParser
252-
// TODO: All clients should use SwiftParser instead
253-
254-
.target(
255-
name: "SwiftSyntaxParser",
256-
dependencies: ["SwiftSyntax", "SwiftParser"]
257-
),
258-
259-
.testTarget(
260-
name: "SwiftSyntaxParserTest",
261-
dependencies: ["_SwiftSyntaxTestSupport", "SwiftSyntaxParser"],
251+
dependencies: ["IDEUtils", "SwiftParser", "SwiftSyntax"],
262252
exclude: ["Inputs"]
263253
),
264254
]

Sources/SwiftParser/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
## Overview
22

3-
The `SwiftParser` framework implements a parser that accepts Swift source text
4-
as input and produces a SwiftSyntax syntax tree. This module is under active development and is not yet ready to completely replace `SwiftSyntaxParser`. For more information about the design of this module, please see [the module documentation](SwiftParser.docc/SwiftParser.md).
3+
The `SwiftParser` framework implements a parser that accepts Swift source text as input and produces a SwiftSyntax syntax tree.
54

65
## Quickstart
76

Sources/SwiftParser/SwiftParser.docc/SwiftParser.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ A parser for the Swift programming language.
44

55
## Overview
66

7-
The `SwiftParser` framework implements a parser that accepts Swift source text
8-
as input and produces a SwiftSyntax syntax tree. This module is under active development and is not yet ready to completely replace `SwiftSyntaxParser`.
7+
The `SwiftParser` framework implements a parser that accepts Swift source text as input and produces a SwiftSyntax syntax tree.
98

109
## Quickstart
1110

0 commit comments

Comments
 (0)