Explorer

core.compile-collect-strings

description
Adds the string literals, record keys, variant tags and match arm tags in expr to the list of distinct strings (they are put in the data segment)
type
Fn(expr: @core.expression, strings: List<String>) -> List<String>
expression
fn(expr$0, strings$1) =>
  let own$2 = match $0 {
      #string(s$3) =>
        @core.compile-add-string(strings: $1, value: $3),
      #record(items$4) =>
        @core.compile-add-record-keys(strings: $1, items: $4, index: 0),
      #record_get(e$5) =>
        @core.compile-add-string(strings: $1, value: $5.key),
      #variant(e$6) =>
        @core.compile-add-string(strings: $1, value: $6.tag),
      #match(e$7) =>
        @core.compile-add-arm-tags(strings: $1, arms: $7.arms, index: 0),
      #secret(_) =>
        @core.compile-add-string(strings: @core.compile-add-string(strings: $1, value: "id"), value: "label"),
      _ =>
        $1
    };
  let children$8 = @core.expression-children(expr: $0);
  @core.compile-collect-strings-range(items: $8, lo: 0, hi: @core.list-length(value: $8), strings: $2)
visibility
public
core.compile-collect-strings (project definy, branch compiled-tests, snapshot i6TqClmqVS9FK8rKOvJ43l6Tevx8pvYJ5-zaQqNwemc)
id: vH87EK0R1YqzFvYsdzdJoNZ3z31MZOirGsRcJWNeePQ
content hash: vQIFBy9nP4ScNo8lPp--5eJgnReMW6ZjhkoIji7auTU