Refactor SrcLoc and SrcSpan
authorIan Lynagh <igloo@earth.li>
Wed, 1 Jun 2011 23:23:27 +0000 (00:23 +0100)
committerIan Lynagh <igloo@earth.li>
Thu, 9 Jun 2011 12:29:37 +0000 (13:29 +0100)
commitb2bd63f99d643f6b3eb30bb72bb9ae26d4183252
tree864e7994fdecb6766ad845affe3e616d3541b8b6
parentcba098d7823815baa66bcaff7e4f8b54855ae6eb
Refactor SrcLoc and SrcSpan

The "Unhelpful" cases are now in a separate type. This allows us to
improve various things, e.g.:
* Most of the panic's in SrcLoc are now gone
* The Lexer now works with RealSrcSpans rather than SrcSpans, i.e. it
  knows that it has real locations and thus can assume that the line
  number etc really exists
* Some of the more suspicious cases are no longer necessary, e.g.
  we no longer need this case in advanceSrcLoc:
      advanceSrcLoc loc _ = loc -- Better than nothing

More improvements can probably be made, e.g. tick locations can
probably use RealSrcSpans too.
22 files changed:
compiler/basicTypes/Name.lhs
compiler/basicTypes/RdrName.lhs
compiler/basicTypes/SrcLoc.lhs
compiler/cmm/CmmLex.x
compiler/cmm/CmmParse.y
compiler/deSugar/Coverage.lhs
compiler/hsSyn/HsImpExp.lhs
compiler/hsSyn/HsSyn.lhs
compiler/main/GHC.hs
compiler/main/HeaderInfo.hs
compiler/main/HscMain.lhs
compiler/main/HscTypes.lhs
compiler/parser/Lexer.x
compiler/parser/Parser.y.pp
compiler/rename/RnEnv.lhs
compiler/rename/RnHsDoc.hs
compiler/rename/RnHsSyn.lhs
compiler/rename/RnNames.lhs
compiler/typecheck/TcRnMonad.lhs
compiler/typecheck/TcSplice.lhs
ghc/GhciTags.hs
ghc/InteractiveUI.hs