summaryrefslogtreecommitdiff
path: root/src/GF/Compile/Coding.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-01-19 13:23:03 +0000
committerkrasimir <krasimir@chalmers.se>2009-01-19 13:23:03 +0000
commitd95ca4a103c9023aa104b25acdc9c21418de6a14 (patch)
tree7cff6e45e2dc1ba08deb503589e21770c7f239b3 /src/GF/Compile/Coding.hs
parentfa7ab84471652c40079e4f77d242208376c4b668 (diff)
refactor the GF.Grammar.Grammar syntax. The obsolete constructions are removed
Diffstat (limited to 'src/GF/Compile/Coding.hs')
-rw-r--r--src/GF/Compile/Coding.hs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/GF/Compile/Coding.hs b/src/GF/Compile/Coding.hs
index 665b5916d..088f7b8e8 100644
--- a/src/GF/Compile/Coding.hs
+++ b/src/GF/Compile/Coding.hs
@@ -14,17 +14,14 @@ encodeStringsInModule :: SourceModule -> SourceModule
encodeStringsInModule = codeSourceModule encodeUTF8
decodeStringsInModule :: SourceModule -> SourceModule
-decodeStringsInModule mo = case mo of
- (_,ModMod m) -> case flag optEncoding (flags m) of
- UTF_8 -> codeSourceModule decodeUTF8 mo
+decodeStringsInModule mo =
+ case flag optEncoding (flagsModule mo) of
+ UTF_8 -> codeSourceModule decodeUTF8 mo
CP_1251 -> codeSourceModule decodeCP1251 mo
- _ -> mo
- _ -> mo
+ _ -> mo
-codeSourceModule :: (String -> String) -> SourceModule -> SourceModule
-codeSourceModule co (id,moi) = case moi of
- ModMod mo -> (id, ModMod $ replaceJudgements mo (mapTree codj (jments mo)))
- _ -> (id,moi)
+codeSourceModule :: (String -> String) -> SourceModule -> SourceModule
+codeSourceModule co (id,mo) = (id,replaceJudgements mo (mapTree codj (jments mo)))
where
codj (c,info) = case info of
ResOper pty pt -> ResOper (mapP codt pty) (mapP codt pt)