summaryrefslogtreecommitdiff
path: root/src/GF/Compile/Compile.hs
diff options
context:
space:
mode:
authoraarne <unknown>2003-10-23 15:09:07 +0000
committeraarne <unknown>2003-10-23 15:09:07 +0000
commite620ffbd9432fc9ab4f3174ecf9c117db27af772 (patch)
tree34841dcb47554d6d7a3463d23db1ee92d6f098c8 /src/GF/Compile/Compile.hs
parent31e0deb017a938bc91f49d8505104d97bc8af14f (diff)
Working with interfaces and incomplete modules.
Diffstat (limited to 'src/GF/Compile/Compile.hs')
-rw-r--r--src/GF/Compile/Compile.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/GF/Compile/Compile.hs b/src/GF/Compile/Compile.hs
index 1e49946a6..2a119878d 100644
--- a/src/GF/Compile/Compile.hs
+++ b/src/GF/Compile/Compile.hs
@@ -144,8 +144,7 @@ makeSourceModule opts env@(k,gr,can) mo@(i,mi) = case mi of
where
putp = putPointE opts
-compileSourceModule :: Options -> CompileEnv -> SourceModule ->
- IOE (Int,SourceModule)
+compileSourceModule :: Options -> CompileEnv -> SourceModule -> IOE (Int,SourceModule)
compileSourceModule opts env@(k,gr,can) mo@(i,mi) = do
let putp = putPointE opts
@@ -158,7 +157,7 @@ compileSourceModule opts env@(k,gr,can) mo@(i,mi) = do
(k',mo3r:_) <- ioeErr $ refreshModule (k,mos) mo3
- mo4:_ <- putp " optimizing" $ ioeErr $ evalModule mos mo3r
+ mo4:_ <- putp " optimizing " $ ioeErr $ evalModule mos mo3r
return (k',mo4)
@@ -172,16 +171,16 @@ generateModuleCode opts path minfo@(name,info) = do
-- for resource, also emit gfr
case info of
- ModMod m | mtype m == MTResource && emit && nomulti -> do
+ ModMod m | isResourceModule info && isCompilableModule info && emit && nomulti -> do
let (file,out) = (gfrFile pname, prGrammar (MGrammar [minfo]))
ioeIO $ writeFile file out >> putStr (" wrote file" +++ file)
_ -> return ()
(file,out) <- do
code <- return $ MkGFC.prCanonModInfo minfo'
return (gfcFile pname, code)
- if emit && nomulti
+ if isCompilableModule info && emit && nomulti
then ioeIO $ writeFile file out >> putStr (" wrote file" +++ file)
- else return ()
+ else ioeIO $ putStrFlush "no need to save for this module "
return minfo'
where
nomulti = not $ oElem makeMulti opts