X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=codepages%2FMakeTable.hs;h=cd9a8b6efb015ebf6ce69a81939ad22c224654ff;hb=bc4b6c5c244e1e88e3e8325fff9a5b581fc92358;hp=408d932a75f5d44711306e29d5a26cc4b0d39754;hpb=247e031f8bb31500ae8d9a73865447aa20b1070d;p=ghc-base.git diff --git a/codepages/MakeTable.hs b/codepages/MakeTable.hs index 408d932..cd9a8b6 100644 --- a/codepages/MakeTable.hs +++ b/codepages/MakeTable.hs @@ -33,11 +33,22 @@ import Control.Exception(evaluate) main :: IO () main = do moduleName:outFile:files <- getArgs - sbes <- mapM readMapAndIx files + let badFiles = -- These fail with an error like + -- MakeTable: Enum.toEnum{Word8}: tag (33088) is outside of bounds (0,255) + -- I have no idea what's going on, so for now we just + -- skip them. + ["CPs/CP932.TXT", + "CPs/CP936.TXT", + "CPs/CP949.TXT", + "CPs/CP950.TXT"] + let files' = filter (`notElem` badFiles) files + sbes <- mapM readMapAndIx files' + putStrLn "Writing output" withBinaryFile outFile WriteMode $ flip hPutStr - $ unlines $ makeTableFile moduleName files sbes + $ unlines $ makeTableFile moduleName files' sbes where readMapAndIx f = do + putStrLn ("Reading " ++ f) m <- readMap f return (codePageNum f, m) @@ -201,7 +212,7 @@ firstComment files = map ("-- " ++) $ theImports :: [String] theImports = map ("import " ++ ) - ["GHC.Prim", "GHC.Base", "GHC.Word", "GHC.Num"] + ["GHC.Prim", "GHC.Base", "GHC.Word"] theTypes :: [String] theTypes = [ "data ConvArray a = ConvArray Addr#"