def in.end

bend-osdev-acpi@0.1.1.0 · aml_interp.bend:2788

import bend-osdev-acpi@0.1.1.0/aml_interp.bend as AmlInterp
import Base
import bend-osdev-acpi@0.1.1.0/error.bend as E
import bend-osdev-acpi@0.1.1.0/aml_value.bend as V

2788# the end of a term list: what the frame on top does next
2789def in.end(-H: Data, fs: List<&2, AmlFrame>, c: AmlCur, +w: AmlWorld<H>) -> AmlMachine<H>:
2790  match fs:
2791    case Con{AmlFSeq{after, scope}, rest}:
2792      AmlMachine{AmlMExec{}, after, rest, in.with_scope(H, w, scope)}
2793    case Con{AmlFIfBody{+after}, rest}:
2794      in.skip.else(H, cur.peek(after), after, rest, w)
2795    case Con{AmlFWhile{+s, after, b}, rest}:
2796      AmlMachine{AmlMEval{AmlKTerm{}}, s, Con{AmlFWhile{s, after, False{}}, rest}, w}
2797    case Con{AmlFCall{saved, back}, rest}:
2798      AmlMachine{AmlMGive{V.AmlUninit{}}, back, rest, in.back(H, w, saved)}
2799    case Con{AmlFTop{}, rest}:
2800      AmlMachine{AmlMDone{V.AmlUninit{}}, c, Con{AmlFTop{}, rest}, w}
2801    case _:
2802      AmlMachine{AmlMFail{E.AcpiAmlTruncated{}}, c, fs, w}

Uses (14)

Used by (1)