morte 1.4.1 → 1.4.2
raw patch · 2 files changed
+7/−14 lines, 2 filesdep ~microlensPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: microlens
API changes (from Hackage documentation)
- Morte.Parser: instance Control.Monad.Trans.Error.Error Morte.Parser.ParseError
Files
- morte.cabal +2/−2
- src/Morte/Parser.hs +5/−12
morte.cabal view
@@ -1,5 +1,5 @@ Name: morte-Version: 1.4.1+Version: 1.4.2 Cabal-Version: >=1.8.0.2 Build-Type: Simple Tested-With: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2@@ -43,7 +43,7 @@ Earley >= 0.10.1.0 && < 0.11 , http-client >= 0.4.0 && < 0.5 , http-client-tls >= 0.2.0 && < 0.3 ,- microlens >= 0.2.0.0 && < 0.4 ,+ microlens >= 0.2.0.0 && < 0.5 , microlens-mtl >= 0.1.3.1 && < 0.2 , managed >= 1.0.0 && < 1.1 , pipes >= 4.0.0 && < 4.2 ,
src/Morte/Parser.hs view
@@ -13,8 +13,8 @@ import Control.Applicative hiding (Const) import Control.Exception (Exception)-import Control.Monad.Trans.Class (lift)-import Control.Monad.Trans.Error (Error(..), throwError, runErrorT)+import Control.Monad.Trans.Class (lift)+import Control.Monad.Trans.Except (Except, throwE, runExceptT) import Control.Monad.Trans.State.Strict (evalState, get) import Data.Monoid import Data.Text.Buildable (Buildable(..))@@ -169,16 +169,9 @@ <> "\n" <> "Error: Parsing failed\n" -{- This is purely to satisfy the unnecessary `Error` constraint for `ErrorT`-- I will switch to `ExceptT` when the Haskell Platform incorporates- `transformers-0.4.*`.--}-instance Error ParseError where- -- | Parse an `Expr` from `Text` or return a `ParseError` if parsing fails exprFromText :: Text -> Either ParseError (Expr Path)-exprFromText text = evalState (runErrorT m) (Lexer.P 1 0)+exprFromText text = evalState (runExceptT m) (Lexer.P 1 0) where m = do (locatedTokens, mtxt) <- lift (Pipes.toListM' (Lexer.lexExpr text))@@ -186,7 +179,7 @@ Nothing -> return () Just txt -> do pos <- lift get- throwError (ParseError pos (Lexing txt))+ throwE (ParseError pos (Lexing txt)) let (parses, Report _ needed found) = fullParses (parser expr) locatedTokens case parses of@@ -195,4 +188,4 @@ let LocatedToken t pos = case found of lt:_ -> lt _ -> LocatedToken Lexer.EOF (P 0 0)- throwError (ParseError pos (Parsing t needed))+ throwE (ParseError pos (Parsing t needed))