[commit: ghc] master: Fix API Annotations for unboxed sums (38f289f)

git at git.haskell.org git at git.haskell.org
Tue Jan 17 18:15:32 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/38f289fa2a8715d2d5869e144b764c35cba16c6a/ghc

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

commit 38f289fa2a8715d2d5869e144b764c35cba16c6a
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Tue Jan 10 20:16:34 2017 +0200

    Fix API Annotations for unboxed sums
    
    An unboxed tuple such as
    
        (# | b | | | | | #)
    
    Ends up in the parser via `tup_exprs` as
    
        Sum 2 7 lexp
    
    where `lexp` is a `LHsExpr`
    
    From an API annotation perspective, the 5 `AnnVbar`s after the `b` were attached
    to `lexp`, but the leading `AnnVbar`s did not have a home.
    
    This patch attaches them all to the the parent tuple expression. The first (alt
    - 1) of them come before `lexp`, and the remaining (arity - alt) come after.
    
    Test Plan: ./validate
    
    Reviewers: osa1, austin, bgamari
    
    Subscribers: thomie, mpickering
    
    Differential Revision: https://phabricator.haskell.org/D2968
    
    GHC Trac Issues: #12417


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

38f289fa2a8715d2d5869e144b764c35cba16c6a
 compiler/hsSyn/HsExpr.hs                          | 11 +++-
 compiler/parser/Parser.y                          | 27 ++++-----
 testsuite/driver/extra_files.py                   |  1 +
 testsuite/tests/ghc-api/annotations/Makefile      |  4 ++
 testsuite/tests/ghc-api/annotations/T12417.stdout | 68 +++++++++++++++++++++++
 testsuite/tests/ghc-api/annotations/Test12417.hs  | 19 +++++++
 testsuite/tests/ghc-api/annotations/all.T         |  1 +
 7 files changed, 116 insertions(+), 15 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 38f289fa2a8715d2d5869e144b764c35cba16c6a


More information about the ghc-commits mailing list