def val.show.list
bend-osdev-acpi@0.1.1.0 · aml_value.bend:366
import bend-osdev-acpi@0.1.1.0/aml_value.bend as AmlValue
import Base
import bend-osdev-bytes@0.1.1.0/bytes.bend as B
366def val.show.list(vs: List<&2, AmlValue>, +first: Bool) -> String:
367 match vs:
368 case Nil{}:
369 ""
370 case Con{v, rest}:
371 match v:
372 case AmlPkg{xs}:
373 val.sep(first) ++ "{" ++ val.show.list(xs, True{}) ++ "}" ++ val.show.list(rest, False{})
374 case AmlUninit{}:
375 val.sep(first) ++ "uninit" ++ val.show.list(rest, False{})
376 case AmlInt{x}:
377 val.sep(first) ++ AmlValue.show_int(x) ++ val.show.list(rest, False{})
378 case AmlStr{t}:
379 val.sep(first) ++ "\"" ++ B.Octets.to_string(t) ++ "\"" ++ val.show.list(rest, False{})
380 case AmlBuf{b}:
381 val.sep(first) ++ "buf[" ++ B.to_string(val.lower(val.buf.text(B.Octets.to_list(b), True{}))) ++ "]" ++ val.show.list(rest, False{})
382 case AmlRef{l}:
383 val.sep(first) ++ val.ref.show(l) ++ val.show.list(rest, False{})
384 case AmlObj{p, k}:
385 val.sep(first) ++ "object " ++ p ++ val.show.list(rest, False{})