package wax-lib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4361e1324b7754a4c08ab5b505df32061f3ce0cea60443fd0d3699e0fa796b32
sha512=fcc756d2f160ba90a9aa1131f2ab22ed7f45466ccd658c21cf9df6868a6aab0cee7f404719d698a379958802f9820398f2fe0685ecc4dda018ca4f653294e39b
doc/wax-lib.utils/Wax_utils/Source_map/index.html
Module Wax_utils.Source_mapSource
create ~enabled:false returns a sink whose recording functions are no-ops, so a module writer that never serializes a map does not pay for accumulating one entry per instruction.
Map generated_offset to the start of original_location.
Map generated_offset to a specific source position — used to attach the closing end opcode of a block or expression to its end position.
add_absent_mapping t ~generated_offset records that the code at generated_offset has no original location, emitting a segment that resets the mapping so the previous location does not bleed into it.
checkpoint t captures the set of mappings recorded so far, for a later shift_since. Mappings are recorded with generated offsets relative to whichever buffer is being encoded; a checkpoint plus shift_since rebases the ones added afterwards once their absolute file offset is known.
shift_since t cp ~delta adds delta to the generated offset of every mapping recorded since the checkpoint cp.