summaryrefslogtreecommitdiff
path: root/src/GF/Compile
diff options
context:
space:
mode:
Diffstat (limited to 'src/GF/Compile')
-rw-r--r--src/GF/Compile/Compile.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/GF/Compile/Compile.hs b/src/GF/Compile/Compile.hs
index fa2e65a3c..78f3a1bb1 100644
--- a/src/GF/Compile/Compile.hs
+++ b/src/GF/Compile/Compile.hs
@@ -35,6 +35,10 @@ import Arch
import Monad
+-- environment variable for grammar search path
+
+gfGrammarPathVar = "GF_LIB_PATH"
+
-- in batch mode: write code in a file
batchCompile f = liftM fst $ compileModule defOpts emptyShellState f
@@ -86,9 +90,10 @@ compileModule opts1 st0 file = do
let opts = addOptions opts1 opts0
let ps0 = pathListOpts opts
let fpath = justInitPath file
- let ps = if useFileOpt
- then (map (prefixPathName fpath) ps0)
- else ps0
+ let ps1 = if useFileOpt
+ then (map (prefixPathName fpath) ps0)
+ else ps0
+ ps <- ioeIO $ extendPathEnv gfGrammarPathVar ps1
let ioeIOIf = if oElem beSilent opts then (const (return ())) else ioeIO
ioeIOIf $ putStrLn $ "module search path:" +++ show ps ----
let putp = putPointE opts