// ScratchConsoleEntry.swift // Lyrebird // // Copyright (c) 2026 Joshua Parmenter / realizedsound // SPDX-License-Identifier: MIT // LyrebirdUI/LiveCompile // // One line in the scratch editor's console panel — a report message, an error, // or a run notice. #if os(macOS) /// A single entry in the always-open console. public struct ScratchConsoleEntry: Identifiable, Equatable { /// What kind of line this is, for coloring. public enum Kind: Equatable { /// `context.reportMessage(_:)` output (and host notices). case message /// A compile / DSL error. case error /// A run outcome / informational notice. case info } /// Monotonic id (also the display order). public let id: Int public let kind: Kind public let text: String /// `"line:col"` for an error with a known source position, else `nil`. public let location: String? public init(id: Int, kind: Kind, text: String, location: String? = nil) { self.id = id self.kind = kind self.text = text self.location = location } } #endif