From d95ca4a103c9023aa104b25acdc9c21418de6a14 Mon Sep 17 00:00:00 2001 From: krasimir Date: Mon, 19 Jan 2009 13:23:03 +0000 Subject: refactor the GF.Grammar.Grammar syntax. The obsolete constructions are removed --- src/GF/Compile/Coding.hs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/GF/Compile/Coding.hs') 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) -- cgit v1.2.3