def AmlNs.resolve

bend-osdev-acpi@0.1.1.0 · aml_ns.bend:236

import bend-osdev-acpi@0.1.1.0/aml_ns.bend as AmlNs
import Base
import bend-osdev-bytes@0.1.1.0/bytes.bend as B
import bend-osdev-acpi@0.1.1.0/aml_name.bend as N

236# the object a name refers to, from a scope: a single NameSeg is searched
237# for outward (5.3); None if it is not defined
238def AmlNs.resolve(+ns: AmlNs, +scope: String, +n: N.AmlName) -> Maybe<&2, String>:
239  match n:
240    case N.AmlName{r, u, +ss}:
241      ns.resolve.pick(Bool.and(Bool.not(r), Bool.and(Nat.is_eq(u, 0n), Nat.is_eq(List.length(&2, B.Octets, ss), 1n))), ns, scope, N.AmlName{r, u, ss})

Uses (10)

Used by (4)