[commit: ghc] master: Support constructor Haddocks in more places (e20046a)

git at git.haskell.org git at git.haskell.org
Fri Jan 12 22:13:45 UTC 2018


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

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

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

commit e20046a0c4a552c5037797cf720fb34877bc2d21
Author: Alec Theriault <alec.theriault at gmail.com>
Date:   Fri Jan 12 16:45:48 2018 -0500

    Support constructor Haddocks in more places
    
    This adds support for adding Haddocks on individual non-record fields
    of regular (and GADT) constructors. The following now parses just fine
    with `-haddock` enabled:
    
    data Foo
      = Baz             -- ^ doc on the `Baz` constructor
          Int           -- ^ doc on the `Int` field of `Baz`
          String        -- ^ doc on the `String` field of `Baz`
    
      | Int             -- ^ doc on the `Int` field of the `:*` constructor
          :*            -- ^ doc on the `:*` constructor
        String          -- ^ doc on the `String` field of the `:*`
    constructor
    
      | Boa             -- ^ doc on the `Boa` record constructor
          { y :: () }
    
    The change is backwards compatible: if there is only one doc and it
    occurs
    on the last field, it is lifted to apply to the whole constructor (as
    before).
    
    Reviewers: bgamari, alanz
    
    Subscribers: rwbarton, thomie, mpickering, carter
    
    Differential Revision: https://phabricator.haskell.org/D4292


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

e20046a0c4a552c5037797cf720fb34877bc2d21
 compiler/parser/Parser.y                           | 49 ++++++++-----
 compiler/parser/RdrHsSyn.hs                        | 83 ++++++++++++++++++----
 testsuite/tests/ghc-api/annotations/T10255.stdout  |  1 -
 testsuite/tests/ghc-api/annotations/T10268.stdout  |  1 +
 testsuite/tests/ghc-api/annotations/T10278.stdout  |  5 +-
 testsuite/tests/ghc-api/annotations/T10312.stdout  |  6 +-
 testsuite/tests/ghc-api/annotations/T10354.stdout  |  4 ++
 testsuite/tests/ghc-api/annotations/T10399.stdout  |  3 -
 testsuite/tests/ghc-api/annotations/T10598.stdout  |  1 +
 testsuite/tests/ghc-api/annotations/T11018.stdout  |  8 ++-
 testsuite/tests/ghc-api/annotations/T12417.stdout  |  2 +
 .../tests/ghc-api/annotations/boolFormula.stdout   | 22 ++++++
 .../tests/ghc-api/annotations/exampleTest.stdout   |  1 -
 .../tests/ghc-api/annotations/listcomps.stdout     |  2 +
 .../tests/ghc-api/annotations/parseTree.stdout     |  2 -
 .../haddock/should_compile_flag_haddock/all.T      |  3 +
 .../should_compile_flag_haddock/haddockA035.hs     |  9 +++
 .../should_compile_flag_haddock/haddockA035.stderr |  9 +++
 .../should_compile_flag_haddock/haddockA036.hs     | 19 +++++
 .../should_compile_flag_haddock/haddockA036.stderr | 12 ++++
 .../should_compile_flag_haddock/haddockA037.hs     | 10 +++
 .../should_compile_flag_haddock/haddockA037.stderr |  7 ++
 .../haddock/should_compile_noflag_haddock/all.T    |  3 +
 .../should_compile_noflag_haddock/haddockC035.hs   |  9 +++
 .../should_compile_noflag_haddock/haddockC036.hs   | 19 +++++
 .../should_compile_noflag_haddock/haddockC037.hs   | 10 +++
 26 files changed, 258 insertions(+), 42 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 e20046a0c4a552c5037797cf720fb34877bc2d21


More information about the ghc-commits mailing list