compiler, cli: Support Nice Compilation Error Messages
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -72,6 +72,7 @@ public protocol ProgramExecutionEvaluator {
|
||||
|
||||
public protocol Errorable: CustomStringConvertible {
|
||||
func format(_ formatter: Formattable) -> String
|
||||
func format(_ formatter: Formattable, _ sc: SourceCode) -> String
|
||||
func msg() -> String
|
||||
func append(error: any Errorable) -> any Errorable
|
||||
func eq(_ rhs: any Errorable) -> Bool
|
||||
@@ -81,6 +82,9 @@ extension Errorable {
|
||||
public func eq(_ rhs: any Errorable) -> Bool {
|
||||
return self.msg() == rhs.msg()
|
||||
}
|
||||
public func format(_ formatter: Formattable, _ sc: SourceCode) -> String {
|
||||
return self.format(formatter)
|
||||
}
|
||||
}
|
||||
|
||||
public protocol Formattable {
|
||||
|
||||
Reference in New Issue
Block a user