uu-parsinglib 2.7.1.1 → 2.7.2
raw patch · 3 files changed
+11/−6 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Text.ParserCombinators.UU.MergeAndPermute: mkGram :: P t a -> Gram (P t) a
+ Text.ParserCombinators.UU.MergeAndPermute: mkGram :: Show a => P t a -> Gram (P t) a
Files
- src/Text/ParserCombinators/UU/CHANGELOG.hs +4/−0
- src/Text/ParserCombinators/UU/MergeAndPermute.hs +6/−5
- uu-parsinglib.cabal +1/−1
src/Text/ParserCombinators/UU/CHANGELOG.hs view
@@ -1,5 +1,9 @@ -- | This module just contains the CHANGELOG --+-- Version 2.7.2+--+-- fixed a subtle bug in the merging parsers caused by name shielding ;-{{+-- -- Version 2.7.1.1 -- -- added @pDoubleStr@ to the export list of the Utils module
src/Text/ParserCombinators/UU/MergeAndPermute.hs view
@@ -6,6 +6,7 @@ module Text.ParserCombinators.UU.MergeAndPermute where import Text.ParserCombinators.UU.Core+import Debug.Trace infixl 4 <||>, <<||> @@ -28,10 +29,10 @@ -- Here we use the functions `getOneP` and `getZeroP` which are provided in the uu-parsinglib package, -- but they could easily be provided by other packages too. -mkGram :: P t a -> Gram (P t) a+mkGram :: Show a => P t a -> Gram (P t) a mkGram p = case getOneP p of- Just p -> Gram [p `Seq` Gram [] (Just id)] (getZeroP p)- Nothing -> Gram [] (getZeroP p)+ Just q -> Gram [q `Seq` Gram [] (Just id)] (getZeroP p)+ Nothing -> Gram [] (getZeroP p) -- * Class instances for Gram -- | We define instances for the data type `Gram` for `Functor`, `Applicative`, `Alternative` and `ExtAlternative`@@ -101,8 +102,8 @@ -- | 'mkParserM' converts a `Gram`mar back into a parser, which can subsequenly be run. mkParserM :: (Monad f, Applicative f, ExtAlternative f) => Gram f a -> f a mkParserM (Gram ls le) = foldr (\ p pp -> doNotInterpret p <|> pp) (maybe empty pure le) (map mkParserAlt ls)- where mkParserAlt (p `Seq` pp) = p <**> mkParserM pp- mkParserAlt (fc `Bind` c2fa) = fc >>= (mkParserM . c2fa)+ where mkParserAlt (p `Seq` pp ) = p <**> mkParserM pp+ mkParserAlt (fc `Bind` c2fa) = fc >>= (mkParserM . c2fa) -- | `mkParserS` is like `mkParserM`, with the additional feature that we allow separators between the components. Only useful in the permuting case.
uu-parsinglib.cabal view
@@ -1,5 +1,5 @@ Name: uu-parsinglib-Version: 2.7.1.1+Version: 2.7.2 Build-Type: Simple License: MIT Copyright: S Doaitse Swierstra