htoml-megaparsec-1.0.1.2: Parser for TOML files

Safe HaskellNone
LanguageHaskell2010

Text.Toml.Parser

Contents

Synopsis

Documentation

parseOnly :: Parser Toml a -> Text -> Either TomlError a Source #

Convenience function for the test suite and GHCI.

tomlDoc :: TomlM m => Parser m Table Source #

Parses a complete document formatted according to the TOML spec.

table :: TomlM m => Parser m Table Source #

Parses a table of key-value pairs.

inlineTable :: TomlM m => Parser m Node Source #

Parses an inline table of key-value pairs.

maybeDupe :: Ord a => [a] -> Maybe a Source #

Find dupes, if any.

namedSection :: TomlM m => Parser m ([Text], Node) Source #

Parses a Table or TableArray with its header. The resulting tuple has the header's value in the first position, and the NTable or NTArray in the second.

tableHeader :: TomlM m => Parser m [Text] Source #

Parses a table header.

tableArrayHeader :: TomlM m => Parser m [Text] Source #

Parses a table array header.

headerValue :: TomlM m => Parser m [Text] Source #

Parses the value of any header (names separated by dots), into a list of Text.

assignment :: TomlM m => Parser m (Text, Node) Source #

Parses a key-value assignment.

value :: TomlM m => Parser m Node Source #

Parses a value.

array :: TomlM m => Parser m Node Source #

  • Toml value parsers

float :: TomlM m => Parser m Node Source #

Attoparsec double parses scientific "e" notation; reimplement according to Toml spec.

Utility functions

arrayOf :: TomlM m => Parser m Node -> Parser m Node Source #

Parses the elements of an array, while restricting them to a certain type.

escSeq :: TomlM m => Parser m Char Source #

Parser for escape sequences.

unicodeHex :: TomlM m => Int -> Parser m Char Source #

Parser for unicode hexadecimal values of representation length n.

signed :: (Num a, TomlM m) => Parser m a -> Parser m a Source #

Parser for signs (a plus or a minus).

skipBlanks :: TomlM m => Parser m () Source #

Parses the (rest of the) line including an EOF, whitespace and comments.

isSpc :: Char -> Bool Source #

Results in True for whitespace chars, tab or space, according to spec.