[project @ 1998-02-25 19:48:54 by sof]
[ghc-hetmet.git] / ghc / compiler / basicTypes / SrcLoc.lhs
index cfd42a6..f051eef 100644 (file)
@@ -21,7 +21,9 @@ module SrcLoc (
 
        mkGeneratedSrcLoc,      -- Code generated within the compiler
 
-       incSrcLine
+       incSrcLine,
+       
+       srcLocFile              -- return the file name part.
     ) where
 
 #include "HsVersions.h"
@@ -72,6 +74,9 @@ mkGeneratedSrcLoc   = UnhelpfulSrcLoc SLIT("<compiler-generated-code>")
 isNoSrcLoc NoSrcLoc = True
 isNoSrcLoc other    = False
 
+srcLocFile :: SrcLoc -> FAST_STRING
+srcLocFile (SrcLoc fname _) = fname
+
 incSrcLine :: SrcLoc -> SrcLoc
 incSrcLine (SrcLoc s l) = SrcLoc s (l +# 1#)
 incSrcLine loc         = loc