Skip to content
  • Alan Zimmerman's avatar
    APIAnnotations:add Locations in hsSyn for layout · 2290c8bd
    Alan Zimmerman authored
    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
    2290c8bd