summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GF/Compile.hs3
-rw-r--r--src/GF/Compile/GetGrammar.hs6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/GF/Compile.hs b/src/GF/Compile.hs
index b652779d7..ed2481835 100644
--- a/src/GF/Compile.hs
+++ b/src/GF/Compile.hs
@@ -158,9 +158,8 @@ compileOne opts env@(_,srcgr,_) file = do
then compileOne opts env $ gfo
else do
- sm000 <- putpOpt ("- parsing" +++ file) ("- compiling" +++ file ++ "... ") $
+ sm00 <- putpOpt ("- parsing" +++ file) ("- compiling" +++ file ++ "... ") $
getSourceModule opts file
- let sm00 = mapSourceModule (\m -> m { flags = flags m `addOptions` opts }) sm000
let sm0 = decodeStringsInModule sm00
(k',sm) <- compileSourceModule opts env sm0
let sm1 = if isConcr sm then shareModule sm else sm -- cannot expand Str
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