[split SrcLoc and SrcSpan into their own module.
John Meacham <john@repetae.net>**20051207035238] addfile ./FrontEnd/SrcLoc.hs
hunk ./E/FromHs.hs 35
+import FrontEnd.SrcLoc
hunk ./FrontEnd/Class.hs 67
+import FrontEnd.KindInfer
+import FrontEnd.SrcLoc
+import FrontEnd.Utils
hunk ./FrontEnd/Class.hs 72
-import FrontEnd.KindInfer
hunk ./FrontEnd/Class.hs 83
-import FrontEnd.Utils
hunk ./FrontEnd/Deriving.hs 3
-import HsSyn
hunk ./FrontEnd/Deriving.hs 4
-import Name.VConsts
+import FrontEnd.SrcLoc
+import HsSyn
hunk ./FrontEnd/Deriving.hs 8
+import Name.VConsts
hunk ./FrontEnd/Desugar.hs 40
+
hunk ./FrontEnd/Desugar.hs 42
+import FrontEnd.SrcLoc
+import GenUtil
hunk ./FrontEnd/Desugar.hs 45
-import Name.VConsts
hunk ./FrontEnd/Desugar.hs 47
-import GenUtil
+import Name.VConsts
hunk ./FrontEnd/Diagnostic.hs 28
-import HsSyn
+import FrontEnd.SrcLoc
hunk ./FrontEnd/Exports.hs 6
-import CharIO
hunk ./FrontEnd/Exports.hs 8
+import List
+import Maybe
+import Prelude hiding (putStr,putStrLn)
+import qualified Data.Map as Map
+import qualified Data.Set as Set
+
+import CharIO
hunk ./FrontEnd/Exports.hs 18
+import FrontEnd.SrcLoc
hunk ./FrontEnd/Exports.hs 20
-import List
-import Maybe
hunk ./FrontEnd/Exports.hs 23
-import Prelude hiding (putStr,putStrLn)
-import qualified Data.Map as Map
-import qualified Data.Set as Set
hunk ./FrontEnd/FrontEnd.hs 6
+import Monad
+import qualified Data.Map as Map
+import qualified Text.PrettyPrint.HughesPJ as PPrint
+
hunk ./FrontEnd/FrontEnd.hs 14
+import FrontEnd.SrcLoc
hunk ./FrontEnd/FrontEnd.hs 18
-import Monad
hunk ./FrontEnd/FrontEnd.hs 20
-import qualified Data.Map as Map
hunk ./FrontEnd/FrontEnd.hs 22
-import qualified Text.PrettyPrint.HughesPJ as PPrint
hunk ./FrontEnd/HsParser.ly 24
+> import FrontEnd.SrcLoc
hunk ./FrontEnd/HsParser.ly 264
->	: 'type' simpletype srcloc '=' type	
+>	: 'type' simpletype srcloc '=' type
hunk ./FrontEnd/HsParser.ly 277
->	| 'instance' srcloc ctype optvaldefs	
+>	| 'instance' srcloc ctype optvaldefs
hunk ./FrontEnd/HsParser.ly 279
->	| 'default' srcloc type		
+>	| 'default' srcloc type
hunk ./FrontEnd/HsParser.ly 441
->	: type				{ HsUnBangedTy $1 }	
+>	: type				{ HsUnBangedTy $1 }
hunk ./FrontEnd/HsParser.ly 709
->	: consym		{ $1 }	
+>	: consym		{ $1 }
hunk ./FrontEnd/HsSyn.hs 8
-import Data.Monoid
hunk ./FrontEnd/HsSyn.hs 9
+import FrontEnd.SrcLoc
hunk ./FrontEnd/HsSyn.hs 11
-bogusASrcLoc = SrcLoc "bogus#" (-1) (-1)
-bogusSrcSpan = srcSpan bogusASrcLoc bogusASrcLoc
hunk ./FrontEnd/HsSyn.hs 13
-data SrcLoc = SrcLoc { srcLocFileName :: String, srcLocLine :: !Int, srcLocColumn :: !Int}
-    deriving(Data,Typeable,Eq,Ord)
-    {-! derive: update, GhcBinary !-}
hunk ./FrontEnd/HsSyn.hs 14
-data SrcSpan = SrcSpan { srcSpanBegin :: !SrcLoc, srcSpanEnd :: !SrcLoc }
-    deriving(Data,Typeable,Eq,Ord)
-    {-! derive: update !-}
-
-srcSpan :: SrcLoc -> SrcLoc -> SrcSpan
-srcSpan = SrcSpan
-
-instance Monoid SrcLoc where
-    mempty = bogusASrcLoc
-    mappend a b
-        | a == bogusASrcLoc = b
-        | otherwise = a
-
-
-
-class HasLocation a where
-    srcLoc :: a -> SrcLoc
-    getSrcSpan :: a -> SrcSpan
-    getSrcSpan x = bogusSrcSpan { srcSpanBegin = srcLoc x }
hunk ./FrontEnd/HsSyn.hs 25
-instance HasLocation a => HasLocation [a] where
-    srcLoc xs = mconcat (map srcLoc xs)
-
-instance Show SrcLoc where
-    show (SrcLoc fn l c) = fn ++ f l ++ f c where
-        f (-1) = ""
-        f n = ':':show n
-instance Show SrcSpan where
-    show (SrcSpan { srcSpanBegin =  sl1, srcSpanEnd = sl2 } ) = show sl1 ++ "-" ++ show sl2
hunk ./FrontEnd/MultiModuleBasics.hs 23
+import FrontEnd.SrcLoc
hunk ./FrontEnd/ParseMonad.hs 28
-import HsSyn(SrcLoc(..))
+import FrontEnd.SrcLoc
hunk ./FrontEnd/ParseUtils.hs 39
+import FrontEnd.SrcLoc
hunk ./FrontEnd/Rename.hs 78
+import FrontEnd.SrcLoc hiding(srcLoc)
+import FrontEnd.Utils
hunk ./FrontEnd/Rename.hs 82
-import HsSyn hiding(srcLoc)
+import HsSyn
hunk ./FrontEnd/Rename.hs 89
-import FrontEnd.Utils
hunk ./FrontEnd/Rename.hs 1187
-            --       | otherwise ->  parseName ClassName (show x ++ show (nameType x)) 
+            --       | otherwise ->  parseName ClassName (show x ++ show (nameType x))
hunk ./FrontEnd/Rename.hs 1241
-        --       | otherwise ->  parseName ClassName (show x ++ show (nameType x)) 
+        --       | otherwise ->  parseName ClassName (show x ++ show (nameType x))
hunk ./FrontEnd/SrcLoc.hs 1
+module FrontEnd.SrcLoc where
+
+import Data.Monoid
+import Data.Generics
+import Binary
+
+
+data SrcLoc = SrcLoc { srcLocFileName :: String, srcLocLine :: !Int, srcLocColumn :: !Int}
+    deriving(Data,Typeable,Eq,Ord)
+    {-! derive: update, GhcBinary !-}
+
+data SrcSpan = SrcSpan { srcSpanBegin :: !SrcLoc, srcSpanEnd :: !SrcLoc }
+    deriving(Data,Typeable,Eq,Ord)
+    {-! derive: update !-}
+
+bogusASrcLoc = SrcLoc "bogus#" (-1) (-1)
+bogusSrcSpan = SrcSpan bogusASrcLoc bogusASrcLoc
+
+instance Monoid SrcLoc where
+    mempty = bogusASrcLoc
+    mappend a b
+        | a == bogusASrcLoc = b
+        | otherwise = a
+
+--------------------
+-- haslocation class
+--------------------
+
+class HasLocation a where
+    srcLoc :: a -> SrcLoc
+    srcSpan :: a -> SrcSpan
+    srcSpan x = bogusSrcSpan { srcSpanBegin = slx, srcSpanEnd = slx } where slx = srcLoc x
+    srcLoc x = srcSpanBegin (srcSpan x)
+
+instance HasLocation a => HasLocation [a] where
+    srcLoc xs = mconcat (map srcLoc xs)
+
+instance HasLocation SrcLoc where
+    srcLoc x = x
+
+instance HasLocation SrcSpan where
+    srcSpan x = x
+
+data Located x = Located SrcSpan x
+    deriving(Ord,Show,Data,Typeable,Eq)
+
+instance HasLocation (Located a) where
+    srcSpan (Located x _) = x
+
+-----------------
+-- show instances
+-----------------
+
+instance Show SrcLoc where
+    show (SrcLoc fn l c) = fn ++ f l ++ f c where
+        f (-1) = ""
+        f n = ':':show n
+
+instance Show SrcSpan where
+    show SrcSpan { srcSpanBegin =  sl1, srcSpanEnd = sl2 }
+      | sl1 == sl2 = show sl1
+      | otherwise = show sl1 ++ "-" ++ show sl2
+
hunk ./FrontEnd/TIMain.hs 38
+import FrontEnd.SrcLoc
hunk ./FrontEnd/TIModule.hs 22
+import FrontEnd.KindInfer
hunk ./FrontEnd/TIModule.hs 24
+import FrontEnd.SrcLoc
+import FrontEnd.Tc.Monad()
+import FrontEnd.Utils
hunk ./FrontEnd/TIModule.hs 30
-import FrontEnd.KindInfer
-import Util.Inst()
-import Util.Gen
hunk ./FrontEnd/TIModule.hs 40
-import FrontEnd.Utils
+import Util.Gen
+import Util.Inst()
hunk ./FrontEnd/TIModule.hs 44
-import FrontEnd.Tc.Monad()
-
hunk ./FrontEnd/TIMonad.hs 49
-import HsSyn
hunk ./FrontEnd/TIMonad.hs 50
+import FrontEnd.SrcLoc
+import FrontEnd.Utils()
+import HsSyn
+import Name.Name
hunk ./FrontEnd/TIMonad.hs 55
-import TypeSigs(SigEnv)
hunk ./FrontEnd/TIMonad.hs 56
-import FrontEnd.Utils()
+import TypeSigs(SigEnv)
hunk ./FrontEnd/TIMonad.hs 58
-import Name.Name
hunk ./FrontEnd/Tc/Monad.hs 17
-import HsSyn(bogusASrcLoc)
-import Warning
+import Class(ClassHierarchy)
+import Diagnostic
hunk ./FrontEnd/Tc/Monad.hs 22
-import Name.Name
-import Representation
-import Class(ClassHierarchy)
-import Diagnostic
hunk ./FrontEnd/Tc/Monad.hs 24
+import FrontEnd.SrcLoc(bogusASrcLoc)
+import Name.Name
+import Options(Opt)
+import Representation
+import Warning
hunk ./FrontEnd/Tc/Monad.hs 52
-    tcInfoClassHierarchy :: ClassHierarchy
+    tcInfoClassHierarchy :: ClassHierarchy,
+    tcInfoOptions :: Opt  -- module specific options
hunk ./FrontEnd/TypeSynonyms.hs 17
+import FrontEnd.SrcLoc
hunk ./FrontEnd/TypeSyns.hs 5
-import FrontEnd.Desugar (doToExp)
-import HsSyn hiding(srcLoc)
hunk ./FrontEnd/TypeSyns.hs 6
+
+import FrontEnd.Desugar (doToExp)
+import FrontEnd.SrcLoc hiding(srcLoc)
+import HsSyn
hunk ./FrontEnd/Warning.hs 3
-import HsSyn
hunk ./FrontEnd/Warning.hs 10
+import FrontEnd.SrcLoc
hunk ./Ho.hs 40
+import FrontEnd.SrcLoc