mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
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:
@@ -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 ----
|
||||
|
||||
Reference in New Issue
Block a user