Explorer

core.max-local-in-arms

description
Upper bound of the local variables the arms (from index) use. The body of an arm starts after the locals of its pattern
type
Fn(
  arms: List<@core.match-arm>,
  index: Number,
  depth: Number,
  ctx: Record{
    parts: List<Record{id: String, expression: @core.expression, base: Number}>,
    inlining: List<String>,
    part_index: List<List<Record{id: String, expression: @core.expression, base: Number}>>,
    strings: List<Record{value: String, address: Number}>
  }
) -> Number
expression
fn(arms$0, index$1, depth$2, ctx$3) =>
  match @core.list-get(list: $0, index: $1) {
    #none(_) =>
      $2,
    #some(arm$10) =>
      let own$11 = @core.max-local(
          expr: $10.body,
          depth: @core.plus(left: @core.plus(left: $2, right: 2), right: @core.pattern-locals(pattern: $10.pattern)),
          ctx: $3
        );
      let rest$12 = @core.max-local-in-arms(arms: $0, index: @core.plus(left: $1, right: 1), depth: $2, ctx: $3);
      match @core.less-than(left: $11, right: $12) {
        true =>
          $12,
        false =>
          $11
      }
  }
visibility
public
core.max-local-in-arms (project definy, branch compiled-tests, snapshot i6TqClmqVS9FK8rKOvJ43l6Tevx8pvYJ5-zaQqNwemc)
id: u9Fkd_c6w6n5TI0W-MXY4z5x9hzBJO6Q6tH2b6-XX9s
content hash: gYnVnECA2ytv5cXRcVb7KbYVjcCgJ9dm5fhHM3JBhLE