projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FIX: #1253 (Can't use non-layout at top level)
[ghc-hetmet.git]
/
compiler
/
basicTypes
/
SrcLoc.lhs
diff --git
a/compiler/basicTypes/SrcLoc.lhs
b/compiler/basicTypes/SrcLoc.lhs
index
8ced456
..
e028c12
100644
(file)
--- a/
compiler/basicTypes/SrcLoc.lhs
+++ b/
compiler/basicTypes/SrcLoc.lhs
@@
-1,11
+1,6
@@
%
%
-% (c) The University of Glasgow, 1992-2003
+% (c) The University of Glasgow, 1992-2006
%
%
-%************************************************************************
-%* *
-\section[SrcLoc]{The @SrcLoc@ type}
-%* *
-%************************************************************************
\begin{code}
module SrcLoc (
\begin{code}
module SrcLoc (
@@
-35,14
+30,16
@@
module SrcLoc (
-- These are dubious exports, because they crash on some inputs,
-- used only in Lexer.x where we are sure what the Span looks like
-- These are dubious exports, because they crash on some inputs,
-- used only in Lexer.x where we are sure what the Span looks like
- srcSpanFile, srcSpanEndLine, srcSpanEndCol,
+ srcSpanFile,
+ srcSpanStartLine, srcSpanEndLine,
+ srcSpanStartCol, srcSpanEndCol,
Located(..), getLoc, unLoc, noLoc, eqLocated, cmpLocated, combineLocs, addCLoc
) where
#include "HsVersions.h"
Located(..), getLoc, unLoc, noLoc, eqLocated, cmpLocated, combineLocs, addCLoc
) where
#include "HsVersions.h"
-import Util ( thenCmp )
+import Util
import Outputable
import FastString
\end{code}
import Outputable
import FastString
\end{code}
@@
-138,11
+135,7
@@
cmpSrcLoc (ImportedLoc m1) (ImportedLoc m2) = m1 `compare` m2
cmpSrcLoc (ImportedLoc _) other = LT
cmpSrcLoc (SrcLoc s1 l1 c1) (SrcLoc s2 l2 c2)
cmpSrcLoc (ImportedLoc _) other = LT
cmpSrcLoc (SrcLoc s1 l1 c1) (SrcLoc s2 l2 c2)
- = (s1 `compare` s2) `thenCmp` (l1 `cmpline` l2) `thenCmp` (c1 `cmpline` c2)
- where
- l1 `cmpline` l2 | l1 < l2 = LT
- | l1 == l2 = EQ
- | otherwise = GT
+ = (s1 `compare` s2) `thenCmp` (l1 `compare` l2) `thenCmp` (c1 `compare` c2)
cmpSrcLoc (SrcLoc _ _ _) other = GT
instance Outputable SrcLoc where
cmpSrcLoc (SrcLoc _ _ _) other = GT
instance Outputable SrcLoc where
@@
-157,7
+150,7
@@
instance Outputable SrcLoc where
hcat [text "{-# LINE ", int src_line, space,
char '\"', ftext src_path, text " #-}"]
hcat [text "{-# LINE ", int src_line, space,
char '\"', ftext src_path, text " #-}"]
- ppr (ImportedLoc mod) = ptext SLIT("Imported from") <+> text mod
+ ppr (ImportedLoc mod) = ptext SLIT("Defined in") <+> text mod
ppr (UnhelpfulLoc s) = ftext s
\end{code}
ppr (UnhelpfulLoc s) = ftext s
\end{code}
@@
-354,7
+347,7
@@
pprUserSpan (SrcSpanPoint src_path line col)
char ':', int col
]
char ':', int col
]
-pprUserSpan (ImportedSpan mod) = ptext SLIT("Imported from") <+> quotes (text mod)
+pprUserSpan (ImportedSpan mod) = ptext SLIT("Defined in") <+> text mod
pprUserSpan (UnhelpfulSpan s) = ftext s
\end{code}
pprUserSpan (UnhelpfulSpan s) = ftext s
\end{code}