[commit: ghc] master: parser: opt_kind_sig has incorrect SrcSpan (8aefc9b)

git at git.haskell.org git at git.haskell.org
Tue Apr 14 06:20:20 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8aefc9b746512e91891879ad546e850e8a427d23/ghc

>---------------------------------------------------------------

commit 8aefc9b746512e91891879ad546e850e8a427d23
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Tue Apr 14 01:16:48 2015 -0500

    parser: opt_kind_sig has incorrect SrcSpan
    
    The production for opt_kind_sig is
    
      opt_kind_sig :: { Located (Maybe (LHsKind RdrName)) }
              :                             { noLoc Nothing }
              | '::' kind                   {% ajl (sLL $1 $> (Just $2)) AnnDcolon (gl $1) }
    
    The outer Location is used only to get the full span for the enclosing
    declration, and is then stripped. The inner LHsKind then has a SrcSpan that does
    not include the '::'
    
    Extend the SrcSpan on $2 to include $1
    
    Reviewed By: austin
    
    Differential Revision: https://phabricator.haskell.org/D813
    
    GHC Trac Issues: #10209


>---------------------------------------------------------------

8aefc9b746512e91891879ad546e850e8a427d23
 compiler/hsSyn/HsDecls.hs                          |  7 ++--
 compiler/hsSyn/HsTypes.hs                          |  3 ++
 compiler/parser/Parser.y                           | 38 +++++++++++-----------
 .../tests/ghc-api/annotations/AnnotationTuple.hs   |  5 ++-
 .../tests/ghc-api/annotations/exampleTest.stdout   | 16 +++++++--
 .../tests/ghc-api/annotations/parseTree.stdout     | 14 ++++++--
 6 files changed, 56 insertions(+), 27 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 8aefc9b746512e91891879ad546e850e8a427d23


More information about the ghc-commits mailing list