flatparse 0.5.4.4 → 0.5.5.0
raw patch · 2 files changed
+7/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ FlatParse.Minimal: getPos :: Parser Pos
Files
- flatparse.cabal +1/−1
- src/FlatParse/Minimal.hs +6/−0
flatparse.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: flatparse-version: 0.5.4.4+version: 0.5.5.0 synopsis: High-performance parsing from strict bytestrings description: @Flatparse@ is a high-performance parsing library for strict bytestring input. See the README for more information: <https://github.com/AndrasKovacs/flatparse>.
src/FlatParse/Minimal.hs view
@@ -210,6 +210,12 @@ embedMinimal = \(Parser f) -> FPB.ParserT \_ eob s st -> case f eob s st of (# !a, s, st #) -> FPB.OK# st a s +-- | Get the current position.+getPos :: Parser Pos+getPos = Parser \eob s st ->+ let pos = Pos (I# (minusAddr# eob s))+ in (# pos, s, st #)+ {-# inline spanOf #-} -- | Return the consumed span of a parser. spanOf :: Parser a -> Parser Span