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>
Instrument.Patches works out the opcode changes that make region i read as an
updated Region, checking them against the reader, and Instrument.Apply makes
them in the document. Only the changed settings are touched, always in the
region's own header, so unknown opcodes and what other regions inherit stay as
they are. A change the header can't hold is an error and changes nothing.
FlatRegion gains Own, Inherited and Header to trace a region to its source, and
regionLines lists a region's opcodes with the field each sets.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The bounds are informational: the library reads and writes values outside
them, and the host decides whether to enforce them.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>