Add ASSERTs to all calls of nameModule
[ghc-hetmet.git] / compiler / basicTypes / SrcLoc.lhs
index a342c89..a748b47 100644 (file)
@@ -58,6 +58,7 @@ module SrcLoc (
        
        -- ** Constructing Located
        noLoc,
+    mkGeneralLocated,
        
        -- ** Deconstructing Located
        getLoc, unLoc, 
@@ -71,7 +72,6 @@ module SrcLoc (
 import Util
 import Outputable
 import FastString
-import System.FilePath
 \end{code}
 
 %************************************************************************
@@ -166,9 +166,6 @@ cmpSrcLoc (SrcLoc s1 l1 c1) (SrcLoc s2 l2 c2)
   = (s1 `compare` s2) `thenCmp` (l1 `compare` l2) `thenCmp` (c1 `compare` c2)
 cmpSrcLoc (SrcLoc _ _ _) _other = GT
 
-pprFastFilePath :: FastString -> SDoc
-pprFastFilePath path = text $ normalise $ unpackFS path
-
 instance Outputable SrcLoc where
     ppr (SrcLoc src_path src_line src_col)
       = getPprStyle $ \ sty ->
@@ -457,6 +454,9 @@ getLoc (L l _) = l
 noLoc :: e -> Located e
 noLoc e = L noSrcSpan e
 
+mkGeneralLocated :: String -> e -> Located e
+mkGeneralLocated s e = L (mkGeneralSrcSpan (fsLit s)) e
+
 combineLocs :: Located a -> Located b -> SrcSpan
 combineLocs a b = combineSrcSpans (getLoc a) (getLoc b)