attoparsec-0.5.1: Combinator parsing with Data.ByteString.Lazy

Portabilityunknown
Stabilityexperimental
Maintainerbos@serpentine.com

Data.ParserCombinators.Attoparsec.Internal

Contents

Description

Simple, efficient parser combinators for lazy ByteString strings, loosely based on Text.ParserCombinators.Parsec.

Synopsis

Parser

Running parsers

Combinators

(<?>) :: Parser a -> String -> Parser aSource

Name the parser.

Things vaguely like those in Parsec.Combinator (and Parsec.Prim)

eof :: Parser ()Source

Detect 'end of file'.

skipMany :: Parser a -> Parser ()Source

skipMany - skip zero or many instances of the parser

skipMany1 :: Parser a -> Parser ()Source

skipMany1 - skip one or many instances of the parser

count :: Int -> Parser a -> Parser [a]Source

Apply the given parser repeatedly, returning every parse result.

sepBy :: Parser a -> Parser s -> Parser [a]Source

sepBy1 :: Parser a -> Parser s -> Parser [a]Source

Things like in Parsec.Char

satisfy :: (Word8 -> Bool) -> Parser Word8Source

Character parser.

word8 :: Word8 -> Parser Word8Source

Satisfy a specific character.

notWord8 :: Word8 -> Parser Word8Source

Satisfy a specific character.

string :: ByteString -> Parser ByteStringSource

Satisfy a literal string.

stringTransform :: (ByteString -> ByteString) -> ByteString -> Parser ByteStringSource

Satisfy a literal string, after applying a transformation to both it and the matching text.

Parser converters.

Miscellaneous functions.

getInput :: Parser ByteStringSource

Get remaining input.

getConsumed :: Parser Int64Source

Get number of bytes consumed so far.

takeWhile :: (Word8 -> Bool) -> Parser ByteStringSource

Consume characters while the predicate is true.

skipWhile :: (Word8 -> Bool) -> Parser ()Source

Skip over characters while the predicate is true.

notEmpty :: Parser ByteString -> Parser ByteStringSource

Test that a parser returned a non-null ByteString.

match :: Parser a -> Parser ByteStringSource

Parse some input with the given parser and return that input without copying it.