1
0
forked from GitHub/gf-core

fixed reading argvars from gfc in gf-to-gfcc

This commit is contained in:
aarne
2007-09-21 12:00:31 +00:00
parent 6ce60d64a9
commit 6ac6a31274
4 changed files with 19 additions and 12 deletions

View File

@@ -29,9 +29,9 @@ import GF.Devel.Arch
import Control.Monad
import System.Directory
batchCompile :: [FilePath] -> IO SourceGrammar
batchCompile files = do
let defOpts = options [emitCode]
batchCompile :: Options -> [FilePath] -> IO SourceGrammar
batchCompile opts files = do
let defOpts = addOptions opts (options [emitCode])
Ok (_,gr) <- appIOE $ foldM (compileModule defOpts) emptyCompileEnv files
return gr
@@ -79,12 +79,12 @@ compileEnvShSt env@(_,sgr) fs = (0,sgr2) where
compileOne :: Options -> CompileEnv -> FullPath -> IOE CompileEnv
compileOne opts env@(_,srcgr) file = do
let putp s = putPointE opts (s ++ "\n")
let putp s = putPointE opts ("\n" ++ s)
let putpp = putPointEsil opts
let putpOpt v m act
| oElem beVerbose opts = putp v act
| oElem beSilent opts = putpp v act
| otherwise = ioeIO (putStrFlush m) >> act
| otherwise = ioeIO (putStrFlush ("\n" ++ m)) >> act
let gf = fileSuffix file
let path = justInitPath file