normalize.bend checks
raw source on the hub · import 0x9ae568b385f74ccab3450a43a203c1d1/normalize.bend as Normalize
Intake normalize — strip bidi/ZWSP/BOM, fullwidth punct, dash variants, collapse space
1 import
import Base
Types
type FwPh source · line 30 · raw
Data
Fullwidth :./ → :./ Cannot nest match on computed — use phase
FwCheck@code:U32 -> FwPh
FwColon@yes:Bool -> @code:U32 -> FwPh
FwDot@yes:Bool -> @code:U32 -> FwPh
FwSlash@yes:Bool -> @code:U32 -> FwPh
type NmSt source · line 94 · raw
Data
NmCheckNmSt
NmDecide@skip:Bool -> @space:Bool -> @prev_space:Bool -> NmSt
NmEmitSpaceNmSt
NmEmitCharNmSt
Definitions
def char1 source · line 4 · raw
@+c:Char -> String
def u32_in source · line 7 · raw
@+x:U32 -> @+lo:U32 -> @+hi:U32 -> Bool
def is_invisible_code source · line 11 · raw
@+code:U32 -> Bool
Invisible formatting: U+061C, U+200B-200D, U+200E-200F, U+202A-202E, U+2066-2069, U+FEFF
def is_invisible source · line 23 · raw
@+c:Char -> Bool
def map_fw_go source · line 36 · raw
@fuel:Nat -> @ph:FwPh -> Char
def map_fullwidth source · line 63 · raw
@+c:Char -> Char
def is_dash_code source · line 70 · raw
@+code:U32 -> Bool
Dash variants → ASCII hyphen-minus (45) ‐‑‒–—―−﹘﹣- = 8208-8213, 8722, 65112, 65123, 65293
def map_dash_go source · line 82 · raw
@+c:Char -> @is_d:Bool -> Char
def map_dash source · line 89 · raw
@+c:Char -> Char
def normalize_go source · line 100 · raw
@fuel:Nat -> @st:NmSt -> @rest:String -> @acc:String -> @+prev_space:Bool -> String
def normalize_intake source · line 153 · raw
@+input:String -> String