v1.4.0 release: live-coding scratch editor, interpreted Graph DSL, ClosureSynthesizer + SampleLoop
This commit is contained in:
@@ -23,6 +23,12 @@ public enum LiveSessionError: Error, CustomStringConvertible, Sendable {
|
||||
/// missing entry symbol, IO failure.
|
||||
case compilerError(LiveCompileError)
|
||||
|
||||
/// The interpreted graph-DSL failed to lex/parse/build or its graphs were
|
||||
/// rejected by the engine. `diagnostics` are already mapped to user-source
|
||||
/// coordinates (a parse error resolves to a line/column; a build error has
|
||||
/// `line: nil`). No swiftc is involved — this is the instant DSL path.
|
||||
case graphDSLFailed(diagnostics: [Diagnostic], underlying: Error)
|
||||
|
||||
public var description: String {
|
||||
switch self {
|
||||
case .snippetCompileFailed(let diagnostics, let underlying):
|
||||
@@ -36,6 +42,15 @@ public enum LiveSessionError: Error, CustomStringConvertible, Sendable {
|
||||
return "snippet compile failed:\n\(summary)"
|
||||
case .compilerError(let underlying):
|
||||
return "live compile error: \(underlying)"
|
||||
case .graphDSLFailed(let diagnostics, let underlying):
|
||||
if diagnostics.isEmpty {
|
||||
return "graph DSL failed:\n\(underlying)"
|
||||
}
|
||||
let summary: String = diagnostics.map { diag -> String in
|
||||
let location: String = diag.line.map { "\($0):\(diag.column)" } ?? "?"
|
||||
return "\(location) \(diag.severity.rawValue): \(diag.message)"
|
||||
}.joined(separator: "\n")
|
||||
return "graph DSL failed:\n\(summary)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user