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:
+1
-1
@@ -16,7 +16,7 @@ import (
|
||||
// Regions that the typed model has no region for are counted in Skipped, and
|
||||
// the opcodes and headers it doesn't read in Unread.
|
||||
func (f *Flat) Instrument() *Instrument {
|
||||
inst := &Instrument{Unread: map[string]int{}, Skipped: map[string]int{}}
|
||||
inst := &Instrument{Unread: map[string]int{}, Skipped: map[string]int{}, doc: f.doc}
|
||||
for h, n := range f.Headers {
|
||||
inst.Unread["<"+h+">"] += n
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user