summaryrefslogtreecommitdiff
path: root/src/GF/Compile
diff options
context:
space:
mode:
authoraarne <unknown>2005-09-20 08:32:55 +0000
committeraarne <unknown>2005-09-20 08:32:55 +0000
commit6d179267de8f988ab2ee52a5fef99b3b05576222 (patch)
treea543ed396c364bd63987517b8ead00fb9d193213 /src/GF/Compile
parent263beccd56f5a6242ea97e696a9843cd0f597e16 (diff)
CSEE now works fine
Diffstat (limited to 'src/GF/Compile')
-rw-r--r--src/GF/Compile/Compile.hs12
-rw-r--r--src/GF/Compile/ShellState.hs12
2 files changed, 14 insertions, 10 deletions
diff --git a/src/GF/Compile/Compile.hs b/src/GF/Compile/Compile.hs
index 306b8d1bf..08b2ff572 100644
--- a/src/GF/Compile/Compile.hs
+++ b/src/GF/Compile/Compile.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/09/19 13:01:18 $
+-- > CVS $Date: 2005/09/20 09:32:56 $
-- > CVS $Author: aarne $
--- > CVS $Revision: 1.43 $
+-- > CVS $Revision: 1.44 $
--
-- The top-level compilation chain from source file to gfc\/gfr.
-----------------------------------------------------------------------------
@@ -282,8 +282,10 @@ generateModuleCode :: Options -> InitPath -> SourceModule -> IOE GFC.CanonModule
generateModuleCode opts path minfo@(name,info) = do
let pname = prefixPathName path (prt name)
minfo0 <- ioeErr $ redModInfo minfo
- let oopts = addOptions opts (iOpts (flagsModule minfo))
- optim = maybe "share" id $ getOptVal oopts useOptimizer
+ let oopts = addOptions opts (iOpts (flagsModule minfo))
+ optims = maybe "share" id $ getOptVal oopts useOptimizer
+ optim = takeWhile (/='_') optims
+ subs = drop 1 (dropWhile (/='_') optims) == "subs"
minfo1 <- return $
case optim of
"parametrize" -> shareModule paramOpt minfo0 -- parametrization and sharing
@@ -295,7 +297,7 @@ generateModuleCode opts path minfo@(name,info) = do
-- do common subexpression elimination if required by flag "subs"
minfo' <-
- if oElem elimSubs opts
+ if subs
then ioeErr $ elimSubtermsMod minfo1
else return minfo1
diff --git a/src/GF/Compile/ShellState.hs b/src/GF/Compile/ShellState.hs
index 0d4c59652..0c965f1f4 100644
--- a/src/GF/Compile/ShellState.hs
+++ b/src/GF/Compile/ShellState.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/09/18 22:55:46 $
+-- > CVS $Date: 2005/09/20 09:32:56 $
-- > CVS $Author: aarne $
--- > CVS $Revision: 1.47 $
+-- > CVS $Revision: 1.48 $
--
-- (Description of the module)
-----------------------------------------------------------------------------
@@ -186,8 +186,10 @@ updateShellState opts mcnc sh ((_,sgr,gr),rts) = do
let concrs = maybe [] (M.allConcretes cgr) abstr0
concr0 = ifNull Nothing (return . head) concrs
notInrts f = notElem f $ map fst rts
- sub = if oElem elimSubs opts then unSubelimCanon else id
- cfs <- mapM (canon2cf opts (sub cgr)) concrs --- why need to update all...
+ subcgr = unSubelimCanon cgr
+ cfs <- mapM (canon2cf opts subcgr) concrs --- why need to update all...
+
+ let morphos = map (mkMorpho subcgr) concrs
let pinfosOld = map (CnvOld.pInfo opts cgr) concrs -- peb 18/6 (OBSOLETE)
@@ -216,7 +218,7 @@ updateShellState opts mcnc sh ((_,sgr,gr),rts) = do
mcfgs = zip concrs mcfgs,
cfgs = zip concrs cfgs,
pInfos = zip concrs pInfos,
- morphos = zip concrs (map (mkMorpho cgr) concrs),
+ morphos = zip concrs morphos,
gloptions = gloptions sh, --- opts, -- this would be command-line options
readFiles = [ft | ft@(f,_) <- readFiles sh, notInrts f] ++ rts,
absCats = csi,