toml-parser-1.1.1.0: TOML 1.0.0 parser
Copyright(c) Eric Mertens 2023
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Toml.Parser

Contents

Description

This module parses TOML tokens into a list of raw, uninterpreted sections and assignments.

Synopsis

Types

data Expr Source #

Headers and assignments corresponding to lines of a TOML file

Constructors

KeyValExpr Key Val

key value assignment: key = value

TableExpr Key

table: [key]

ArrayTableExpr Key

array of tables: [[key]]

Instances

Instances details
Read Expr Source # 
Instance details

Defined in Toml.Parser.Types

Show Expr Source # 
Instance details

Defined in Toml.Parser.Types

Methods

showsPrec :: Int -> Expr -> ShowS #

show :: Expr -> String #

showList :: [Expr] -> ShowS #

data SectionKind Source #

Kinds of table headers.

Constructors

TableKind
table
ArrayTableKind
[array of tables
]

data Val Source #

Unvalidated TOML values. Table are represented as a list of assignments rather than as resolved maps.

Instances

Instances details
Read Val Source # 
Instance details

Defined in Toml.Parser.Types

Show Val Source # 
Instance details

Defined in Toml.Parser.Types

Methods

showsPrec :: Int -> Val -> ShowS #

show :: Val -> String #

showList :: [Val] -> ShowS #

type Key = NonEmpty (Located String) Source #

Non-empty sequence of dotted simple keys

Parser

parseRawToml :: [Located Token] -> Either (Located Token) [Expr] Source #

Parse a list of tokens either returning the first unexpected token or a list of the TOML statements in the file to be processed by Toml.Semantics.