Commit ccd53c0b authored by bos's avatar bos
Browse files

Revert to 6ca2debc36ba

parent 1ac9a23f
......@@ -11,6 +11,7 @@ import Data.Char
import Data.Text.Internal.Fusion.Types
upperMapping :: forall s. Char -> s -> Step (CC s) Char
{-# INLINE upperMapping #-}
-- LATIN SMALL LETTER SHARP S
upperMapping '\x00df' s = Yield '\x0053' (CC s '\x0053' '\x0000')
-- LATIN SMALL LIGATURE FF
......@@ -217,10 +218,12 @@ upperMapping '\x1fc7' s = Yield '\x0397' (CC s '\x0342' '\x0399')
upperMapping '\x1ff7' s = Yield '\x03a9' (CC s '\x0342' '\x0399')
upperMapping c s = Yield (toUpper c) (CC s '\0' '\0')
lowerMapping :: forall s. Char -> s -> Step (CC s) Char
{-# INLINE lowerMapping #-}
-- LATIN CAPITAL LETTER I WITH DOT ABOVE
lowerMapping '\x0130' s = Yield '\x0069' (CC s '\x0307' '\x0000')
lowerMapping c s = Yield (toLower c) (CC s '\0' '\0')
titleMapping :: forall s. Char -> s -> Step (CC s) Char
{-# INLINE titleMapping #-}
-- LATIN SMALL LETTER SHARP S
titleMapping '\x00df' s = Yield '\x0053' (CC s '\x0073' '\x0000')
-- LATIN SMALL LIGATURE FF
......@@ -319,6 +322,7 @@ titleMapping '\x1fc7' s = Yield '\x0397' (CC s '\x0342' '\x0345')
titleMapping '\x1ff7' s = Yield '\x03a9' (CC s '\x0342' '\x0345')
titleMapping c s = Yield (toTitle c) (CC s '\0' '\0')
foldMapping :: forall s. Char -> s -> Step (CC s) Char
{-# INLINE foldMapping #-}
-- MICRO SIGN
foldMapping '\x00b5' s = Yield '\x03bc' (CC s '\x0000' '\x0000')
-- LATIN SMALL LETTER SHARP S
......
......@@ -36,7 +36,8 @@ parseCF name = parse entries name <$> readFile name
mapCF :: CaseFolding -> [String]
mapCF (CF _ ms) = typ ++ (map nice . filter p $ ms) ++ [last]
where
typ = ["foldMapping :: forall s. Char -> s -> Step (CC s) Char"]
typ = ["foldMapping :: forall s. Char -> s -> Step (CC s) Char"
,"{-# INLINE foldMapping #-}"]
last = "foldMapping c s = Yield (toLower c) (CC s '\\0' '\\0')"
nice c = "-- " ++ name c ++ "\n" ++
"foldMapping " ++ showC (code c) ++ " s = Yield " ++ x ++ " (CC s " ++ y ++ " " ++ z ++ ")"
......
......@@ -42,7 +42,8 @@ mapSC :: String -> (Case -> String) -> (Char -> Char) -> SpecialCasing
mapSC which access twiddle (SC _ ms) =
typ ++ (map nice . filter p $ ms) ++ [last]
where
typ = [which ++ "Mapping :: forall s. Char -> s -> Step (CC s) Char"]
typ = [which ++ "Mapping :: forall s. Char -> s -> Step (CC s) Char"
,"{-# INLINE " ++ which ++ "Mapping #-}"]
last = which ++ "Mapping c s = Yield (to" ++ ucFirst which ++ " c) (CC s '\\0' '\\0')"
nice c = "-- " ++ name c ++ "\n" ++
which ++ "Mapping " ++ showC (code c) ++ " s = Yield " ++ x ++ " (CC s " ++ y ++ " " ++ z ++ ")"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment