summaryrefslogtreecommitdiff
path: root/src-3.0/GFC.hs
diff options
context:
space:
mode:
authorbjorn <bjorn@bringert.net>2008-06-02 15:32:01 +0000
committerbjorn <bjorn@bringert.net>2008-06-02 15:32:01 +0000
commit5073ac4e7f4c24aa412ed3a3c3d719532df9f637 (patch)
treee9e60a0b58800dcc71aee9df2361852105c25574 /src-3.0/GFC.hs
parent20ea9ea5ec7c65ab01bff47d78f55e06b85fe79d (diff)
Honor the --name flag when generating output files. Set module name in generated Haskell modules correctly.
Diffstat (limited to 'src-3.0/GFC.hs')
-rw-r--r--src-3.0/GFC.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src-3.0/GFC.hs b/src-3.0/GFC.hs
index 1c773630d..4e553659b 100644
--- a/src-3.0/GFC.hs
+++ b/src-3.0/GFC.hs
@@ -30,8 +30,9 @@ writeOutputs opts pgf = mapM_ (\fmt -> writeOutput opts fmt pgf) (flag optOutput
writeOutput :: Options -> OutputFormat-> PGF -> IOE ()
writeOutput opts fmt pgf =
- do let path = outputFilePath opts fmt (prCId (absname pgf))
- s = prPGF fmt pgf
+ do let name = fromMaybe (prCId (absname pgf)) (moduleFlag optName opts)
+ path = outputFilePath opts fmt name
+ s = prPGF fmt pgf name
writeOutputFile path s
outputFilePath :: Options -> OutputFormat -> String -> FilePath