on master help sign in
Revert to 6ca2debc36ba
commitccd53c0b6fae17c6c49b83aca3574f576f550e70 authorBryan O'Sullivan <bos@serpentine.com> dateFri 8 May 2015, 12:43 (11 years ago) parent1ac9a23
3 files changed+8−2
Data/Text/Internal/Fusion/CaseMapping.hs+4 scripts/CaseFolding.hs+2−1 scripts/SpecialCasing.hs+2−1
Data/Text/Internal/Fusion/CaseMapping.hs+4
@@ -11,6 +11,7 @@ import Data.Char
1111import Data.Text.Internal.Fusion.Types
1212
1313upperMapping :: forall s. Char -> s -> Step (CC s) Char
14+{-# INLINE upperMapping #-}
1415-- LATIN SMALL LETTER SHARP S
1516upperMapping '\x00df' s = Yield '\x0053' (CC s '\x0053' '\x0000')
1617-- LATIN SMALL LIGATURE FF
@@ -217,10 +218,12 @@ upperMapping '\x1fc7' s = Yield '\x0397' (CC s '\x0342' '\x0399')
217218upperMapping '\x1ff7' s = Yield '\x03a9' (CC s '\x0342' '\x0399')
218219upperMapping c s = Yield (toUpper c) (CC s '\0' '\0')
219220lowerMapping :: forall s. Char -> s -> Step (CC s) Char
221+{-# INLINE lowerMapping #-}
220222-- LATIN CAPITAL LETTER I WITH DOT ABOVE
221223lowerMapping '\x0130' s = Yield '\x0069' (CC s '\x0307' '\x0000')
222224lowerMapping c s = Yield (toLower c) (CC s '\0' '\0')
223225titleMapping :: forall s. Char -> s -> Step (CC s) Char
226+{-# INLINE titleMapping #-}
224227-- LATIN SMALL LETTER SHARP S
225228titleMapping '\x00df' s = Yield '\x0053' (CC s '\x0073' '\x0000')
226229-- LATIN SMALL LIGATURE FF
@@ -319,6 +322,7 @@ titleMapping '\x1fc7' s = Yield '\x0397' (CC s '\x0342' '\x0345')
319322titleMapping '\x1ff7' s = Yield '\x03a9' (CC s '\x0342' '\x0345')
320323titleMapping c s = Yield (toTitle c) (CC s '\0' '\0')
321324foldMapping :: forall s. Char -> s -> Step (CC s) Char
325+{-# INLINE foldMapping #-}
322326-- MICRO SIGN
323327foldMapping '\x00b5' s = Yield '\x03bc' (CC s '\x0000' '\x0000')
324328-- LATIN SMALL LETTER SHARP S
scripts/CaseFolding.hs+2−1
@@ -36,7 +36,8 @@ parseCF name = parse entries name <$> readFile name
3636mapCF :: CaseFolding -> [String]
3737mapCF (CF _ ms) = typ ++ (map nice . filter p $ ms) ++ [last]
3838 where
39− typ = ["foldMapping :: forall s. Char -> s -> Step (CC s) Char"]
39+ typ = ["foldMapping :: forall s. Char -> s -> Step (CC s) Char"
40+ ,"{-# INLINE foldMapping #-}"]
4041 last = "foldMapping c s = Yield (toLower c) (CC s '\\0' '\\0')"
4142 nice c = "-- " ++ name c ++ "\n" ++
4243 "foldMapping " ++ showC (code c) ++ " s = Yield " ++ x ++ " (CC s " ++ y ++ " " ++ z ++ ")"
scripts/SpecialCasing.hs+2−1
@@ -42,7 +42,8 @@ mapSC :: String -> (Case -> String) -> (Char -> Char) -> SpecialCasing
4242mapSC which access twiddle (SC _ ms) =
4343 typ ++ (map nice . filter p $ ms) ++ [last]
4444 where
45− typ = [which ++ "Mapping :: forall s. Char -> s -> Step (CC s) Char"]
45+ typ = [which ++ "Mapping :: forall s. Char -> s -> Step (CC s) Char"
46+ ,"{-# INLINE " ++ which ++ "Mapping #-}"]
4647 last = which ++ "Mapping c s = Yield (to" ++ ucFirst which ++ " c) (CC s '\\0' '\\0')"
4748 nice c = "-- " ++ name c ++ "\n" ++
4849 which ++ "Mapping " ++ showC (code c) ++ " s = Yield " ++ x ++ " (CC s " ++ y ++ " " ++ z ++ ")"