AmlTerm.AmlT.encode: def of bend-osdev-acpi@0.1.1.0 Import: import bend-osdev-acpi@0.1.1.0/aml_term.bend as AmlTerm Lines 83-100 of bend-osdev-acpi@0.1.1.0/aml_term.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-acpi@0.1.1.0/aml_term.bend&start_line=83&end_line=100 import Base import bend-osdev-bytes@0.1.1.0/bytes.bend as B import bend-osdev-acpi@0.1.1.0/aml_pkglength.bend as K # a term list; every term's operands and body are sublists, so this is one # structural recursion def AmlT.encode(ts: List<&2, AmlTerm>) -> B.Octets: match ts: case Nil{}: B.Octets.empty() case Con{t, rest}: match t: case AmlTInt{v}: B.Octets.append(tm.int(v), AmlT.encode(rest)) case AmlTStr{s}: B.Octets.append(tm.str(s), AmlT.encode(rest)) case AmlTRaw{bs}: B.Octets.append(bs, AmlT.encode(rest)) case AmlTOp{c, args}: B.Octets.concat([c, AmlT.encode(args), AmlT.encode(rest)]) case AmlTPkg{c, h, body}: B.Octets.concat([c, K.AmlPkgLength.wrap(B.Octets.append(h, AmlT.encode(body))), AmlT.encode(rest)]) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/aml_pkglength.bend&name=AmlPkgLength.wrap https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/aml_term.bend&name=AmlTerm https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/aml_term.bend&name=tm.int https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/aml_term.bend&name=tm.str https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.append https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.concat https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.empty