[commit: ghc] wip/7.10-api-annots: parser: opt_kind_sig has incorrect SrcSpan (ad6059f)

git at git.haskell.org git at git.haskell.org
Fri May 8 17:02:01 UTC 2015


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

On branch  : wip/7.10-api-annots
Link       : http://ghc.haskell.org/trac/ghc/changeset/ad6059f67491b1f9b90df276bea781160fee1308/ghc

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

commit ad6059f67491b1f9b90df276bea781160fee1308
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
    
    (cherry picked from commit 8aefc9b746512e91891879ad546e850e8a427d23)


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

ad6059f67491b1f9b90df276bea781160fee1308
 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 ad6059f67491b1f9b90df276bea781160fee1308


More information about the ghc-commits mailing list