htoml-0.1.0.1: A parser for TOML files.

Safe HaskellNone
LanguageHaskell2010

Text.Toml.Parser

Contents

Synopsis

Documentation

parseOnly :: Parser a -> Text -> Either ParseError a Source

Convenience function for the test suite and GHCI.

tomlDoc :: Parser Table Source

Parses a complete document formatted according to the TOML spec.

table :: Parser Table Source

Parses a table of key-value pairs.

namedSection :: Parser ([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 :: Parser [Text] Source

Parses a table header.

tableArrayHeader :: Parser [Text] Source

Parses a table array header.

headerValue :: Parser [Text] Source

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

assignment :: Parser (Text, TValue) Source

Parses a key-value assignment.

value :: Parser TValue Source

Parses a value.

array :: Parser TValue Source

  • Toml value parsers

float :: Parser TValue Source

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

Utility functions

arrayOf :: Parser TValue -> Parser TValue Source

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

escSeq :: Parser Char Source

Parser for escape sequences.

unicodeHex :: Int -> Parser Char Source

Parser for unicode hexadecimal values of representation length n.

signed :: Num a => Parser a -> Parser a Source

Parser for signs (a plus or a minus).

skipBlanks :: Parser () 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.

eol :: Parser () Source

Parse an EOL, as per TOML spec this is 0x0A a.k.a. '\n' or 0x0D a.k.a. '\r'.