package wax-lib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=41b580846af8d41bdf6c3f005f62e38feda3e60fe2e9e4aa440db34ce515a153
sha512=4b3a181fcc7d743194a8647260870fb5190770066a197bcc48104c2b77fd40c643228b795c2bcd6b29a120820e969eb42a37a9bcec98b3f608d13f152d9f6579
doc/wax-lib.utils/Wax_utils/Source_map/index.html
Module Wax_utils.Source_mapSource
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.