language-bash-0.2.0: Parsing and pretty-printing Bash shell scripts

Safe HaskellSafe-Inferred
LanguageHaskell98

Language.Bash.Parse.Builder

Contents

Description

Builder-based parsing. This is useful for parsing Bash's complicated words.

Synopsis

Builders

type Builder = Endo String Source

An efficient String builder.

fromChar :: Char -> Builder Source

Construct a Builder from a Char.

fromString :: String -> Builder Source

Construct a Builder from a String.

Monoid parsing

(<+>) :: (Applicative f, Monoid a) => f a -> f a -> f a infixr 4 Source

Append two monoidal results.

many :: (Alternative f, Monoid a) => f a -> f a Source

Concat zero or more monoidal results.

many1 :: (Alternative f, Monoid a) => f a -> f a Source

Concat one or more monoidal results.

Characters

oneOf :: Stream s m Char => [Char] -> ParsecT s u m Builder Source

Builder version of oneOf.

noneOf :: Stream s m Char => [Char] -> ParsecT s u m Builder Source

Builder version of noneOf.

char :: Stream s m Char => Char -> ParsecT s u m Builder Source

Builder version of char.

anyChar :: Stream s m Char => ParsecT s u m Builder Source

Builder version of anyChar.

satisfy :: Stream s m Char => (Char -> Bool) -> ParsecT s u m Builder Source

Builder version of satisfy.

string :: Stream s m Char => String -> ParsecT s u m Builder Source

Builder version of string.

Spans

span :: Stream s m Char => Char -> Char -> ParsecT s u m Builder -> ParsecT s u m Builder Source

span start end escape parses a span of text starting with start and ending with end, with possible escape sequences inside.

matchedPair :: Stream s m Char => Char -> Char -> ParsecT s u m Builder -> ParsecT s u m Builder Source

matchedPair start end escape parses span start end escape, including the surrounding start and end characters.