From 734c66710e9bffa986c094e8c584295b33cd2f63 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Wed, 2 Nov 2011 13:57:11 +0000 Subject: merge GF.Infra.Modules and GF.Grammar.Grammar. This is a preparation for the separate PGF building --- src/compiler/GF/Compile/SubExOpt.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/compiler/GF/Compile/SubExOpt.hs') diff --git a/src/compiler/GF/Compile/SubExOpt.hs b/src/compiler/GF/Compile/SubExOpt.hs index 808e4dca8..453c8e3ca 100644 --- a/src/compiler/GF/Compile/SubExOpt.hs +++ b/src/compiler/GF/Compile/SubExOpt.hs @@ -27,7 +27,6 @@ import GF.Grammar.Grammar import GF.Grammar.Lookup import GF.Infra.Ident import qualified GF.Grammar.Macros as C -import qualified GF.Infra.Modules as M import GF.Data.Operations import Control.Monad @@ -38,17 +37,17 @@ import Data.List subexpModule :: SourceModule -> SourceModule subexpModule (n,mo) = errVal (n,mo) $ do - let ljs = tree2list (M.jments mo) + let ljs = tree2list (jments mo) (tree,_) <- appSTM (getSubtermsMod n ljs) (Map.empty,0) js2 <- liftM buildTree $ addSubexpConsts n tree $ ljs - return (n,M.replaceJudgements mo js2) + return (n,mo{jments=js2}) unsubexpModule :: SourceModule -> SourceModule unsubexpModule sm@(i,mo) - | hasSub ljs = (i,M.replaceJudgements mo (rebuild (map unparInfo ljs))) + | hasSub ljs = (i,mo{jments=rebuild (map unparInfo ljs)}) | otherwise = sm where - ljs = tree2list (M.jments mo) + ljs = tree2list (jments mo) -- perform this iff the module has opers hasSub ljs = not $ null [c | (c,ResOper _ _) <- ljs] @@ -61,7 +60,7 @@ unsubexpModule sm@(i,mo) Q (m,c) | isOperIdent c -> --- name convention of subexp opers errVal t $ liftM unparTerm $ lookupResDef gr (m,c) _ -> C.composSafeOp unparTerm t - gr = M.mGrammar [sm] + gr = mGrammar [sm] rebuild = buildTree . concat -- implementation -- cgit v1.2.3