compiler, runtime: Refactor Errors

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-05-04 10:34:07 -04:00
parent b49ec104e9
commit 168d48fa7c
16 changed files with 456 additions and 304 deletions
+3 -3
View File
@@ -152,7 +152,7 @@ public typealias ExpressionInterloper = (EvaluatableExpression, Result<P4Value>,
open class ProgramExecution: CustomStringConvertible {
public var scopes: VarValueScopes = VarValueScopes()
var globalValues: VarValueScopes?
var error: Error?
var error: (any Errorable)?
var debug: DebugLevel = DebugLevel.Error
public let evaluator: ProgramExecutionEvaluator
@@ -182,11 +182,11 @@ open class ProgramExecution: CustomStringConvertible {
return self.error != nil
}
public func getError() -> Error? {
public func getError() -> (any Errorable)? {
return self.error
}
public func setError(error: Error) -> ProgramExecution {
public func setError(error: any Errorable) -> ProgramExecution {
let npe = ProgramExecution(copy: self)
npe.error = error
return npe