Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Renamed failing to failed for lens 3.10 compatibility. Version 1.1

Conflicts:

	src/Text/Trifecta/Parser.hs
	trifecta.cabal
  • Loading branch information...
commit 4efbeaa7f2cf2e42033b4f5162c73b98fb11541e 1 parent afe03e8
@ekmett authored
View
8 src/Text/Trifecta/Parser.hs
@@ -114,7 +114,7 @@ instance Monad Parser where
{-# INLINE (>>=) #-}
(>>) = (*>)
{-# INLINE (>>) #-}
- fail s = Parser $ \ _ ee _ _ _ _ -> ee (failing s)
+ fail s = Parser $ \ _ ee _ _ _ _ -> ee (failed s)
{-# INLINE fail #-}
instance MonadPlus Parser where
@@ -126,7 +126,7 @@ instance MonadPlus Parser where
manyAccum :: (a -> [a] -> [a]) -> Parser a -> Parser [a]
manyAccum f (Parser p) = Parser $ \eo _ co ce d bs ->
let walk xs x es d' bs' = p (manyErr d' bs') (\e -> co (f x xs) (_expected e <> es) d' bs') (walk (f x xs)) ce d' bs'
- manyErr d' bs' _ e = ce $ explain (renderingCaret d' bs') (e <> failing "'many' applied to a parser that accepted an empty string")
+ manyErr d' bs' _ e = ce $ explain (renderingCaret d' bs') (e <> failed "'many' applied to a parser that accepted an empty string")
in p (manyErr d bs) (eo []) (walk []) ce d bs
liftIt :: It Rope a -> Parser a
@@ -144,7 +144,7 @@ instance Parsing Parser where
{-# INLINE (<?>) #-}
skipMany p = () <$ manyAccum (\_ _ -> []) p
{-# INLINE skipMany #-}
- unexpected s = Parser $ \ _ ee _ _ _ _ -> ee $ failing $ "unexpected " ++ s
+ unexpected s = Parser $ \ _ ee _ _ _ _ -> ee $ failed $ "unexpected " ++ s
{-# INLINE unexpected #-}
eof = notFollowedBy anyChar <?> "end of input"
{-# INLINE eof #-}
@@ -156,7 +156,7 @@ instance LookAheadParsing Parser where
instance CharParsing Parser where
satisfy f = Parser $ \ _ ee co _ d bs ->
case UTF8.uncons $ Strict.drop (fromIntegral (columnByte d)) bs of
- Nothing -> ee (failing "unexpected EOF")
+ Nothing -> ee (failed "unexpected EOF")
Just (c, xs)
| not (f c) -> ee mempty
| Strict.null xs -> let !ddc = d <> delta c
View
8 src/Text/Trifecta/Result.hs
@@ -31,7 +31,7 @@ module Text.Trifecta.Result
-- * Parsing Errors
, Err(..), HasErr(..)
, explain
- , failing
+ , failed
) where
import Control.Applicative as Alternative
@@ -69,9 +69,9 @@ instance Monoid Err where
{-# INLINE mappend #-}
-- | Generate a simple 'Err' word-wrapping the supplied message.
-failing :: String -> Err
-failing m = Err (Just (fillSep (pretty <$> words m))) [] mempty
-{-# INLINE failing #-}
+failed :: String -> Err
+failed m = Err (Just (fillSep (pretty <$> words m))) [] mempty
+{-# INLINE failed #-}
-- | Convert a location and an 'Err' into a 'Doc'
explain :: Rendering -> Err -> Doc
View
2  trifecta.cabal
@@ -1,6 +1,6 @@
name: trifecta
category: Text, Parsing, Diagnostics, Pretty Printer, Logging
-version: 1.0
+version: 1.1
license: BSD3
cabal-version: >= 1.10
license-file: LICENSE
Please sign in to comment.
Something went wrong with that request. Please try again.