def AmlName.valid
import bend-osdev-acpi@0.1.1.0/aml_name.bend as AmlNameimport Base
153# the names a NameString can hold: not both rooted and going up, every
154# segment a NameSeg, at most 255 segments
155def AmlName.valid(n: AmlName) -> Bool:
156 match n:
157 case AmlName{r, u, +ss}:
158 Bool.and(nm.root_up_ok(r, u), Bool.and(AmlName.segs_ok(ss), Nat.is_lt(nm.len(ss), 256n)))