Skip to content

Commit 68e5315

Browse files
authored
Merge pull request #908 from ahoppen/ahoppen/no-dependency-cli-xctest
Remove `print-init` subcommand from `swift-parser-cli`
2 parents 0cd98af + f33b3fc commit 68e5315

File tree

2 files changed

+1
-42
lines changed

2 files changed

+1
-42
lines changed

Package.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ let package = Package(
142142
),
143143
.executableTarget(
144144
name: "swift-parser-cli",
145-
dependencies: ["_SwiftSyntaxTestSupport", "SwiftDiagnostics",
146-
"SwiftSyntax", "SwiftParser", "SwiftOperators",
145+
dependencies: ["SwiftDiagnostics", "SwiftSyntax", "SwiftParser", "SwiftOperators",
147146
.product(name: "ArgumentParser", package: "swift-argument-parser")]
148147
),
149148
.testTarget(

Sources/swift-parser-cli/swift-parser-cli.swift

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import _SwiftSyntaxTestSupport
1413
import SwiftDiagnostics
1514
import SwiftSyntax
1615
import SwiftParser
@@ -191,45 +190,6 @@ class PrintDiags: ParsableCommand {
191190
}
192191
}
193192

194-
class PrintInitCall: ParsableCommand {
195-
static var configuration = CommandConfiguration(
196-
commandName: "print-init",
197-
abstract: "Print a Swift expression that creates this tree"
198-
)
199-
200-
required init() {}
201-
202-
@Argument(help: "The source file that should be parsed; if omitted, use stdin")
203-
var sourceFile: String?
204-
205-
@Option(name: .long, help: "Interpret input according to a specific Swift language version number")
206-
var swiftVersion: String?
207-
208-
@Option(name: .long, help: "Enable or disable the use of forward slash regular-expression literal syntax")
209-
var enableBareSlashRegex: Bool?
210-
211-
@Flag(name: .long, help: "Perform sequence folding with the standard operators")
212-
var foldSequences: Bool = false
213-
214-
func run() throws {
215-
let source = try getContentsOfSourceFile(at: sourceFile)
216-
217-
try source.withUnsafeBufferPointer { sourceBuffer in
218-
var tree = try Parser.parse(
219-
source: sourceBuffer,
220-
languageVersion: swiftVersion,
221-
enableBareSlashRegexLiteral: enableBareSlashRegex
222-
)
223-
224-
if foldSequences {
225-
tree = foldAllSequences(tree).0.as(SourceFileSyntax.self)!
226-
}
227-
228-
print(tree.debugInitCall)
229-
}
230-
}
231-
}
232-
233193
class PrintTree: ParsableCommand {
234194
static var configuration = CommandConfiguration(
235195
commandName: "print-tree",

0 commit comments

Comments
 (0)