File tree Expand file tree Collapse file tree 2 files changed +1743
-518
lines changed
src/Data/Text/Internal/Fusion Expand file tree Collapse file tree 2 files changed +1743
-518
lines changed Original file line number Diff line number Diff line change @@ -35,19 +35,12 @@ parseCF :: FilePath -> IO (Either ParseError CaseFolding)
35
35
parseCF name = parse entries name <$> readFile name
36
36
37
37
mapCF :: CaseFolding -> [String ]
38
- mapCF (CF _ ms) = typ ++ map printUnusual ms' ++ map printUsual usual ++ [last ]
38
+ mapCF (CF _ ms) = typ ++ map printUnusual ( filter ( \ f -> status f `elem` " CF " ) ms) ++ [last ]
39
39
where
40
- ms' = filter p ms
41
- p f = status f `elem` " CF" &&
42
- mapping f /= [toLower (code f)]
43
- unusual = map code ms'
44
- usual = filter (\ c -> toLower c /= c && c `notElem` unusual) [minBound .. maxBound ]
45
-
46
40
typ = [" foldMapping :: Char# -> _ {- unboxed Int64 -}"
47
41
," {-# NOINLINE foldMapping #-}"
48
42
," foldMapping = \\ case" ]
49
43
last = " _ -> unI64 0"
50
44
printUnusual c = " -- " ++ name c ++ " \n " ++
51
45
" " ++ showC (code c) ++ " # -> unI64 " ++ show (ord x + (ord y `shiftL` 21 ) + (ord z `shiftL` 42 ))
52
46
where x: y: z: _ = mapping c ++ repeat '\ 0 '
53
- printUsual c = " " ++ showC c ++ " # -> unI64 " ++ show (ord (toLower c))
You can’t perform that action at this time.
0 commit comments