src/utf8.bend checks
raw source on the hub · import bend-kube-runtime@0.5.0.0/src/utf8.bend as Utf8
1 import
import Base
Types
type Utf8 source · line 10 · raw
Data
Utf8@code:U32 -> @need:U32 -> Utf8
Definitions
def Utf8.init source · line 13 · raw
Utf8
def Utf8.bad source · line 16 · raw
Char
def Utf8.lead.go source · line 19 · raw
@+b:U32 -> @a:Bool -> @c:Bool -> @two:Bool -> @three:Bool -> @four:Bool -> U32
def Utf8.lead source · line 35 · raw
@+b:U32 -> U32
The lead byte's class: 0 ASCII, 1..3 continuation count, 4 invalid.
def Utf8.is_cont source · line 39 · raw
@+b:U32 -> Bool
def Utf8.fresh.st source · line 43 · raw
@+b:U32 -> @+k:U32 -> @mid:Bool -> Utf8
The fresh-byte case: the state and the chars a lead byte makes.
def Utf8.fresh.out source · line 50 · raw
@+b:U32 -> @+k:U32 -> @acc:String -> @ascii:Bool -> @bad:Bool -> String
def Utf8.fresh.mid source · line 59 · raw
@+k:U32 -> Bool
def Utf8.next.cont.if source · line 62 · raw
@+code:U32 -> @+need:U32 -> @done:Bool -> Utf8
def Utf8.next.cont source · line 69 · raw
@+code:U32 -> @+need:U32 -> Utf8
def Utf8.next.go source · line 73 · raw
@+code:U32 -> @+need:U32 -> @+b:U32 -> @cont:Bool -> @idle:Bool -> Utf8
The state after byte b.
def Utf8.next source · line 80 · raw
@st:Utf8 -> @+b:U32 -> Utf8
def Utf8.emit.cont source · line 85 · raw
@+code:U32 -> @acc:String -> @done:Bool -> String
def Utf8.emit.go source · line 93 · raw
@+code:U32 -> @+need:U32 -> @+b:U32 -> @acc:String -> @cont:Bool -> @idle:Bool -> String
The chars byte b completes, pushed onto acc (reversed).
def Utf8.emit source · line 103 · raw
@st:Utf8 -> @+b:U32 -> @acc:String -> String
def Utf8.go source · line 109 · raw
@bs:List<&2, U32> -> @+st:Utf8 -> @acc:String -> Pair(Utf8, String)
Decodes bytes onto the front of acc (reversed), carrying the state.
def Utf8.decode.fin source · line 116 · raw
@r:Pair(Utf8, String) -> Pair(Utf8, String)
def Utf8.decode source · line 122 · raw
@st:Utf8 -> @bs:List<&2, U32> -> Pair(Utf8, String)
Decodes a cut of bytes; returns the carried state and the text.
def Utf8.decode_all.tail source · line 125 · raw
@s:String -> @whole:Bool -> String
def Utf8.decode_all.fin source · line 132 · raw
@r:Pair(Utf8, String) -> String
def Utf8.decode_all source · line 138 · raw
@bs:List<&2, U32> -> String
Decodes a whole buffer.
def Utf8.put.go source · line 141 · raw
@+c:U32 -> @rest:List<&2, U32> -> @a:Bool -> @b:Bool -> @d:Bool -> List<&2, U32>
def Utf8.put source · line 154 · raw
@+c:U32 -> @rest:List<&2, U32> -> List<&2, U32>
def Utf8.encode source · line 157 · raw
@s:String -> List<&2, U32>
def Utf8.size.of source · line 164 · raw
@+c:U32 -> @a:Bool -> @b:Bool -> @d:Bool -> U32
def Utf8.size source · line 176 · raw
@s:String -> U32
The UTF-8 length of a string, in bytes.