Explorer

core.module-entries-affected-pass

description
One pass of affected-part propagation: mark every entry that references an already marked part
type
Fn(
  entries: List<Record{
    part_id: String,
    module_id: String,
    part_type: Union{#none, #some(@core.expression)},
    type_declaration: Union{#none, #some(@core.expression)},
    expression_key: Union{#none, #some(String)},
    has_expression: Boolean,
    references: List<String>
  }>,
  marked: List<String>,
  index: Number,
  progress: Boolean
) -> Record{marked: List<String>, progress: Boolean}
expression
fn(entries$0, marked$1, index$2, progress$3) =>
  match @core.list-get(list: $0, index: $2) {
    #none(_) =>
      {marked: $1, progress: $3},
    #some(entry$4) =>
      match @core.list-contains-string(list: $1, target: $4.part_id, index: 0) {
        true =>
          @core.module-entries-affected-pass(entries: $0, marked: $1, index: @core.plus(left: $2, right: 1), progress: $3),
        false =>
          match @core.list-intersects-string(a: $4.references, b: $1, index: 0) {
            true =>
              @core.module-entries-affected-pass(
                entries: $0,
                marked: @core.list-append(list: $1, item: $4.part_id),
                index: @core.plus(left: $2, right: 1),
                progress: true
              ),
            false =>
              @core.module-entries-affected-pass(entries: $0, marked: $1, index: @core.plus(left: $2, right: 1), progress: $3)
          }
      }
  }
visibility
public
core.module-entries-affected-pass (project definy, branch quote-encoded-parts, snapshot LbKb9vIRs5vdtsu6TiOqZ_NMUZJ6k1s6WlbZOc6x3-I)
id: ljyydEZGPCCiRvSEjdwdf0jST6N-o14i8bkNwhecKgY
content hash: bC_Y9eMwcgIybWuG6Q38mL90IwdfY_dlQPr0oL6A7QM