Commit aff3e9f0 authored by bos's avatar bos
Browse files

Update case mapping scripts to match current needs

parent 9db9d45e
......@@ -37,7 +37,7 @@ 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 #-}"]
,"{-# NOINLINE 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 ++ ")"
......
......@@ -8,7 +8,7 @@ import SpecialCasing
main = do
args <- getArgs
let oname = case args of
[] -> "../Data/Text/Fusion/CaseMapping.hs"
[] -> "../Data/Text/Internal/Fusion/CaseMapping.hs"
[o] -> o
psc <- parseSC "SpecialCasing.txt"
pcf <- parseCF "CaseFolding.txt"
......@@ -24,10 +24,10 @@ main = do
mapM_ (hPutStrLn h) $
["{-# LANGUAGE Rank2Types #-}"
,"-- AUTOMATICALLY GENERATED - DO NOT EDIT"
,"-- Generated by scripts/SpecialCasing.hs"] ++
,"-- Generated by scripts/CaseMapping.hs"] ++
comments ++
[""
,"module Data.Text.Fusion.CaseMapping where"
,"module Data.Text.Internal.Fusion.CaseMapping where"
,"import Data.Char"
,"import Data.Text.Internal.Fusion.Types"
,""]
......
......@@ -43,7 +43,7 @@ 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 #-}"]
,"{-# NOINLINE " ++ 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