diff options
| author | aarne <unknown> | 2003-11-03 16:27:55 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2003-11-03 16:27:55 +0000 |
| commit | 94326929b144913642121bef8f8ecc98feb992e7 (patch) | |
| tree | 07d59cc33cbef2ac79c6f3f573b9718c51322e7a /src/GF/Compile/Compile.hs | |
| parent | 2728e6e7ceec92c7f781368b4a523b37e5dee3b9 (diff) | |
Fixed several things, e.g. tokenizer.
Diffstat (limited to 'src/GF/Compile/Compile.hs')
| -rw-r--r-- | src/GF/Compile/Compile.hs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/GF/Compile/Compile.hs b/src/GF/Compile/Compile.hs index 4822cf2b4..a1b1758fb 100644 --- a/src/GF/Compile/Compile.hs +++ b/src/GF/Compile/Compile.hs @@ -47,15 +47,27 @@ batchCompileOld f = compileOld defOpts f defOpts = options [beVerbose, emitCode] -- compile with one module as starting point +-- command-line options override options (marked by --#) in the file +-- As for path: if it is read from file, the file path is prepended to each name. +-- If from command line, it is used as it is. compileModule :: Options -> ShellState -> FilePath -> IOE (GFC.CanonGrammar, (SourceGrammar,[(FilePath,ModTime)])) -compileModule opts st file = do - let ps = pathListOpts opts +compileModule opts1 st0 file = do + opts0 <- ioeIO $ getOptionsFromFile file + let useFileOpt = maybe False (const True) $ getOptVal opts0 pathList + let opts = addOptions opts1 opts0 + let ps0 = pathListOpts opts + let fpath = justInitPath file + let ps = if useFileOpt + then (map (prefixPathName fpath) ps0) + else ps0 ioeIO $ print ps ---- let putp = putPointE opts - let rfs = readFiles st - files <- getAllFiles ps rfs file + let st = st0 --- if useFileOpt then emptyShellState else st0 + let rfs = readFiles st + let file' = if useFileOpt then justFileName file else file -- to find file itself + files <- getAllFiles ps rfs file' ioeIO $ print files ---- let names = map (fileBody . justFileName) files ioeIO $ print names ---- |
