Skip to content

Commit bf7710d

Browse files
committed
Avoid conforming String to Error in this module
This seems like an overly-broad conformance to add to swift-experimental-string-processing, and it doesn't look like anyone is calling report(). Do we need this?
1 parent bb1f34a commit bf7710d

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

Sources/_MatchingEngine/Regex/Parse/Parse.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,6 @@ extension ParsingContext {
122122

123123
// Diagnostics
124124
extension Parser {
125-
mutating func report(
126-
_ str: String, _ function: String = #function, _ line: Int = #line
127-
) throws -> Never {
128-
throw """
129-
ERROR: \(str)
130-
(error detected in parser at \(function):\(line))
131-
"""
132-
}
133-
134125
fileprivate func loc(
135126
_ start: Source.Position
136127
) -> SourceLocation {
@@ -529,5 +520,3 @@ public func parseWithDelimiters<S: StringProtocol>(
529520
let (contents, delim) = droppingRegexDelimiters(String(regex))
530521
return try parse(contents, delim.defaultSyntaxOptions)
531522
}
532-
533-
extension String: Error {}

0 commit comments

Comments
 (0)