Skip to content
  • Simon Marlow's avatar
    [project @ 2003-12-10 14:15:16 by simonmar] · 55042138
    Simon Marlow authored
    Add accurate source location annotations to HsSyn
    -------------------------------------------------
    
    Every syntactic entity in HsSyn is now annotated with a SrcSpan, which
    details the exact beginning and end points of that entity in the
    original source file.  All honest compilers should do this, and it was
    about time GHC did the right thing.
    
    The most obvious benefit is that we now have much more accurate error
    messages; when running GHC inside emacs for example, the cursor will
    jump to the exact location of an error, not just a line somewhere
    nearby.  We haven't put a huge amount of effort into making sure all
    the error messages are accurate yet, so there could be some tweaking
    still needed, although the majority of messages I've seen have been
    spot-on.
    
    Error messages now contain a column number in addition to the line
    number, eg.
    
       read001.hs:25:10: Variable not in scope: `+#'
    
    To get the full text span info, use the new option -ferror-spans.  eg.
    
       read00...
    55042138