• Ian Lynagh's avatar
    Refactor SrcLoc and SrcSpan · b2bd63f9
    Ian Lynagh authored
    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.
    b2bd63f9
CmmParse.y 36.4 KB