10000 Don't throw just because compilation fails · swiftlang/swift-syntax@156cc9f · GitHub
[go: up one dir, main page]

Skip to content

Commit 156cc9f

Browse files
ahoppenallevato
authored andcommitted
Don't throw just because compilation fails
This was originally "[swiftSyntax] Add test cases for the SyntaxClassifier" (apple/swift-syntax e7c90be). We don't actually pull in any SyntaxClassifier logic, but this commit does fix a bug where compiler errors cause the entire parse to fail.
1 parent f104c5f commit 156cc9f

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

Sources/SwiftSyntax/SwiftSyntax.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ public enum SyntaxTreeParser {
9393
public static func parse(_ url: URL) throws -> SourceFileSyntax {
9494
let swiftcRunner = try SwiftcRunner(sourceFile: url)
9595
let result = try swiftcRunner.invoke()
96-
guard result.wasSuccessful else {
97-
throw ParserError.swiftcFailed(result.exitCode, result.stderr)
98-
}
9996
let syntaxTreeData = result.stdoutData
10097
let deserializer = SyntaxTreeDeserializer()
10198
return try deserializer.deserialize(syntaxTreeData)

0 commit comments

Comments
 (0)
0