def res.loop

bend-osdev-acpi@0.1.1.0 · aml_resource.bend:249

import bend-osdev-acpi@0.1.1.0/aml_resource.bend as AmlResource
import Base
import bend-osdev-acpi@0.1.1.0/error.bend as E

249def res.loop(fuel: Nat, r: Result<&2, &2, E.AcpiError, AmlResNext>, acc: List<&2, AmlResource>) -> Result<&2, &2, E.AcpiError, List<&2, AmlResource>>:
250  match fuel:
251    case 0n:
252      Done{List.reverse(&2, AmlResource, acc)}
253    case 1n+p:
254      match r:
255        case Fail{e}:
256          Fail{e}
257        case Done{AmlResEnd{}}:
258          Done{List.reverse(&2, AmlResource, acc)}
259        case Done{AmlResMore{x, +rest}}:
260          res.loop(p, res.step(rest), Con{x, acc})

Uses (8)

Used by (1)