X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FbasicTypes%2FSrcLoc.lhs;fp=ghc%2Fcompiler%2FbasicTypes%2FSrcLoc.lhs;h=89947d777a4ba037f8fdf9f90e759bf9ac239e76;hb=904f158f9fe208b8154029dff655a6eab4b2828e;hp=5ebb9e6801771672cec275ade31a528a72a3923d;hpb=6ee2f67e582427f931c21c1fc58f62f8619d40b7;p=ghc-hetmet.git diff --git a/ghc/compiler/basicTypes/SrcLoc.lhs b/ghc/compiler/basicTypes/SrcLoc.lhs index 5ebb9e6..89947d7 100644 --- a/ghc/compiler/basicTypes/SrcLoc.lhs +++ b/ghc/compiler/basicTypes/SrcLoc.lhs @@ -21,9 +21,10 @@ module SrcLoc ( mkGeneratedSrcLoc, -- Code generated within the compiler - incSrcLine, + incSrcLine, replaceSrcLine, - srcLocFile -- return the file name part. + srcLocFile, -- return the file name part. + srcLocLine -- return the line part. ) where #include "HsVersions.h" @@ -78,9 +79,15 @@ isNoSrcLoc other = False srcLocFile :: SrcLoc -> FAST_STRING srcLocFile (SrcLoc fname _) = fname +srcLocLine :: SrcLoc -> FAST_INT +srcLocLine (SrcLoc _ l) = l + incSrcLine :: SrcLoc -> SrcLoc incSrcLine (SrcLoc s l) = SrcLoc s (l +# 1#) incSrcLine loc = loc + +replaceSrcLine :: SrcLoc -> FAST_INT -> SrcLoc +replaceSrcLine (SrcLoc s _) l = SrcLoc s l \end{code} %************************************************************************