tomland-1.3.3.3: Bidirectional TOML serialization
Copyright(c) 2018-2022 Kowainik
LicenseMPL-2.0
MaintainerKowainik <xrom.xkov@gmail.com>
StabilityStable
PortabilityPortable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Toml.Parser.Item

Description

This module contains the definition of the TomlItem data type which represents either key-value pair or table name. This data type serves the purpose to be the intermediate representation of parsing a TOML file which will be assembled to TOML AST later.

Since: 1.2.0.0

Synopsis

Documentation

data TomlItem Source #

One item of a TOML file. It could be either:

  • A name of a table
  • A name of a table array
  • Key-value pair
  • Inline table
  • Inline array of tables

Knowing a list of TomlItems, it's possible to construct TOML from this information.

Instances

Instances details
Show TomlItem Source # 
Instance details

Defined in Toml.Parser.Item

Eq TomlItem Source # 
Instance details

Defined in Toml.Parser.Item

newtype Table Source #

Table that contains only key = val pairs.

Constructors

Table 

Fields

Instances

Instances details
Show Table Source # 
Instance details

Defined in Toml.Parser.Item

Methods

showsPrec :: Int -> Table -> ShowS #

show :: Table -> String #

showList :: [Table] -> ShowS #

Eq Table Source # 
Instance details

Defined in Toml.Parser.Item

Methods

(==) :: Table -> Table -> Bool #

(/=) :: Table -> Table -> Bool #

setTableName :: Key -> TomlItem -> TomlItem Source #

Changes name of table to a new one. Works only for TableName and TableArrayName constructors.

tomlP :: Parser [TomlItem] Source #

Parser for the full content of the .toml file.

keyValP :: Parser TomlItem Source #

parser for "key = val" pairs; can be one of three forms:

  1. key = { ... }
  2. key = [ {...}, {...}, ... ]
  3. key = ...