v1.4.0 release: live-coding scratch editor, interpreted Graph DSL, ClosureSynthesizer + SampleLoop
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// DSLSpan.swift
|
||||
// Lyrebird
|
||||
//
|
||||
// Copyright (c) 2026 Joshua Parmenter / realizedsound
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
// A half-open character range into DSL source, carried by tokens and AST nodes
|
||||
// so parse/build errors can point at the offending text.
|
||||
|
||||
/// A `[start, end)` range in *character* offsets into the DSL source string.
|
||||
public struct DSLSpan: Equatable, Sendable {
|
||||
public let start: Int
|
||||
public let end: Int
|
||||
|
||||
public init(start: Int, end: Int) {
|
||||
self.start = start
|
||||
self.end = end
|
||||
}
|
||||
|
||||
/// A zero-length span at `offset` (for end-of-input / synthetic positions).
|
||||
public static func point(_ offset: Int) -> DSLSpan {
|
||||
DSLSpan(start: offset, end: offset)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user