From f53f35978f4cd6b0e4c5e9123b5e88f04f6f4452 Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 1 Apr 2004 09:51:32 +0000 Subject: 2beta2 --- src/GF/API/IOGrammar.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/GF/API') diff --git a/src/GF/API/IOGrammar.hs b/src/GF/API/IOGrammar.hs index b535c9be0..83823be16 100644 --- a/src/GF/API/IOGrammar.hs +++ b/src/GF/API/IOGrammar.hs @@ -8,6 +8,7 @@ import Compile import ShellState import Modules +import ReadFiles (isOldFile) import Option import Operations import UseIO @@ -45,9 +46,12 @@ shellStateFromFiles opts st file = case fileSuffix file of grts <- compileModule osb st file ioeErr $ updateShellState opts st grts _ -> do - let osb = if oElem showOld opts - then addOptions (options [beVerbose]) opts -- for old, no emit - else addOptions (options [beVerbose, emitCode]) opts -- for new,do + b <- ioeIO $ isOldFile file + let opts' = if b then (addOption showOld opts) else opts + + let osb = if oElem showOld opts' + then addOptions (options [beVerbose]) opts' -- for old no emit + else addOptions (options [beVerbose, emitCode]) opts' grts <- compileModule osb st file - ioeErr $ updateShellState opts st grts + ioeErr $ updateShellState opts' st grts --- liftM (changeModTimes rts) $ grammar2shellState opts gr -- cgit v1.2.3