[commit: ghc] master: API Annotations : add Locations in hsSyn were layout occurs (fb54b2c)

git at git.haskell.org git at git.haskell.org
Wed May 6 13:09:29 UTC 2015


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

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

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

commit fb54b2c11cc7f2cfbafa35b6a1819d7443aa5494
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Wed May 6 08:05:11 2015 -0500

    API Annotations : add Locations in hsSyn were layout occurs
    
    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
    
    Reviewed By: austin
    
    Differential Revision: https://phabricator.haskell.org/D815
    
    GHC Trac Issues: #10250


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

fb54b2c11cc7f2cfbafa35b6a1819d7443aa5494
 compiler/deSugar/Coverage.hs                       | 56 ++++++++++----------
 compiler/deSugar/DsArrows.hs                       | 30 ++++++-----
 compiler/deSugar/DsExpr.hs                         | 28 +++++-----
 compiler/deSugar/DsGRHSs.hs                        |  4 +-
 compiler/deSugar/DsListComp.hs                     |  8 +--
 compiler/deSugar/DsMeta.hs                         | 35 +++++++------
 compiler/deSugar/Match.hs                          |  2 +-
 compiler/hsSyn/Convert.hs                          | 12 ++---
 compiler/hsSyn/HsExpr.hs                           | 44 ++++++++--------
 compiler/hsSyn/HsUtils.hs                          | 47 ++++++++++-------
 compiler/parser/Parser.y                           | 20 ++++----
 compiler/parser/RdrHsSyn.hs                        | 14 ++---
 compiler/rename/RnBinds.hs                         |  8 +--
 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                   |  6 +--
 compiler/typecheck/TcHsSyn.hs                      | 30 ++++++-----
 compiler/typecheck/TcMatches.hs                    | 43 ++++++++--------
 compiler/typecheck/TcPatSyn.hs                     | 19 +++----
 compiler/typecheck/TcRnDriver.hs                   |  6 +--
 testsuite/tests/ghc-api/T6145.hs                   |  2 +-
 testsuite/tests/ghc-api/annotations/T10255.stdout  |  1 -
 .../tests/ghc-api/annotations/exampleTest.stdout   |  2 -
 .../tests/ghc-api/annotations/listcomps.stdout     | 10 ++--
 testsuite/tests/ghc-api/landmines/landmines.stdout |  6 +--
 28 files changed, 271 insertions(+), 248 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 fb54b2c11cc7f2cfbafa35b6a1819d7443aa5494


More information about the ghc-commits mailing list