parsley-garnish 0.1.0.0 → 0.1.0.1
raw patch · 7 files changed
+41/−14 lines, 7 filesdep ~ghcPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: ghc
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- LICENSE +1/−1
- README.md +1/−1
- parsley-garnish.cabal +2/−2
- src/Parsley/OverloadedQuotesPlugin.hs +1/−1
- src/Parsley/OverloadedQuotesPlugin/Plugin.hs +17/−5
- src/Parsley/PluginUtils.hs +15/−4
ChangeLog.md view
@@ -3,3 +3,7 @@ ## 0.1.0.0 -- 2021-06-10 * First version. Released on an unsuspecting world.++## 0.1.0.1 -- 2021-06-11++* Support for GHC 9.0 in place.
LICENSE view
@@ -13,7 +13,7 @@ disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Jamie Willis, Matthew Pickering, nor the names of other+ * Neither the name of Jamie Willis nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.
README.md view
@@ -1,4 +1,4 @@-# Parsley Garnish+# Parsley Garnish  [](https://github.com/j-mie6/parsley-garnish/blob/master/LICENSE)  [](https://hackage.haskell.org/package/parsley-garnish)  This repo houses the `parsley`-specific GHC plugins to help make writing parsers with `parsley` take less boilerplate.
parsley-garnish.cabal view
@@ -1,5 +1,5 @@ name: parsley-garnish-version: 0.1.0.0+version: 0.1.0.1 synopsis: A collection of GHC plugins to work with parsley description: This package contains a collection (for now one) to help remove boilerplate when writing parsers using @parsley@.@@ -39,7 +39,7 @@ parsley >= 0.1 && < 0.2, template-haskell >= 2.14 && < 3, ghc-tcplugins-extra >= 0.3 && < 0.5,- ghc >= 8.6 && < 9,+ ghc >= 8.6 && < 9.2, syb >= 0.7 && < 0.8 hs-source-dirs: src
src/Parsley/OverloadedQuotesPlugin.hs view
@@ -19,7 +19,7 @@ > -- goes to: > qsucc qx = makeQ (_val qx + 1) [||$$(_code qx) + 1||] -Values of @Parsley.Defunctionalized.Defunc@ can also be spliced in directly:+Values of `Parsley.Defunctionalized.Defunc` can also be spliced in directly: > diffcons :: Defunc a -> Defunc ([a] -> [a]) -> Defunc ([a] -> [a]) > diffcons qx qdxs = [| $(COMPOSE) ($(CONS) $(qx)) $(qdxs) |]
src/Parsley/OverloadedQuotesPlugin/Plugin.hs view
@@ -9,14 +9,28 @@ {-# LANGUAGE RankNTypes #-} module Parsley.OverloadedQuotesPlugin.Plugin (plugin) where -import Plugins (Plugin (..), defaultPlugin, purePlugin)-import TcRnTypes (TcGblEnv, TcM) import Data.Generics (GenericT, GenericQ, mkT, mkQ, everywhere, gmapT) import GHC.Generics (Generic) +import Parsley.PluginUtils (lookupModuleInPackage, lookupName, lookupNames)++#if __GLASGOW_HASKELL__ >= 900+import GHC.Driver.Plugins (Plugin (..), defaultPlugin, purePlugin)+import GHC.Tc.Types (TcM, TcGblEnv)++ import qualified GHC (HsGroup, GhcRn, Name, GenLocated(L), SrcSpan)+import qualified GHC.Plugins as GHC (CommandLineOption)+import qualified GHC.Tc.Utils.Monad as GHC (getTopEnv)+#else+import Plugins (Plugin (..), defaultPlugin, purePlugin)+import TcRnTypes (TcGblEnv, TcM)+++import qualified GHC (HsGroup, GhcRn, Name, GenLocated(L), SrcSpan) import qualified GhcPlugins as GHC (CommandLineOption) import qualified TcRnMonad as GHC (getTopEnv)+#endif #if __GLASGOW_HASKELL__ < 810 import qualified HsExpr as Expr@@ -24,8 +38,6 @@ import qualified GHC.Hs.Expr as Expr #endif -import Parsley.PluginUtils (lookupModuleInPackage, lookupName, lookupNames)- #if __GLASGOW_HASKELL__ >= 810 import GHC.Hs.Extension noExt :: NoExtField@@ -38,7 +50,7 @@ {-| This plugin repurposes /Untyped/ Template Haskell quotes (and splices within them)-to be @Parsley.Quapplicative@ values.+to be `Parsley.Quapplicative` values. -} plugin :: Plugin plugin = defaultPlugin { renamedResultAction = overloadedQuotes, pluginRecompile = purePlugin }
src/Parsley/PluginUtils.hs view
@@ -1,19 +1,30 @@-{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, CPP #-} module Parsley.PluginUtils where import qualified GHC.TcPluginM.Extra as TCPluginExtra (lookupName) --- GHC API+-- ghc+#if __GLASGOW_HASKELL__ >= 900+import GHC.Tc.Types (TcM, TcPluginM)+import GHC.Utils.Outputable+import qualified GHC.Plugins as GHC+import qualified GHC.Iface.Env as GHC (lookupOrig)+import GHC.Driver.Finder (findImportedModule, FindResult(Found))+import GHC.Data.FastString (mkFastString)+import GHC.Unit.Module (Module)+import GHC.Unit.Module.Name (mkModuleName)+import GHC (Name)+#else import TcRnTypes (TcM, TcPluginM) import Outputable---- ghc import qualified GhcPlugins as GHC import qualified IfaceEnv as GHC (lookupOrig) import Finder (findImportedModule, FindResult(Found)) import FastString (mkFastString) import Module (Module, mkModuleName) import Name (Name)+#endif+ import Control.Monad.IO.Class ( liftIO ) class Monad m => Lookup m where