Skip to content

Remove SwiftSyntaxParser module #1544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@ swift_syntax_library(
],
)

swift_syntax_library(
name = "SwiftSyntaxParser",
deps = [
":SwiftParser",
":SwiftSyntax",
],
)

swift_syntax_library(
name = "SwiftRefactor",
deps = [
Expand Down
8 changes: 2 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ If you can’t find it in your Schemes, you need to manually add it using Produc

### XCTests

The `SwiftSyntaxParser` module (the legacy parser) of this repository depends on the C++ parser library (`_InternalSwiftSyntaxParser.dylib`) to parse source code.
The syntax node definitions of that parser library need to match those used by your SwiftSyntax checkout.
Most of the time, the parser library included in the latest Swift Development Snapshot will fulfill this requirement.

To run the tests in Xcode, select the latest Swift Development Snapshot in Xcode -> Toolchains, select the SwiftSyntax-Package scheme and hit Product -> Test.
To run the tests in Xcode, select the SwiftSyntax-Package scheme and hit Product -> Test.

You can also run the tests from the command line using
```bash
Expand All @@ -68,7 +64,7 @@ Tip: Running SwiftSyntax’s self-parse tests takes the majority of testing time

### `lit`-based tests

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.
A few tests are based LLVM’s `lit` and `FileCheck` tools.
To run these, build `FileCheck`, e.g. by building the Swift compiler and run the tests using the following command:
```bash
./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
Expand Down
24 changes: 7 additions & 17 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ let package = Package(
.library(name: "SwiftSyntax", type: .static, targets: ["SwiftSyntax"]),
.library(name: "SwiftSyntaxBuilder", type: .static, targets: ["SwiftSyntaxBuilder"]),
.library(name: "SwiftSyntaxMacros", type: .static, targets: ["SwiftSyntaxMacros"]),
.library(name: "SwiftSyntaxParser", type: .static, targets: ["SwiftSyntaxParser"]),
],
targets: [
// MARK: - Internal helper targets
Expand All @@ -63,6 +62,11 @@ let package = Package(
dependencies: ["SwiftBasicFormat", "SwiftSyntax", "SwiftSyntaxBuilder"]
),

.testTarget(
name: "SwiftSyntaxTestSupportTest",
dependencies: ["_SwiftSyntaxTestSupport", "SwiftParser"]
),

// MARK: - Library targets
// Formatting style:
// - One section for each target and its test target
Expand Down Expand Up @@ -236,29 +240,15 @@ let package = Package(

.executableTarget(
name: "lit-test-helper",
dependencies: ["IDEUtils", "SwiftSyntax", "SwiftSyntaxParser"]
dependencies: ["IDEUtils", "SwiftSyntax", "SwiftParser"]
),

// MARK: PerformanceTest
// TODO: Should be included in SwiftParserTest/SwiftSyntaxTest

.testTarget(
name: "PerformanceTest",
dependencies: ["IDEUtils", "SwiftParser", "SwiftSyntax", "SwiftSyntaxParser"],
exclude: ["Inputs"]
),

// MARK: SwiftSyntaxParser
// TODO: All clients should use SwiftParser instead

.target(
name: "SwiftSyntaxParser",
dependencies: ["SwiftSyntax", "SwiftParser"]
),

.testTarget(
name: "SwiftSyntaxParserTest",
dependencies: ["_SwiftSyntaxTestSupport", "SwiftSyntaxParser"],
dependencies: ["IDEUtils", "SwiftParser", "SwiftSyntax"],
exclude: ["Inputs"]
),
]
Expand Down
3 changes: 1 addition & 2 deletions Sources/SwiftParser/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## Overview

The `SwiftParser` framework implements a parser that accepts Swift source text
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).
The `SwiftParser` framework implements a parser that accepts Swift source text as input and produces a SwiftSyntax syntax tree.

## Quickstart

Expand Down
3 changes: 1 addition & 2 deletions Sources/SwiftParser/SwiftParser.docc/SwiftParser.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ A parser for the Swift programming language.

## Overview

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

## Quickstart

Expand Down
Loading