[GHC] #3384: Add HsSyn prettyprinter tests

GHC ghc-devs at haskell.org
Wed Dec 7 19:31:25 UTC 2016


#3384: Add HsSyn prettyprinter tests
-------------------------------------+-------------------------------------
        Reporter:  igloo             |                Owner:
            Type:  task              |               Status:  patch
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Test Suite        |              Version:
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D2752
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Alan Zimmerman <alan.zimm@…>):

 In [changeset:"499e43824bda967546ebf95ee33ec1f84a114a7c/ghc" 499e438/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="499e43824bda967546ebf95ee33ec1f84a114a7c"
 Add HsSyn prettyprinter tests

 Summary:
 Add prettyprinter tests, which take a file, parse it, pretty print it,
 re-parse the pretty printed version and then compare the original and
 new ASTs (ignoring locations)

 Updates haddock submodule to match the AST changes.

 There are three issues outstanding

 1. Extra parens around a context are not reproduced. This will require an
    AST change and will be done in a separate patch.

 2. Currently if an `HsTickPragma` is found, this is not pretty-printed,
    to prevent noise in the output.

    I am not sure what the desired behaviour in this case is, so have left
    it as before. Test Ppr047 is marked as expected fail for this.

 3. Apart from in a context, the ParsedSource AST keeps all the parens from
    the original source.  Something is happening in the renamer to remove
 the
    parens around visible type application, causing T12530 to fail, as the
    dumped splice decl is after the renamer.

    This needs to be fixed by keeping the parens, but I do not know where
 they
    are being removed.  I have amended the test to pass, by removing the
 parens
    in the expected output.

 Test Plan: ./validate

 Reviewers: goldfire, mpickering, simonpj, bgamari, austin

 Reviewed By: simonpj, bgamari

 Subscribers: simonpj, goldfire, thomie, mpickering

 Differential Revision: https://phabricator.haskell.org/D2752

 GHC Trac Issues: #3384
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/3384#comment:17>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list