From d6f32b3bcd03e7fe806a1b64cd370ba78dc00aa7 Mon Sep 17 00:00:00 2001 From: krasimir Date: Wed, 9 Jun 2010 11:32:59 +0000 Subject: dead code elimination for PGF. Note: the produced grammars will not work well with metavariables and high-order abstract syntax --- src/compiler/GF/Compile.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/compiler/GF/Compile.hs') diff --git a/src/compiler/GF/Compile.hs b/src/compiler/GF/Compile.hs index 1aebeaf31..bf872c138 100644 --- a/src/compiler/GF/Compile.hs +++ b/src/compiler/GF/Compile.hs @@ -41,6 +41,7 @@ import PGF.Check import PGF.CId import PGF.Data import PGF.Macros +import PGF.Optimize -- | Compiles a number of source files and builds a 'PGF' structure for them. @@ -60,7 +61,7 @@ link opts cnc gr = do (True, True) -> ioeIO $ putStrLn "OK" (False,True) -> return () _ -> ioeIO $ putStrLn $ "Corrupted PGF" - return gc + return $ if flag optOptimizePGF opts then optimizePGF gc else gc Bad s -> fail s batchCompile :: Options -> [FilePath] -> IOE SourceGrammar -- cgit v1.2.3