summaryrefslogtreecommitdiff
path: root/src/compiler/GFC.hs
diff options
context:
space:
mode:
authorgdetrez <gdetrez@crans.org>2010-12-11 16:36:30 +0000
committergdetrez <gdetrez@crans.org>2010-12-11 16:36:30 +0000
commitd7ae73f1c7c5b95f1f08dadd314fa7143602b523 (patch)
treee76f59a491f36859ae8636affcb6e969ada65af6 /src/compiler/GFC.hs
parenta59df6b49575f54756615c6e2b860ea0972a81eb (diff)
Adding an option to the gf compiler to add an index to pgf files
This is gonna be used by the android library to skip unused part of a pgf file
Diffstat (limited to 'src/compiler/GFC.hs')
-rw-r--r--src/compiler/GFC.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/GFC.hs b/src/compiler/GFC.hs
index c5e4f2800..075b82f18 100644
--- a/src/compiler/GFC.hs
+++ b/src/compiler/GFC.hs
@@ -5,6 +5,7 @@ import PGF
import PGF.CId
import PGF.Data
import PGF.Optimize
+import GF.Index
import GF.Compile
import GF.Compile.Export
@@ -59,7 +60,8 @@ unionPGFFiles :: Options -> [FilePath] -> IOE ()
unionPGFFiles opts fs =
do pgfs <- mapM readPGFVerbose fs
let pgf0 = foldl1 unionPGF pgfs
- pgf = if flag optOptimizePGF opts then optimizePGF pgf0 else pgf0
+ pgf1 = if flag optOptimizePGF opts then optimizePGF pgf0 else pgf0
+ pgf = if flag optMkIndexPGF opts then addIndex pgf1 else pgf1
pgfFile = grammarName opts pgf <.> "pgf"
if pgfFile `elem` fs
then putStrLnE $ "Refusing to overwrite " ++ pgfFile