summaryrefslogtreecommitdiff
path: root/src/GF/Compile
diff options
context:
space:
mode:
authorbjorn <bjorn@bringert.net>2008-10-16 11:58:18 +0000
committerbjorn <bjorn@bringert.net>2008-10-16 11:58:18 +0000
commitbb25c86ae5624f52ed63af9ea92467490e8647d6 (patch)
tree42d9f997d9bccb43a7b54ddebf4be68c69997024 /src/GF/Compile
parent176dc3e730c5b8faf82457fd164135fc36faa291 (diff)
Copy command-line flags to in-memory module when reading from a .gfo file. This maeans that command-line flags get put in the .pgf file.
Diffstat (limited to 'src/GF/Compile')
-rw-r--r--src/GF/Compile/GetGrammar.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/GF/Compile/GetGrammar.hs b/src/GF/Compile/GetGrammar.hs
index f9cdbcc14..b8ee7c3cc 100644
--- a/src/GF/Compile/GetGrammar.hs
+++ b/src/GF/Compile/GetGrammar.hs
@@ -42,7 +42,11 @@ getSourceModule opts file0 = do
string <- readFileIOE file
let tokens = myLexer string
mo1 <- ioeErr $ pModDef tokens
- ioeErr $ transModDef mo1
+ mo2 <- ioeErr $ transModDef mo1
+ return $ addOptionsToModule opts mo2
+
+addOptionsToModule :: Options -> SourceModule -> SourceModule
+addOptionsToModule opts = mapSourceModule (\m -> m { flags = flags m `addOptions` opts })
-- FIXME: should use System.IO.openTempFile
runPreprocessor :: FilePath -> String -> IOE FilePath