diff options
| author | aarne <unknown> | 2004-04-01 09:51:32 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2004-04-01 09:51:32 +0000 |
| commit | f53f35978f4cd6b0e4c5e9123b5e88f04f6f4452 (patch) | |
| tree | 100fc2f36a0dccc24c030b5a82389dac70780902 /src/GF/API | |
| parent | 3f9b4e7855cf4594708a9fbad194c89540d2cf1e (diff) | |
2beta2
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 |
