Add region lookup and structural edits, and reject regions Build can't write
Instrument.Source returns the flattened region and header behind a typed region. AddRegion, RemoveRegion and MoveRegion edit the document and read the instrument again, restoring the document if a region would read differently. NewRegion returns a region with the format's defaults, and Build refuses a region that can't be read back as it is. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -228,6 +228,9 @@ type Instrument struct {
|
||||
sources []FlatRegion
|
||||
// eval reads a region from opcodes, as when the regions were read.
|
||||
eval evaluator
|
||||
// doc is the document the instrument was read from, or nil if it wasn't read
|
||||
// from one.
|
||||
doc *Document
|
||||
}
|
||||
|
||||
// The keys of [Instrument.Skipped], the reasons that a region has no typed
|
||||
|
||||
Reference in New Issue
Block a user