flatparse 0.5.0.0 → 0.5.0.1
raw patch · 5 files changed
+22/−2 lines, 5 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ FlatParse.Basic: withError :: ParserT st e b -> (e -> ParserT st e b) -> ParserT st e b
+ FlatParse.Basic.Base: withError :: ParserT st e b -> (e -> ParserT st e b) -> ParserT st e b
+ FlatParse.Stateful: withError :: ParserT st r e b -> (e -> ParserT st r e b) -> ParserT st r e b
+ FlatParse.Stateful.Base: withError :: ParserT st r e b -> (e -> ParserT st r e b) -> ParserT st r e b
Files
- flatparse.cabal +2/−2
- src/FlatParse/Basic.hs +1/−0
- src/FlatParse/Basic/Base.hs +9/−0
- src/FlatParse/Stateful.hs +1/−0
- src/FlatParse/Stateful/Base.hs +9/−0
flatparse.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.1.+-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack name: flatparse-version: 0.5.0.0+version: 0.5.0.1 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/Basic.hs view
@@ -88,6 +88,7 @@ , FP.Base.failed , FP.Base.try , FP.Base.err+ , FP.Base.withError , FP.Base.fails , FP.Base.cut , FP.Base.cutting
src/FlatParse/Basic/Base.hs view
@@ -40,6 +40,7 @@ , failed , try , err+ , withError , fails , cut , cutting@@ -70,6 +71,14 @@ err :: e -> ParserT st e a err e = ParserT \_fp _eob _s st -> Err# st e {-# inline err #-}++-- | Run the parser, if an error is thrown, handle it with the given function.+withError :: ParserT st e b -> (e -> ParserT st e b) -> ParserT st e b+withError (ParserT f) hdl = ParserT $ \fp eob s st -> case f fp eob s st of+ Err# st' e -> case hdl e of+ ParserT g -> g fp eob s st'+ x -> x+{-# inline withError #-} -- | Convert a parsing error into failure. try :: ParserT st e a -> ParserT st e a
src/FlatParse/Stateful.hs view
@@ -97,6 +97,7 @@ , FP.Base.failed , FP.Base.try , FP.Base.err+ , FP.Base.withError , FP.Base.fails , FP.Base.cut , FP.Base.cutting
src/FlatParse/Stateful/Base.hs view
@@ -40,6 +40,7 @@ , failed , try , err+ , withError , fails , cut , cutting@@ -70,6 +71,14 @@ err :: e -> ParserT st r e a err e = ParserT \_fp !_r _eob _s _n st -> Err# st e {-# inline err #-}++-- | Run the parser, if an error is thrown, handle it with the given function.+withError :: ParserT st r e b -> (e -> ParserT st r e b) -> ParserT st r e b+withError (ParserT f) hdl = ParserT $ \fp !r eob s n st -> case f fp r eob s n st of+ Err# st' e -> case hdl e of+ ParserT g -> g fp r eob s n st'+ x -> x+{-# inline withError #-} -- | Convert a parsing error into failure. try :: ParserT st r e a -> ParserT st r e a