[commit: ghc] master: Expose enabled language extensions to TH (c1e2553)

git at git.haskell.org git at git.haskell.org
Tue Dec 15 23:03:24 UTC 2015


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

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

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

commit c1e25536d67fba33ad6ddae5556115340d99000a
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Tue Dec 15 23:57:46 2015 +0100

    Expose enabled language extensions to TH
    
    This exposes `template-haskell` functions for querying the language
    extensions which are enabled when compiling a module,
    
    - an `isExtEnabled` function to check whether an extension is enabled
    - an `extsEnabled` function to obtain a full list of enabled extensions
    
    To avoid code duplication this adds a `GHC.LanguageExtensions` module to
    `ghc-boot` and moves `DynFlags.ExtensionFlag` into it. A happy
    consequence of this is that the ungainly `DynFlags` lost around 500
    lines. Moreover, flags corresponding to language extensions are now
    clearly distinguished from other flags due to the `LangExt.*` prefix.
    
    Updates haddock submodule.
    
    This fixes #10820.
    
    Test Plan: validate
    
    Reviewers: austin, spinda, hvr, goldfire, alanz
    
    Reviewed By: goldfire
    
    Subscribers: mpickering, RyanGlScott, hvr, simonpj, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1200
    
    GHC Trac Issues: #10820


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

c1e25536d67fba33ad6ddae5556115340d99000a
 compiler/basicTypes/MkId.hs                        |   7 +-
 compiler/deSugar/DsBinds.hs                        |   7 +-
 compiler/deSugar/DsMonad.hs                        |   3 +-
 compiler/deSugar/DsUtils.hs                        |   5 +-
 compiler/deSugar/MatchLit.hs                       |   5 +-
 compiler/main/DriverPipeline.hs                    |  11 +-
 compiler/main/DynFlags.hs                          | 568 +++++++++------------
 compiler/main/GHC.hs                               |   3 +-
 compiler/main/GhcMake.hs                           |   3 +-
 compiler/main/HeaderInfo.hs                        |   3 +-
 compiler/parser/Lexer.x                            |  75 +--
 compiler/parser/Parser.y                           |   7 +-
 compiler/parser/RdrHsSyn.hs                        |   7 +-
 compiler/rename/RnBinds.hs                         |  16 +-
 compiler/rename/RnEnv.hs                           |  18 +-
 compiler/rename/RnExpr.hs                          |  25 +-
 compiler/rename/RnNames.hs                         |   5 +-
 compiler/rename/RnPat.hs                           |  23 +-
 compiler/rename/RnSource.hs                        |   7 +-
 compiler/rename/RnSplice.hs                        |   6 +-
 compiler/rename/RnTypes.hs                         |  28 +-
 compiler/typecheck/Inst.hs                         |   6 +-
 compiler/typecheck/TcBinds.hs                      |   7 +-
 compiler/typecheck/TcDefaults.hs                   |   4 +-
 compiler/typecheck/TcDeriv.hs                      |  35 +-
 compiler/typecheck/TcEnv.hs                        |  14 +-
 compiler/typecheck/TcErrors.hs                     |   3 +-
 compiler/typecheck/TcExpr.hs                       |   6 +-
 compiler/typecheck/TcForeign.hs                    |   3 +-
 compiler/typecheck/TcHsSyn.hs                      |   4 +-
 compiler/typecheck/TcHsType.hs                     |  15 +-
 compiler/typecheck/TcInstDcls.hs                   |   7 +-
 compiler/typecheck/TcInteract.hs                   |   3 +-
 compiler/typecheck/TcMType.hs                      |   4 +-
 compiler/typecheck/TcMatches.hs                    |   5 +-
 compiler/typecheck/TcPat.hs                        |   5 +-
 compiler/typecheck/TcRnDriver.hs                   |   5 +-
 compiler/typecheck/TcRnMonad.hs                    |   8 +-
 compiler/typecheck/TcSimplify.hs                   |   6 +-
 compiler/typecheck/TcSplice.hs                     |   6 +
 compiler/typecheck/TcTyClsDecls.hs                 |  31 +-
 compiler/typecheck/TcType.hs                       |   5 +-
 compiler/typecheck/TcValidity.hs                   |  40 +-
 docs/users_guide/7.12.1-notes.rst                  |   8 +
 ghc/InteractiveUI.hs                               |  11 +-
 ghc/ghc-bin.cabal.in                               |   1 +
 libraries/ghc-boot/GHC/LanguageExtensions.hs       | 122 +++++
 libraries/ghc-boot/ghc-boot.cabal                  |   1 +
 libraries/template-haskell/Language/Haskell/TH.hs  |   3 +
 .../Language/Haskell/TH/LanguageExtensions.hs      |  22 +
 .../template-haskell/Language/Haskell/TH/Syntax.hs |  26 +-
 libraries/template-haskell/template-haskell.cabal  |   1 +
 testsuite/tests/ghc-api/T10508_api.hs              |   3 +-
 testsuite/tests/th/T10820.hs                       |  16 +
 .../scripts/ghci053.stdout => th/T10820.stdout}    |   1 +
 testsuite/tests/th/all.T                           |   1 +
 utils/haddock                                      |   2 +-
 utils/mkUserGuidePart/Main.hs                      |   7 +-
 58 files changed, 709 insertions(+), 570 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 c1e25536d67fba33ad6ddae5556115340d99000a


More information about the ghc-commits mailing list