def nm.text.ups

bend-osdev-acpi@0.1.1.0 · aml_name.bend:403

import bend-osdev-acpi@0.1.1.0/aml_name.bend as AmlName
import Base

403# leading carets, counted; isc: s starts with one
404def nm.text.ups(s: String, isc: Bool, n: Nat) -> AmlName:
405  match s:
406    case SNil{}:
407      AmlName{False{}, n, Nil{}}
408    case SCon{h, +t}:
409      match isc:
410        case True{}:
411          nm.text.ups(t, String.starts_with(t, "^"), 1n+n)
412        case False{}:
413          AmlName{False{}, n, nm.text.split(SCon{h, t})}

Uses (7)

Used by (1)