Multipart.pre.if: def of bend-kit-multipart@0.3.0.0 Import: import bend-kit-multipart@0.3.0.0/multipart.bend as Multipart Lines 411-422 of bend-kit-multipart@0.3.0.0/multipart.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-multipart@0.3.0.0/multipart.bend&start_line=411&end_line=422 import Base import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes # Pre: the preamble is dropped. Keeping dlen - 1 bytes means a delimiter split across chunks is still found. # A 0/1/2 suffix kind as two flags, since only a parameter can be matched. def pre.if(delim: Bool, data: Bool, buf: Bytes.Bytes, +i: U32, +dlen: U32, out: List<&1, Item>) -> Step: match delim: case True{}: More{After{}, drop(buf, (i + dlen : U32)), out} case False{}: match data: case True{}: More{Pre{}, drop(buf, (i + 1 : U32)), out} case False{}: Pause{Pre{}, drop(buf, i), out} Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=bend-kit-multipart@0.3.0.0/multipart.bend&name=Item https://jend.leeeet.dev/definition.txt?path=bend-kit-multipart@0.3.0.0/multipart.bend&name=Stage https://jend.leeeet.dev/definition.txt?path=bend-kit-multipart@0.3.0.0/multipart.bend&name=Step https://jend.leeeet.dev/definition.txt?path=bend-kit-multipart@0.3.0.0/multipart.bend&name=drop