| Copyright | (c) Eric Mertens 2023 |
|---|---|
| License | ISC |
| Maintainer | emertens@gmail.com |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Toml.Syntax.Parser
Description
This module parses TOML tokens into a list of raw, uninterpreted sections and assignments.
Synopsis
- data Expr a
- = KeyValExpr (Key a) (Val a)
- | TableExpr (Key a)
- | ArrayTableExpr (Key a)
- data SectionKind
- data Val a
- type Key a = NonEmpty (a, Text)
- parseRawToml :: Text -> Either (Located String) [Expr Position]
Types
Headers and assignments corresponding to lines of a TOML file
Constructors
| KeyValExpr (Key a) (Val a) | key value assignment: |
| TableExpr (Key a) | table: |
| ArrayTableExpr (Key a) | array of tables: |
data SectionKind Source #
Kinds of table headers
Constructors
| TableKind |
|
| ArrayTableKind |
|
Instances
| Read SectionKind Source # | |
Defined in Toml.Syntax.Types Methods readsPrec :: Int -> ReadS SectionKind # readList :: ReadS [SectionKind] # readPrec :: ReadPrec SectionKind # readListPrec :: ReadPrec [SectionKind] # | |
| Show SectionKind Source # | |
Defined in Toml.Syntax.Types Methods showsPrec :: Int -> SectionKind -> ShowS # show :: SectionKind -> String # showList :: [SectionKind] -> ShowS # | |
| Eq SectionKind Source # | |
Defined in Toml.Syntax.Types | |
Unvalidated TOML values. Table are represented as a list of assignments rather than as resolved maps.
Constructors
| ValInteger a Integer | |
| ValFloat a Double | |
| ValArray a [Val a] | |
| ValTable a [(Key a, Val a)] | |
| ValBool a Bool | |
| ValString a Text | |
| ValTimeOfDay a TimeOfDay | |
| ValZonedTime a ZonedTime | |
| ValLocalTime a LocalTime | |
| ValDay a Day |
Parser
parseRawToml :: Text -> Either (Located String) [Expr Position] 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.