mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-19 16:12:52 -06:00
dead code elimination for PGF. Note: the produced grammars will not work well with metavariables and high-order abstract syntax
This commit is contained in:
@@ -4,6 +4,7 @@ module GFC (mainGFC) where
|
||||
import PGF
|
||||
import PGF.CId
|
||||
import PGF.Data
|
||||
import PGF.Optimize
|
||||
import GF.Compile
|
||||
import GF.Compile.Export
|
||||
|
||||
@@ -55,7 +56,8 @@ compileCFFiles opts fs =
|
||||
unionPGFFiles :: Options -> [FilePath] -> IOE ()
|
||||
unionPGFFiles opts fs =
|
||||
do pgfs <- mapM readPGFVerbose fs
|
||||
let pgf = foldl1 unionPGF pgfs
|
||||
let pgf0 = foldl1 unionPGF pgfs
|
||||
pgf = if flag optOptimizePGF opts then optimizePGF pgf0 else pgf0
|
||||
pgfFile = grammarName opts pgf <.> "pgf"
|
||||
if pgfFile `elem` fs
|
||||
then putStrLnE $ "Refusing to overwrite " ++ pgfFile
|
||||
|
||||
Reference in New Issue
Block a user