cp1251 coding ; trying to recognize the coding flag in grammar

This commit is contained in:
aarne
2008-06-24 13:58:04 +00:00
parent c122bc52d8
commit 2038b776af
5 changed files with 42 additions and 11 deletions

View File

@@ -76,7 +76,7 @@ data Verbosity = Quiet | Normal | Verbose | Debug
data Phase = Preproc | Convert | Compile | Link
deriving (Show,Eq,Ord)
data Encoding = UTF_8 | ISO_8859_1
data Encoding = UTF_8 | ISO_8859_1 | CP_1251
deriving (Show,Eq,Ord)
data OutputFormat = FmtPGF
@@ -469,7 +469,9 @@ optimizationPackages =
encodings :: [(String,Encoding)]
encodings =
[("utf8", UTF_8),
("latin1", ISO_8859_1)]
("cp1251", CP_1251),
("latin1", ISO_8859_1)
]
lookupShow :: Eq a => [(String,a)] -> a -> String
lookupShow xs z = fromMaybe "lookupShow" $ lookup z [(y,x) | (x,y) <- xs]
@@ -542,4 +544,4 @@ instance Functor OptDescr where
instance Functor ArgDescr where
fmap f (NoArg x) = NoArg (f x)
fmap f (ReqArg g s) = ReqArg (f . g) s
fmap f (OptArg g s) = OptArg (f . g) s
fmap f (OptArg g s) = OptArg (f . g) s