def in.concat
bend-osdev-acpi@0.1.1.0 · aml_interp.bend:1385
import bend-osdev-acpi@0.1.1.0/aml_interp.bend as AmlInterp
import Base
import bend-osdev-word64@0.1.1.0/word64.bend as W
import bend-osdev-bytes@0.1.1.0/bytes.bend as B
import bend-osdev-acpi@0.1.1.0/error.bend as E
import bend-osdev-acpi@0.1.1.0/aml_value.bend as V
1385def in.concat(+wide: Bool, a: V.AmlValue, +b: V.AmlValue) -> Result<&2, &2, E.AcpiError, V.AmlValue>:
1386 match a:
1387 case V.AmlInt{x}:
1388 Result.map(&2, &2, E.AcpiError, W.W64, V.AmlValue, y => V.AmlBuf{B.Octets.append(V.val.int.bytes(wide, x), V.val.int.bytes(wide, y))}, V.AmlValue.to_int(wide, b))
1389 case V.AmlStr{s}:
1390 Result.map(&2, &2, E.AcpiError, B.Octets, V.AmlValue, t => V.AmlStr{B.Octets.append(s, t)}, V.AmlValue.to_str(wide, b))
1391 case V.AmlBuf{s}:
1392 Result.map(&2, &2, E.AcpiError, B.Octets, V.AmlValue, t => V.AmlBuf{B.Octets.append(s, t)}, V.AmlValue.to_buf(wide, b))
1393 case _:
1394 Fail{E.AcpiAmlBadType{"Concatenate of a value that is not an integer, string or buffer"}}