Explorer

core.compile-string-bytes-range

description
i32.const instructions of the bytes lo..hi (for array.new_fixed of a string)
type
Fn(bytes: List<Number>, lo: Number, hi: Number, local: Number) -> List<Number>
expression
fn(bytes$0, lo$1, hi$3, local$2) =>
  match @core.less-than-or-equal(left: @core.minus(left: $3, right: $1), right: 1) {
    true =>
      match @core.less-than(left: $1, right: $3) {
        true =>
          match @core.list-get(list: $0, index: $1) {
            #none(_) =>
              [],
            #some(item$1005) =>
              @core.list-concat(left: [@wasm.i32-const], right: @wasm.signed-leb128(n: $1005))
          },
        false =>
          []
      },
    false =>
      let mid$4 = @core.divide(left: @core.plus(left: $1, right: $3), right: 2);
      @core.list-concat(
        left: @core.compile-string-bytes-range(bytes: $0, lo: $1, hi: $4, local: $2),
        right: @core.compile-string-bytes-range(bytes: $0, lo: $4, hi: $3, local: $2)
      )
  }
visibility
public
core.compile-string-bytes-range (project definy, branch auto-release, snapshot oiQgPqhJm-TbM4kexXeRHBaJB_tS7gwBSewII64P-44)
id: WNzK8IYL5RpAEqVKG9qI4CXOtHNsqJtoGmEr11JHO3M
content hash: JZ9UFgjLHvqyM1-X3Lxwpjc-2Q_ID9ZM4JdA8StjvZQ