git.iko.soy/typeable/attoparsec
on master help sign in
Move code around.
b80a721Bryan O'Sullivan
ByteStringParser.hs → src/Text/ParserCombinators/ByteStringParser.hsrenamed+2−3
@@ -14,7 +14,6 @@
14module Text.ParserCombinators.ByteStringParser where
14module Text.ParserCombinators.ByteStringParser where
15
15
16import Data.Char
16import Data.Char
17−import Data.Word
18import Control.Monad
17import Control.Monad
19import qualified Data.ByteString.Lazy.Char8 as C
18import qualified Data.ByteString.Lazy.Char8 as C
20
19
@@ -190,7 +189,7 @@ skipMany1 p = p >> skipMany p
190notEmpty :: Parser C.ByteString C.ByteString -> Parser C.ByteString C.ByteString
189notEmpty :: Parser C.ByteString C.ByteString -> Parser C.ByteString C.ByteString
191notEmpty (Parser p) =
190notEmpty (Parser p) =
192 Parser $ \s -> case p s of
191 Parser $ \s -> case p s of
193− o@(Right (a, s_)) ->
192+ o@(Right (a, _)) ->
194 if C.null a
193 if C.null a
195 then Left (a, ["notEmpty"])
194 then Left (a, ["notEmpty"])
196 else o
195 else o
@@ -222,7 +221,7 @@ parse p s =
222 showError [msg] = "Parser error, expected:\n" ++ msg ++ "\n"
221 showError [msg] = "Parser error, expected:\n" ++ msg ++ "\n"
223 showError msgs = "Parser error, expected one of:\n" ++ unlines msgs
222 showError msgs = "Parser error, expected one of:\n" ++ unlines msgs
224
223
225−parseTest :: Parser st a -> st -> IO ()
224+parseTest :: (Show st, Show a) => Parser st a -> st -> IO ()
226
225
227parseTest p s =
226parseTest p s =
228 case parse p s of
227 case parse p s of