From ed3d30e3d1134dfd06ae2a88b51767041eda6c0b Mon Sep 17 00:00:00 2001 From: hallgren Date: Thu, 9 Jan 2014 17:30:24 +0000 Subject: Check file datestamp before creating PGF file when compiling grammars When running a command like gf -make L_1.gf ... L_n.gf gf now avoids recreating the target PGF file if it already exists and is up-to-date. gf still reads all required .gfo files, so significant additional speed improvements are still possible. This could be done by reading .gfo files more lazily... --- src/compiler/GF/Command/Importing.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compiler/GF/Command/Importing.hs') diff --git a/src/compiler/GF/Command/Importing.hs b/src/compiler/GF/Command/Importing.hs index 4697e8b64..2bdc091f8 100644 --- a/src/compiler/GF/Command/Importing.hs +++ b/src/compiler/GF/Command/Importing.hs @@ -46,7 +46,7 @@ importSource :: SourceGrammar -> Options -> [FilePath] -> IO SourceGrammar importSource src0 opts files = do src <- appIOE $ batchCompile opts files case src of - Ok gr -> return gr + Ok (_,_,gr) -> return gr Bad msg -> do putStrLn msg return src0 @@ -58,7 +58,7 @@ importCF opts files get = do Ok gf -> return gf Bad s -> error s ---- Ok gr <- appIOE $ compileSourceGrammar opts gf - epgf <- appIOE $ link opts (identS (justModuleName (last files) ++ "Abs")) gr + epgf <- appIOE $ link opts (identS (justModuleName (last files) ++ "Abs"), (), gr) case epgf of Ok pgf -> return pgf Bad s -> error s ---- -- cgit v1.2.3