diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2015-12-15 23:57:46 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-12-15 23:59:54 +0100 |
commit | c1e25536d67fba33ad6ddae5556115340d99000a (patch) | |
tree | 4aa98e5fd9faa46df67412f94fef33d52205181e /utils | |
parent | 28638dfe79e915f33d75a1b22c5adce9e2b62b97 (diff) | |
download | haskell-c1e25536d67fba33ad6ddae5556115340d99000a.tar.gz |
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
Diffstat (limited to 'utils')
m--------- | utils/haddock | 0 | ||||
-rw-r--r-- | utils/mkUserGuidePart/Main.hs | 7 |
2 files changed, 1 insertions, 6 deletions
diff --git a/utils/haddock b/utils/haddock -Subproject 0fc8cfd532f5dfd12b5504f44a2b3c9fb659cd8 +Subproject d4657f07912416a1b14ddb517696f8ef3ffb85a diff --git a/utils/mkUserGuidePart/Main.hs b/utils/mkUserGuidePart/Main.hs index 11283c0b95..b30cc8f01d 100644 --- a/utils/mkUserGuidePart/Main.hs +++ b/utils/mkUserGuidePart/Main.hs @@ -1,7 +1,6 @@ module Main (main) where import DynFlags -import Data.List (stripPrefix) import Control.Monad (forM_) import Types hiding (flag) import Table @@ -43,11 +42,7 @@ whatGlasgowExtsDoes = unlines $ [ ".. hlist::", ""] ++ map ((" * "++) . parseExt) glasgowExtsFlags where - parseExt f - | Just ext <- stripPrefix "Opt_" (show f) - = inlineCode $ "-X" ++ ext - | otherwise - = error ("Can't parse extension: " ++ show f) + parseExt ext = inlineCode $ "-X" ++ show ext -- | Generate a reference table of the given set of flags. This is used in -- the users guide. |