Commit 7e1d59a1 authored by bos's avatar bos
Browse files

Drop INLINE annotations for case mapping functions

This should help with gh-116.
parent 0923e009
......@@ -11,7 +11,6 @@ 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
......@@ -218,12 +217,10 @@ 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
......@@ -322,7 +319,6 @@ 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,8 +36,7 @@ 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"
,"{-# INLINE foldMapping #-}"]
typ = ["foldMapping :: forall s. Char -> s -> Step (CC s) Char"]
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,8 +42,7 @@ 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"
,"{-# INLINE " ++ which ++ "Mapping #-}"]
typ = [which ++ "Mapping :: forall s. Char -> s -> Step (CC s) Char"]
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