megaparsec 9.2.1 → 9.2.2
raw patch · 9 files changed
+44/−10 lines, 9 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +6/−0
- Text/Megaparsec/Byte.hs +1/−0
- Text/Megaparsec/Byte/Lexer.hs +9/−0
- Text/Megaparsec/Char.hs +1/−0
- Text/Megaparsec/Char/Lexer.hs +9/−0
- Text/Megaparsec/Error.hs +10/−3
- Text/Megaparsec/Internal.hs +1/−0
- Text/Megaparsec/Stream.hs +1/−1
- megaparsec.cabal +6/−6
CHANGELOG.md view
@@ -1,5 +1,11 @@ *Megaparsec follows [SemVer](https://semver.org/).* +## Megaparsec 9.2.2++* Fixed a space leak in the implementations of the `reachOffset` and+ `reachOffsetNoLine` methods of `TraversableStream`. [Issue+ 486](https://github.com/mrkkrp/megaparsec/issues/486).+ ## Megaparsec 9.2.1 * Builds with `mtl-2.3` and `transformers-0.6`.
Text/Megaparsec/Byte.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} -- | -- Module : Text.Megaparsec.Byte
Text/Megaparsec/Byte/Lexer.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} -- | -- Module : Text.Megaparsec.Byte.Lexer@@ -105,6 +106,8 @@ -- of integer literals described in the Haskell report. -- -- If you need to parse signed integers, see the 'signed' combinator.+--+-- __Warning__: this function does not perform range checks. decimal :: forall e s m a. (MonadParsec e s m, Token s ~ Word8, Num a) =>@@ -130,6 +133,8 @@ -- -- > binary = char 48 >> char' 98 >> L.binary --+-- __Warning__: this function does not perform range checks.+-- -- @since 7.0.0 binary :: forall e s m a.@@ -154,6 +159,8 @@ -- For example you can make it conform to the Haskell report like this: -- -- > octal = char 48 >> char' 111 >> L.octal+--+-- __Warning__: this function does not perform range checks. octal :: forall e s m a. (MonadParsec e s m, Token s ~ Word8, Num a) =>@@ -177,6 +184,8 @@ -- For example you can make it conform to the Haskell report like this: -- -- > hexadecimal = char 48 >> char' 120 >> L.hexadecimal+--+-- __Warning__: this function does not perform range checks. hexadecimal :: forall e s m a. (MonadParsec e s m, Token s ~ Word8, Num a) =>
Text/Megaparsec/Char.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} -- | -- Module : Text.Megaparsec.Char
Text/Megaparsec/Char/Lexer.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} -- | -- Module : Text.Megaparsec.Char.Lexer@@ -359,6 +360,8 @@ -- -- __Note__: before the version /6.0.0/ the function returned 'Integer', -- i.e. it wasn't polymorphic in its return type.+--+-- __Warning__: this function does not perform range checks. decimal :: (MonadParsec e s m, Token s ~ Char, Num a) => m a decimal = decimal_ <?> "integer" {-# INLINEABLE decimal #-}@@ -381,6 +384,8 @@ -- -- > binary = char '0' >> char' 'b' >> L.binary --+-- __Warning__: this function does not perform range checks.+-- -- @since 7.0.0 binary :: forall e s m a.@@ -408,6 +413,8 @@ -- -- __Note__: before version /6.0.0/ the function returned 'Integer', i.e. it -- wasn't polymorphic in its return type.+--+-- __Warning__: this function does not perform range checks. octal :: forall e s m a. (MonadParsec e s m, Token s ~ Char, Num a) =>@@ -433,6 +440,8 @@ -- -- __Note__: before version /6.0.0/ the function returned 'Integer', i.e. it -- wasn't polymorphic in its return type.+--+-- __Warning__: this function does not perform range checks. hexadecimal :: forall e s m a. (MonadParsec e s m, Token s ~ Char, Num a) =>
Text/Megaparsec/Error.hs view
@@ -375,7 +375,9 @@ (msline, pst') = reachOffset (errorOffset e) pst epos = pstateSourcePos pst' outChunk =- "\n" <> sourcePosPretty epos <> ":\n"+ "\n"+ <> sourcePosPretty epos+ <> ":\n" <> offendingLine <> parseErrorTextPretty e offendingLine =@@ -395,7 +397,11 @@ padding = replicate (length lineNumber + 1) ' ' rpshift = unPos (sourceColumn epos) - 1 slineLen = length sline- in padding <> "|\n" <> lineNumber <> " | " <> sline+ in padding+ <> "|\n"+ <> lineNumber+ <> " | "+ <> sline <> "\n" <> padding <> "| "@@ -469,7 +475,8 @@ showErrorFancy = \case ErrorFail msg -> msg ErrorIndentation ord ref actual ->- "incorrect indentation (got " <> show (unPos actual)+ "incorrect indentation (got "+ <> show (unPos actual) <> ", should be " <> p <> show (unPos ref)
Text/Megaparsec/Internal.hs view
@@ -6,6 +6,7 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- |
Text/Megaparsec/Stream.hs view
@@ -355,7 +355,7 @@ -- | An internal helper state type combining a difference 'String' and an -- unboxed 'SourcePos'.-data St = St SourcePos ShowS+data St = St {-# UNPACK #-} !SourcePos ShowS -- | A helper definition to facilitate defining 'reachOffset' for various -- stream types.
megaparsec.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: megaparsec-version: 9.2.1+version: 9.2.2 license: BSD-2-Clause license-file: LICENSE.md maintainer: Mark Karpov <markkarpov92@gmail.com>@@ -9,7 +9,7 @@ Paolo Martini <paolo@nemail.it>, Daan Leijen <daan@microsoft.com> -tested-with: ghc ==8.10.7 ghc ==9.0.2 ghc ==9.2.1+tested-with: ghc ==9.0.2 ghc ==9.2.4 ghc ==9.4.1 homepage: https://github.com/mrkkrp/megaparsec bug-reports: https://github.com/mrkkrp/megaparsec/issues synopsis: Monadic parser combinators@@ -56,7 +56,7 @@ default-language: Haskell2010 build-depends:- base >=4.13 && <5.0,+ base >=4.15 && <5.0, bytestring >=0.2 && <0.12, case-insensitive >=1.2 && <1.3, containers >=0.5 && <0.7,@@ -84,10 +84,10 @@ hs-source-dirs: bench/speed default-language: Haskell2010 build-depends:- base >=4.13 && <5.0,+ base >=4.15 && <5.0, bytestring >=0.2 && <0.12, containers >=0.5 && <0.7,- criterion >=0.6.2.1 && <1.6,+ criterion >=0.6.2.1 && <1.7, deepseq >=1.3 && <1.5, megaparsec, text >=0.2 && <2.1@@ -104,7 +104,7 @@ hs-source-dirs: bench/memory default-language: Haskell2010 build-depends:- base >=4.13 && <5.0,+ base >=4.15 && <5.0, bytestring >=0.2 && <0.12, containers >=0.5 && <0.7, deepseq >=1.3 && <1.5,