[commit: ghc] master: APIAnnotations:add Locations in hsSyn for layout (2290c8b)

git at git.haskell.org git at git.haskell.org
Fri Nov 13 06:39:00 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2290c8bd8c3faee0cb7dc1c2c7951bb9d5e3ebf9/ghc

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

commit 2290c8bd8c3faee0cb7dc1c2c7951bb9d5e3ebf9
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Fri Nov 13 08:39:07 2015 +0200

    APIAnnotations:add Locations in hsSyn for layout
    
    Summary:
    At the moment ghc-exactprint, which uses the GHC API Annotations to
    provide a framework for roundtripping Haskell source code with optional
    AST edits, has to implement a horrible workaround to manage the points
    where layout needs to be captured.
    
    These are
    
        MatchGroup
        HsDo
        HsCmdDo
        HsLet
        LetStmt
        HsCmdLet
        GRHSs
    
    To provide a more natural representation, the contents subject to layout
    rules need to be wrapped in a SrcSpan.
    
    This commit does this.
    
    Trac ticket #10250
    
    Test Plan: ./validate
    
    Reviewers: hvr, goldfire, bgamari, austin, mpickering
    
    Reviewed By: mpickering
    
    Subscribers: thomie, mpickering
    
    Differential Revision: https://phabricator.haskell.org/D1370
    
    GHC Trac Issues: #10250


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

2290c8bd8c3faee0cb7dc1c2c7951bb9d5e3ebf9
 compiler/deSugar/Coverage.hs                       | 48 ++++++++---------
 compiler/deSugar/DsArrows.hs                       | 18 ++++---
 compiler/deSugar/DsExpr.hs                         | 33 ++++++------
 compiler/deSugar/DsGRHSs.hs                        |  4 +-
 compiler/deSugar/DsListComp.hs                     |  8 +--
 compiler/deSugar/DsMeta.hs                         | 35 +++++++------
 compiler/deSugar/Match.hs                          |  2 +-
 compiler/hsSyn/Convert.hs                          | 14 ++---
 compiler/hsSyn/HsExpr.hs                           | 47 ++++++++---------
 compiler/hsSyn/HsUtils.hs                          | 42 ++++++++-------
 compiler/main/InteractiveEval.hs                   |  2 +-
 compiler/parser/Parser.y                           | 20 ++++----
 compiler/parser/RdrHsSyn.hs                        | 14 ++---
 compiler/rename/RnBinds.hs                         |  6 +--
 compiler/rename/RnExpr.hs                          | 60 +++++++++++-----------
 compiler/rename/RnTypes.hs                         |  2 +-
 compiler/typecheck/TcArrows.hs                     | 16 +++---
 compiler/typecheck/TcBinds.hs                      |  4 +-
 compiler/typecheck/TcExpr.hs                       |  4 +-
 compiler/typecheck/TcGenDeriv.hs                   |  9 ++--
 compiler/typecheck/TcHsSyn.hs                      | 30 ++++++-----
 compiler/typecheck/TcMatches.hs                    | 43 ++++++++--------
 compiler/typecheck/TcPatSyn.hs                     | 21 ++++----
 compiler/typecheck/TcRnDriver.hs                   |  6 +--
 testsuite/tests/ghc-api/T6145.hs                   |  2 +-
 .../tests/ghc-api/annotations/listcomps.stdout     | 10 ++--
 testsuite/tests/ghc-api/landmines/landmines.stdout |  6 +--
 27 files changed, 268 insertions(+), 238 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 2290c8bd8c3faee0cb7dc1c2c7951bb9d5e3ebf9


More information about the ghc-commits mailing list