[commit: ghc] master: Implement BlockArguments (#10843) (be84823)

git at git.haskell.org git at git.haskell.org
Thu Feb 1 04:30:08 UTC 2018


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

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

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

commit be84823b956f0aa09c58d94d1901f2dff13546b4
Author: Takano Akio <tak at anoak.io>
Date:   Wed Jan 31 21:35:29 2018 -0500

    Implement BlockArguments (#10843)
    
    This patch implements the BlockArguments extension, as proposed at
    https://github.com/ghc-proposals/ghc-proposals/pull/90. It also
    fixes #10855 as a side-effect.
    
    This patch adds a large number of shift-reduce conflicts to the parser.
    All of them concern the ambiguity as to where constructs like `if` and
    `let` end. Fortunately they are resolved correctly by preferring shift.
    
    The patch is based on @gibiansky's ArgumentDo implementation (D1219).
    
    Test Plan: ./validate
    
    Reviewers: goldfire, bgamari, alanz, mpickering
    
    Reviewed By: bgamari, mpickering
    
    Subscribers: Wizek, dfeuer, gibiansky, rwbarton, thomie, mpickering, carter
    
    GHC Trac Issues: #10843, #10855
    
    Differential Revision: https://phabricator.haskell.org/D4260


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

be84823b956f0aa09c58d94d1901f2dff13546b4
 compiler/main/DynFlags.hs                          |   1 +
 compiler/parser/Lexer.x                            |  17 +-
 compiler/parser/Parser.y                           | 188 +++++++++++++--------
 compiler/parser/RdrHsSyn.hs                        |  24 +++
 docs/users_guide/bugs.rst                          |   6 -
 docs/users_guide/glasgow_exts.rst                  |  98 +++++++++++
 .../ghc-boot-th/GHC/LanguageExtensions/Type.hs     |   1 +
 testsuite/tests/driver/T4437.hs                    |   1 +
 .../tests/parser/should_compile/BlockArguments.hs  |  25 +++
 .../should_compile/BlockArgumentsLambdaCase.hs     |  13 ++
 .../parser/should_compile/NoBlockArguments.hs      |   8 +
 testsuite/tests/parser/should_compile/T10855.hs    |   5 +
 testsuite/tests/parser/should_compile/all.T        |   4 +
 .../parser/should_fail/NoBlockArgumentsFail.hs     |   7 +
 .../parser/should_fail/NoBlockArgumentsFail.stderr |   6 +
 .../parser/should_fail/NoBlockArgumentsFail2.hs    |   6 +
 .../should_fail/NoBlockArgumentsFail2.stderr       |   6 +
 .../parser/should_fail/NoBlockArgumentsFail3.hs    |   8 +
 .../should_fail/NoBlockArgumentsFail3.stderr       |   6 +
 .../parser/should_fail/ParserNoLambdaCase.stderr   |   4 +-
 testsuite/tests/parser/should_fail/all.T           |   3 +
 testsuite/tests/perf/compiler/all.T                |   3 +-
 22 files changed, 355 insertions(+), 85 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 be84823b956f0aa09c58d94d1901f2dff13546b4


More information about the ghc-commits mailing list