happy-meta 0.2.0.11 → 0.2.1.0
raw patch · 4 files changed
+18/−16 lines, 4 filesdep ~template-haskellPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: template-haskell
API changes (from Hackage documentation)
Files
- changelog.md +3/−3
- happy-meta.cabal +10/−8
- src/Grammar.lhs +1/−0
- src/ParamRules.hs +4/−5
changelog.md view
@@ -1,5 +1,5 @@-# CHANGELOG for happy-meta+# Changelog -## v0.2.0.11+## v0.2.1.0 -- Bump template-haskell version+- Compatibility with `mtl-2.3`
happy-meta.cabal view
@@ -1,17 +1,18 @@+Cabal-version: 1.18 Name: happy-meta-Version: 0.2.0.11+Version: 0.2.1.0 Synopsis: Quasi-quoter for Happy parsers -- Description: License: BSD3 License-file: LICENSE Author: Jonas Duregard-Maintainer: artem.pelenitsyn@gmail.com+Maintainer: Artem Pelenitsyn (a.pelenitsyn@gmail.com)+Homepage: https://github.com/ulysses4ever/BNFC-meta Category: Development Build-type: Simple Description: A Template-Haskell based version of the Happy parser generator. Used to generate parsers for BNFC-meta, currently this is the only use known to be working. -Cabal-version: >=1.10-Extra-Source-Files: changelog.md+Extra-Doc-Files: changelog.md Library@@ -23,11 +24,11 @@ Text.Happy.Quote Build-depends:- template-haskell >=2.4&&<2.17- , haskell-src-meta >=0.5.1.2&&<1.0+ template-haskell >=2.4 && <3+ , haskell-src-meta >=0.5.1.2 && <1.0 , base >= 4.2 && < 5 , array, containers- , fail >=4.9.0.0&&<5+ , fail >=4.9.0.0 && <5 , mtl >= 1.0 Build-tools: happy@@ -53,4 +54,5 @@ source-repository head type: git- location: http://github.com/ulysses4ever/happy-meta.git+ location: http://github.com/ulysses4ever/BNFC-meta+ subdir: happy-meta
src/Grammar.lhs view
@@ -41,6 +41,7 @@ > import Data.Maybe (fromMaybe) +> import Control.Monad (when) > import Control.Monad.Writer
src/ParamRules.hs view
@@ -2,8 +2,7 @@ import AbsSyn import Control.Monad.Writer-import Control.Monad.Error-import Control.Monad.Instances() -- mtl is broken, so we use Either monad+import Control.Monad.Except import Data.List(partition,intersperse) import qualified Data.Set as S import qualified Data.Map as M -- XXX: Make it work with old GHC.@@ -28,7 +27,7 @@ -- | A renaming substitution used when we instantiate a parameterized rule. type Subst = [(RuleName,RuleName)] type M1 = Writer (S.Set Inst)-type M2 = ErrorT String M1+type M2 = ExceptT String M1 -- | Collects the instances arising from a term. from_term :: Subst -> Term -> M1 RuleName@@ -69,8 +68,8 @@ Just r -> inst_rule r xs Nothing -> throwError ("Undefined rule: " ++ f) -runM2 :: ErrorT e (Writer w) a -> Either e (a, w)-runM2 m = case runWriter (runErrorT m) of+runM2 :: ExceptT e (Writer w) a -> Either e (a, w)+runM2 m = case runWriter (runExceptT m) of (Left e,_) -> Left e (Right a,xs) -> Right (a,xs)