summaryrefslogtreecommitdiff
path: root/ghc/compiler/main/DriverUtil.hs
diff options
context:
space:
mode:
authorsimonmar <unknown>2001-05-08 10:58:48 +0000
committersimonmar <unknown>2001-05-08 10:58:48 +0000
commitb8b47abe336d17ae5354a9bb15c44564b51c97ef (patch)
tree63e56444d4d5c45a43478e61b48604af72f19fdf /ghc/compiler/main/DriverUtil.hs
parentdc673bca305b43342b864445539b49c353dd6a10 (diff)
downloadhaskell-b8b47abe336d17ae5354a9bb15c44564b51c97ef.tar.gz
[project @ 2001-05-08 10:58:48 by simonmar]
Add DriverPhases.haskellish_src_suffix :: String -> Bool DriverPhases.haskellish_src_file :: String -> Bool which return True for suffixes of Haskell source files only. The existing haskellish_suffix and haskellish_file return True also for .raw_s and .hc files. We use these instead of haskellish_file in Main.main when deciding whether to preprocess a file. Fixes: compilation of .raw_s files, and potential bugs with compilation of .hc files.
Diffstat (limited to 'ghc/compiler/main/DriverUtil.hs')
-rw-r--r--ghc/compiler/main/DriverUtil.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/ghc/compiler/main/DriverUtil.hs b/ghc/compiler/main/DriverUtil.hs
index fd0bcafbf6..0a25f76c89 100644
--- a/ghc/compiler/main/DriverUtil.hs
+++ b/ghc/compiler/main/DriverUtil.hs
@@ -1,5 +1,5 @@
-----------------------------------------------------------------------------
--- $Id: DriverUtil.hs,v 1.20 2001/04/26 14:33:44 simonmar Exp $
+-- $Id: DriverUtil.hs,v 1.21 2001/05/08 10:58:48 simonmar Exp $
--
-- Utils for the driver
--
@@ -125,6 +125,9 @@ addNoDups var x = do
splitFilename :: String -> (String,String)
splitFilename f = split_longest_prefix f '.'
+getFileSuffix :: String -> String
+getFileSuffix f = drop_longest_prefix f '.'
+
-- "foo/bar/xyzzy.ext" -> ("foo/bar", "xyzzy", ".ext")
splitFilename3 :: String -> (String,String,String)
splitFilename3 str