AmlNs.ns.search.go: def of bend-osdev-acpi@0.1.1.0 Import: import bend-osdev-acpi@0.1.1.0/aml_ns.bend as AmlNs Lines 189-205 of bend-osdev-acpi@0.1.1.0/aml_ns.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-acpi@0.1.1.0/aml_ns.bend&start_line=189&end_line=205 import Base # the search for a NameSeg from a scope outward; hit: it is in this scope; # top: this scope is the root def ns.search.go(n: Nat, hit: Bool, top: Bool, +ns: AmlNs, +scope: String, +seg: String) -> Maybe<&2, String>: match n: case 0n: None{} case 1n+k: match hit: case True{}: Some{AmlPath.child(scope, seg)} case False{}: match top: case True{}: None{} case False{}: +up = AmlPath.parent(scope) ns.search.go(k, AmlNs.has(ns, AmlPath.child(up, seg)), AmlPath.is_root(up), ns, up, seg) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/aml_ns.bend&name=AmlNs https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/aml_ns.bend&name=AmlNs.has https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/aml_ns.bend&name=AmlPath.child https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/aml_ns.bend&name=AmlPath.is_root https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/aml_ns.bend&name=AmlPath.parent