projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f373efd
)
If the extension is not .lhs, runghc now treats it as .hs; fixes trac #1232
author
Ian Lynagh
<igloo@earth.li>
Wed, 23 Jul 2008 18:21:56 +0000
(18:21 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Wed, 23 Jul 2008 18:21:56 +0000
(18:21 +0000)
utils/runghc/runghc.hs
patch
|
blob
|
history
diff --git
a/utils/runghc/runghc.hs
b/utils/runghc/runghc.hs
index
84675bc
..
5053858
100644
(file)
--- a/
utils/runghc/runghc.hs
+++ b/
utils/runghc/runghc.hs
@@
-76,9
+76,14
@@
doIt ghc args = do
hClose h
doIt ghc (ghc_args ++ [filename])
filename : prog_args -> do
hClose h
doIt ghc (ghc_args ++ [filename])
filename : prog_args -> do
- let c1 = ":set prog " ++ show filename
+ let xflag = if takeExtension filename == ".lhs"
+ then []
+ else ["-x", "hs"]
+ c1 = ":set prog " ++ show filename
c2 = ":main " ++ show prog_args
c2 = ":main " ++ show prog_args
- res <- rawSystem ghc (["-ignore-dot-ghci"] ++ ghc_args ++
+ res <- rawSystem ghc (["-ignore-dot-ghci"] ++
+ xflag ++
+ ghc_args ++
[ "-e", c1, "-e", c2, filename])
exitWith res
[ "-e", c1, "-e", c2, filename])
exitWith res