Commit c0909f1e authored by Ian Lynagh's avatar Ian Lynagh
Browse files

If the extension is not .lhs, runghc now treats it as .hs; fixes trac #1232

parent f373efd4
......@@ -76,9 +76,14 @@ doIt ghc 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
res <- rawSystem ghc (["-ignore-dot-ghci"] ++ ghc_args ++
res <- rawSystem ghc (["-ignore-dot-ghci"] ++
xflag ++
ghc_args ++
[ "-e", c1, "-e", c2, filename])
exitWith res
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment