summaryrefslogtreecommitdiff
path: root/src/GF/Devel/Compile/Compile.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-12-07 11:12:39 +0000
committeraarne <aarne@cs.chalmers.se>2007-12-07 11:12:39 +0000
commit36a0f92bdb4bb551f829be47442d438016631bbd (patch)
tree4941afe227f4affeecf4a083e8b54281d771a008 /src/GF/Devel/Compile/Compile.hs
parente013138f0ca0db7ecc164f7d52816287f696d265 (diff)
optimize in the compilation chain for new format
Diffstat (limited to 'src/GF/Devel/Compile/Compile.hs')
-rw-r--r--src/GF/Devel/Compile/Compile.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/GF/Devel/Compile/Compile.hs b/src/GF/Devel/Compile/Compile.hs
index 9c4079519..cb1d87a60 100644
--- a/src/GF/Devel/Compile/Compile.hs
+++ b/src/GF/Devel/Compile/Compile.hs
@@ -6,14 +6,13 @@ import GF.Devel.Compile.Extend
import GF.Devel.Compile.Rename
import GF.Devel.Compile.CheckGrammar
import GF.Devel.Compile.Refresh
-----import GF.Devel.Optimize
+import GF.Devel.Compile.Optimize
----import GF.Devel.OptimizeGF
import GF.Devel.Grammar.Terms
import GF.Devel.Grammar.Modules
import GF.Devel.Grammar.Judgements
import GF.Infra.Ident
-import GF.Infra.CompactPrint
import GF.Devel.Grammar.PrGF
----import GF.Grammar.Lookup
import GF.Devel.ReadFiles
@@ -41,7 +40,7 @@ intermOut opts opt s = if oElem opt opts then
else return ()
prMod :: SourceModule -> String
-prMod = compactPrint . prModule
+prMod = prModule
-- | environment variable for grammar search path
gfGrammarPathVar = "GF_GRAMMAR_PATH"
@@ -146,10 +145,10 @@ compileSourceModule opts env@(k,gr) mo@(i,mi) = do
putpp = putPointEsil opts
- moe <- ioeErr $ extendModule gr mo
+ moe <- putpp " extending" $ ioeErr $ extendModule gr mo
intermOut opts (iOpt "show_extend") (prMod moe)
- mor <- ioeErr $ renameModule gr moe
+ mor <- putpp " renaming" $ ioeErr $ renameModule gr moe
intermOut opts (iOpt "show_rename") (prMod mor)
(moc,warnings) <- putpp " type checking" $ ioeErr $ showCheckModule gr mor
@@ -159,9 +158,11 @@ compileSourceModule opts env@(k,gr) mo@(i,mi) = do
(k',mox) <- putpp " refreshing " $ ioeErr $ refreshModule k moc
intermOut opts (iOpt "show_refresh") (prMod mox)
+ moo <- putpp " optimizing " $ ioeErr $ optimizeModule opts gr mox
+ intermOut opts (iOpt "show_optimize") (prMod moo)
- return (k,mox) ----
+ return (k,moo) ----
{- ----
@@ -196,7 +197,7 @@ generateModuleCode opts path minfo@(name,info) = do
let minfo2 = minfo1
let (file,out) = (gfoFile pname, prGrammar (MGrammar [minfo2]))
- putp (" wrote file" +++ file) $ ioeIO $ writeFile file $ compactPrint out
+ putp (" wrote file" +++ file) $ ioeIO $ writeFile file $ out
return minfo2
where