Skip to main content

Module fix

Module fix 

Source
Expand description

fix template interpolation and application.

A fix is a replacement template that interpolates the match’s metavars — both the captured $VARs and any transform-synthesized ones — into replacement text. The engine computes one replacement per match and splices them into the source (format-preserving byte-splice, the same guarantee as ast.batch_apply).

Structs§

AppliedEdit
One concrete edit: replace span’s bytes (before) with replacement.

Functions§

interpolate
Interpolate $VAR / ${VAR} references in template from vars. An unknown reference is left verbatim (so a literal $ survives), and $$ is an escaped literal dollar sign.
splice
Apply edits to source by byte-splice. Edits are spliced in reverse start order so earlier offsets stay valid; whitespace outside each span is preserved verbatim.