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...
This commit is contained in:
hallgren
2014-01-09 17:30:24 +00:00
parent 768d9de668
commit ed3d30e3d1
3 changed files with 38 additions and 28 deletions

View File

@@ -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 ----