megaparsec 7.0.2 → 7.0.3
raw patch · 5 files changed
+12/−20 lines, 5 filesdep ~mtl
Dependency ranges changed: mtl
Files
- CHANGELOG.md +4/−0
- Text/Megaparsec.hs +1/−2
- Text/Megaparsec/Class.hs +5/−0
- megaparsec.cabal +1/−1
- tests/Text/Megaparsec/CharSpec.hs +1/−17
CHANGELOG.md view
@@ -1,3 +1,7 @@+## Megaparsec 7.0.3++* Fixed the build with `mtl` older than `2.2.2`.+ ## Megaparsec 7.0.2 * Fixed the property test for `char'` which was failing in the case when
Text/Megaparsec.hs view
@@ -98,7 +98,6 @@ , setParserState ) where -import Control.Monad import Control.Monad.Combinators import Control.Monad.Identity import Data.List.NonEmpty (NonEmpty (..))@@ -237,7 +236,7 @@ -> String -- ^ Name of source file -> s -- ^ Input for parser -> m (Either (ParseErrorBundle s e) a)-runParserT p name s = snd `liftM` runParserT' p (initialState name s)+runParserT p name s = snd <$> runParserT' p (initialState name s) -- | This function is similar to 'runParserT', but like 'runParser'' it -- accepts and returns parser state. This is thus the most general way to
Text/Megaparsec/Class.hs view
@@ -14,6 +14,7 @@ -- -- @since 6.5.0 +{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-}@@ -38,6 +39,10 @@ import qualified Control.Monad.Trans.State.Strict as S import qualified Control.Monad.Trans.Writer.Lazy as L import qualified Control.Monad.Trans.Writer.Strict as S++#if !MIN_VERSION_mtl(2,2,2)+import Control.Monad.Trans.Identity+#endif -- | Type class describing monads that implement the full set of primitive -- parsers.
megaparsec.cabal view
@@ -1,5 +1,5 @@ name: megaparsec-version: 7.0.2+version: 7.0.3 cabal-version: 1.18 tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.4, GHC==8.6.1 license: BSD2
tests/Text/Megaparsec/CharSpec.hs view
@@ -201,9 +201,6 @@ prs (char ch) "" `shouldFailWith` err 0 (ueof <> etok ch) describe "char'" $ do- -- a character with different lower, upper and title cases ('dz',- -- 'Dz' and 'DZ' respectively)- let distinctTitleCase = 'dz' context "when stream begins with the character specified as argument" $ do it "parses the character" $ property $ \ch s -> do@@ -223,12 +220,6 @@ s' = '\9412' : s prs (char' ch) s' `shouldParse` '\9412' prs' (char' ch) s' `succeedsLeaving` s- context "when character has different lower, upper and title cases" $- it "parses the character in lower, upper or title case" $ do- let p = prs (char' distinctTitleCase)- p [distinctTitleCase] `shouldParse` distinctTitleCase- p [toUpper distinctTitleCase] `shouldParse` toUpper distinctTitleCase- p [toTitle distinctTitleCase] `shouldParse` toTitle distinctTitleCase context "when stream does not begin with the character specified as argument" $ do it "signals correct parse error" $ property $ \ch ch' s -> not (casei ch ch') ==> do@@ -242,19 +233,12 @@ let ms = utok ch <> etok '\9438' <> etok '\9412' s' = ch : s prs (char' '\9438') s' `shouldFailWith` err 0 ms- context "when stream is empty" $ do+ context "when stream is empty" $ it "signals correct parse error" $ property $ \ch -> do let options = etok <$> [toLower ch, toTitle ch, toUpper ch] ms = ueof <> mconcat (nub options) prs (char' ch) "" `shouldFailWith` err 0 ms- context "when character has different lower, upper and title cases" $- it "signals correct parse error" $ do- let ms = mconcat [ ueof- , etok distinctTitleCase- , etok $ toUpper distinctTitleCase- , etok $ toTitle distinctTitleCase ]- prs (char' distinctTitleCase) "" `shouldFailWith` err 0 ms describe "string" $ do context "when stream is prefixed with given string" $