StorageBytes.utf8.lead: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend as StorageBytes Lines 8-26 of mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend&start_line=8&end_line=26 import Base def utf8.lead(+byte: U32, +out: String) -> Utf8State: Utf8State{ Bool.pick(U32, U32.is_lt(byte, 128), 0, Bool.pick(U32, U32.is_le(194, byte) && U32.is_le(byte, 223), 1, Bool.pick(U32, U32.is_eq(byte, 224) || U32.is_le(225, byte) && U32.is_le(byte, 236) || U32.is_le(238, byte) && U32.is_le(byte, 239) || U32.is_eq(byte, 237), 2, Bool.pick(U32, U32.is_le(240, byte) && U32.is_le(byte, 244), 3, 0)))), Bool.pick(U32, U32.is_eq(byte, 224), 160, Bool.pick(U32, U32.is_eq(byte, 240), 144, 128)), Bool.pick(U32, U32.is_eq(byte, 237), 159, Bool.pick(U32, U32.is_eq(byte, 244), 143, 191)), Bool.pick(U32, U32.is_lt(byte, 128), byte, Bool.pick(U32, U32.is_le(194, byte) && U32.is_le(byte, 223), U32.and(byte, 31), Bool.pick(U32, U32.is_le(224, byte) && U32.is_le(byte, 239), U32.and(byte, 15), Bool.pick(U32, U32.is_le(240, byte) && U32.is_le(byte, 244), U32.and(byte, 7), 0)))), Bool.pick(String, U32.is_lt(byte, 128), SCon{Chr{byte}, out}, out), U32.is_lt(byte, 128) || U32.is_le(194, byte) && U32.is_le(byte, 244) } Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend&name=Utf8State