summaryrefslogtreecommitdiff
path: root/src/GF/Compile/Compile.hs
diff options
context:
space:
mode:
authoraarne <unknown>2005-05-27 07:13:35 +0000
committeraarne <unknown>2005-05-27 07:13:35 +0000
commit276a08a0d7b4b53a382c471a92a1084f1718c34a (patch)
tree7ec26676ec5c25260e7c3737ccfbf6602f27f8c3 /src/GF/Compile/Compile.hs
parentf77c9c86ae7a927c6bc10a5224145e49d166e821 (diff)
paths
Diffstat (limited to 'src/GF/Compile/Compile.hs')
-rw-r--r--src/GF/Compile/Compile.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/GF/Compile/Compile.hs b/src/GF/Compile/Compile.hs
index 0b2748b0f..a95c11599 100644
--- a/src/GF/Compile/Compile.hs
+++ b/src/GF/Compile/Compile.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/04/21 16:46:00 $
--- > CVS $Author: bringert $
--- > CVS $Revision: 1.37 $
+-- > CVS $Date: 2005/05/27 08:13:35 $
+-- > CVS $Author: aarne $
+-- > CVS $Revision: 1.38 $
--
-- The top-level compilation chain from source file to gfc\/gfr.
-----------------------------------------------------------------------------
@@ -52,7 +52,7 @@ import GF.System.Arch
import Control.Monad
-- | environment variable for grammar search path
-gfGrammarPathVar = "GF_LIB_PATH"
+gfGrammarPathVar = "GF_GRAMMAR_PATH"
-- | in batch mode: write code in a file
batchCompile f = liftM fst $ compileModule defOpts emptyShellState f
@@ -101,12 +101,12 @@ compileModule opts1 st0 file = do
let useLineOpt = maybe False (const True) $ getOptVal opts1 pathList
let opts = addOptions opts1 opts0
let fpath = justInitPath file
- let ps0 = pathListOpts opts fpath
+ ps0 <- ioeIO $ pathListOpts opts fpath
let ps1 = if (useFileOpt && not useLineOpt)
then (map (prefixPathName fpath) ps0)
else ps0
- ps <- ioeIO $ extendPathEnv gfGrammarPathVar ps1
+ ps <- ioeIO $ extendPathEnv gfLibraryPath gfGrammarPathVar ps1
let ioeIOIf = if oElem beVerbose opts then ioeIO else (const (return ()))
ioeIOIf $ putStrLn $ "module search path:" +++ show ps ----
let st = st0 --- if useFileOpt then emptyShellState else st0
@@ -134,8 +134,8 @@ compileEnvShSt st fs = ((0,sgr,cgr),fts) where
notIns i = notElem (prt i) $ map fileBody fs
fts = readFiles st
-pathListOpts :: Options -> FileName -> [InitPath]
-pathListOpts opts file = maybe [file] pFilePaths $ getOptVal opts pathList
+pathListOpts :: Options -> FileName -> IO [InitPath]
+pathListOpts opts file = maybe (return [file]) getFilePaths $ getOptVal opts pathList
reverseModules (MGrammar ms) = MGrammar $ reverse ms