Simple text splicing module for MoonBit
type PosUnittype Replacementfn multiline(start : (Int, Int), end : (Int, Int), replacement : String, unit? : PosUnit) -> Replacementfn range(line : Int, start_column : Int, end_column : Int, replacement : String, unit? : PosUnit) -> Replacementlet template =
#|fn get(🐰){
#| ...
#| ...
#| h($)
#|}
inspect(
splice(template, [
multiline((1, 1), (2, 3), "f(x)\n g()"),
range(0, 7, 7, "x : Int"),
point(0, 9, " -> Int "),
char_at(3, 3, "1001"),
]),
content=(
#|fn get(x : Int) -> Int {
#| f(x)
#| g()
#| h(1001)
#|}
),
)Simple text splicing module for MoonBit