diff options
Diffstat (limited to 'src/GF/API')
| -rw-r--r-- | src/GF/API/IOGrammar.hs | 12 |
1 files changed, 8 insertions, 4 deletions
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 |
