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.
Showing
- compiler/basicTypes/Name.lhs 8 additions, 6 deletionscompiler/basicTypes/Name.lhs
- compiler/basicTypes/RdrName.lhs 6 additions, 4 deletionscompiler/basicTypes/RdrName.lhs
- compiler/basicTypes/SrcLoc.lhs 139 additions, 92 deletionscompiler/basicTypes/SrcLoc.lhs
- compiler/cmm/CmmLex.x 10 additions, 10 deletionscompiler/cmm/CmmLex.x
- compiler/cmm/CmmParse.y 1 addition, 1 deletioncompiler/cmm/CmmParse.y
- compiler/deSugar/Coverage.lhs 8 additions, 18 deletionscompiler/deSugar/Coverage.lhs
- compiler/hsSyn/HsImpExp.lhs 1 addition, 1 deletioncompiler/hsSyn/HsImpExp.lhs
- compiler/hsSyn/HsSyn.lhs 1 addition, 1 deletioncompiler/hsSyn/HsSyn.lhs
- compiler/main/GHC.hs 36 additions, 30 deletionscompiler/main/GHC.hs
- compiler/main/HeaderInfo.hs 5 additions, 5 deletionscompiler/main/HeaderInfo.hs
- compiler/main/HscMain.lhs 2 additions, 2 deletionscompiler/main/HscMain.lhs
- compiler/main/HscTypes.lhs 1 addition, 1 deletioncompiler/main/HscTypes.lhs
- compiler/parser/Lexer.x 74 additions, 69 deletionscompiler/parser/Lexer.x
- compiler/parser/Parser.y.pp 2 additions, 4 deletionscompiler/parser/Parser.y.pp
- compiler/rename/RnEnv.lhs 5 additions, 1 deletioncompiler/rename/RnEnv.lhs
- compiler/rename/RnHsDoc.hs 1 addition, 1 deletioncompiler/rename/RnHsDoc.hs
- compiler/rename/RnHsSyn.lhs 1 addition, 1 deletioncompiler/rename/RnHsSyn.lhs
- compiler/rename/RnNames.lhs 3 additions, 1 deletioncompiler/rename/RnNames.lhs
- compiler/typecheck/TcRnMonad.lhs 4 additions, 3 deletionscompiler/typecheck/TcRnMonad.lhs
- compiler/typecheck/TcSplice.lhs 11 additions, 7 deletionscompiler/typecheck/TcSplice.lhs
Loading
Please register or sign in to comment