Skip to content

Commit 94120e0

Browse files
authored
Merge pull request #1544 from ahoppen/ahoppen/remove-swiftsyntaxparser
Remove SwiftSyntaxParser module
2 parents 011d9c1 + b79e559 commit 94120e0

28 files changed

+385
-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
@@ -56,7 +56,6 @@ let package = Package(
5656
.library(name: "SwiftSyntax", type: .static, targets: ["SwiftSyntax"]),
5757
.library(name: "SwiftSyntaxBuilder", type: .static, targets: ["SwiftSyntaxBuilder"]),
5858
.library(name: "SwiftSyntaxMacros", type: .static, targets: ["SwiftSyntaxMacros"]),
59-
.library(name: "SwiftSyntaxParser", type: .static, targets: ["SwiftSyntaxParser"]),
6059
],
6160
targets: [
6261
// MARK: - Internal helper targets
@@ -70,6 +69,11 @@ let package = Package(
7069
dependencies: ["SwiftBasicFormat", "SwiftSyntax", "SwiftSyntaxBuilder"]
7170
),
7271

72+
.testTarget(
73+
name: "SwiftSyntaxTestSupportTest",
74+
dependencies: ["_SwiftSyntaxTestSupport", "SwiftParser"]
75+
),
76+
7377
// MARK: - Library targets
7478
// Formatting style:
7579
// - One section for each target and its test target
@@ -246,29 +250,15 @@ let package = Package(
246250

247251
.executableTarget(
248252
name: "lit-test-helper",
249-
dependencies: ["IDEUtils", "SwiftSyntax", "SwiftSyntaxParser"]
253+
dependencies: ["IDEUtils", "SwiftSyntax", "SwiftParser"]
250254
),
251255

252256
// MARK: PerformanceTest
253257
// TODO: Should be included in SwiftParserTest/SwiftSyntaxTest
254258

255259
.testTarget(
256260
name: "PerformanceTest",
257-
dependencies: ["IDEUtils", "SwiftParser", "SwiftSyntax", "SwiftSyntaxParser"],
258-
exclude: ["Inputs"]
259-
),
260-
261-
// MARK: SwiftSyntaxParser
262-
// TODO: All clients should use SwiftParser instead
263-
264-
.target(
265-
name: "SwiftSyntaxParser",
266-
dependencies: ["SwiftSyntax", "SwiftParser"]
267-
),
268-
269-
.testTarget(
270-
name: "SwiftSyntaxParserTest",
271-
dependencies: ["_SwiftSyntaxTestSupport", "SwiftSyntaxParser"],
261+
dependencies: ["IDEUtils", "SwiftParser", "SwiftSyntax"],
272262
exclude: ["Inputs"]
273263
),
274264
]

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)