module Toml.Parser.Types (
Key,
Expr(..),
Val(..),
SectionKind(..),
) where
import Data.List.NonEmpty (NonEmpty)
import Data.Time (Day, LocalTime, TimeOfDay, ZonedTime)
import Toml.Located (Located)
type Key = NonEmpty (Located String)
data Expr
= KeyValExpr Key Val
| TableExpr Key
| ArrayTableExpr Key
deriving (ReadPrec [Expr]
ReadPrec Expr
Int -> ReadS Expr
ReadS [Expr]
(Int -> ReadS Expr)
-> ReadS [Expr] -> ReadPrec Expr -> ReadPrec [Expr] -> Read Expr
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Expr
readsPrec :: Int -> ReadS Expr
$creadList :: ReadS [Expr]
readList :: ReadS [Expr]
$creadPrec :: ReadPrec Expr
readPrec :: ReadPrec Expr
$creadListPrec :: ReadPrec [Expr]
readListPrec :: ReadPrec [Expr]
Read, Int -> Expr -> ShowS
[Expr] -> ShowS
Expr -> String
(Int -> Expr -> ShowS)
-> (Expr -> String) -> ([Expr] -> ShowS) -> Show Expr
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Expr -> ShowS
showsPrec :: Int -> Expr -> ShowS
$cshow :: Expr -> String
show :: Expr -> String
$cshowList :: [Expr] -> ShowS
showList :: [Expr] -> ShowS
Show)
data Val
= ValInteger Integer
| ValFloat Double
| ValArray [Val]
| ValTable [(Key, Val)]
| ValBool Bool
| ValString String
| ValTimeOfDay TimeOfDay
| ValZonedTime ZonedTime
| ValLocalTime LocalTime
| ValDay Day
deriving (ReadPrec [Val]
ReadPrec Val
Int -> ReadS Val
ReadS [Val]
(Int -> ReadS Val)
-> ReadS [Val] -> ReadPrec Val -> ReadPrec [Val] -> Read Val
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Val
readsPrec :: Int -> ReadS Val
$creadList :: ReadS [Val]
readList :: ReadS [Val]
$creadPrec :: ReadPrec Val
readPrec :: ReadPrec Val
$creadListPrec :: ReadPrec [Val]
readListPrec :: ReadPrec [Val]
Read, Int -> Val -> ShowS
[Val] -> ShowS
Val -> String
(Int -> Val -> ShowS)
-> (Val -> String) -> ([Val] -> ShowS) -> Show Val
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Val -> ShowS
showsPrec :: Int -> Val -> ShowS
$cshow :: Val -> String
show :: Val -> String
$cshowList :: [Val] -> ShowS
showList :: [Val] -> ShowS
Show)
data SectionKind
= TableKind
| ArrayTableKind
deriving (ReadPrec [SectionKind]
ReadPrec SectionKind
Int -> ReadS SectionKind
ReadS [SectionKind]
(Int -> ReadS SectionKind)
-> ReadS [SectionKind]
-> ReadPrec SectionKind
-> ReadPrec [SectionKind]
-> Read SectionKind
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS SectionKind
readsPrec :: Int -> ReadS SectionKind
$creadList :: ReadS [SectionKind]
readList :: ReadS [SectionKind]
$creadPrec :: ReadPrec SectionKind
readPrec :: ReadPrec SectionKind
$creadListPrec :: ReadPrec [SectionKind]
readListPrec :: ReadPrec [SectionKind]
Read, Int -> SectionKind -> ShowS
[SectionKind] -> ShowS
SectionKind -> String
(Int -> SectionKind -> ShowS)
-> (SectionKind -> String)
-> ([SectionKind] -> ShowS)
-> Show SectionKind
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SectionKind -> ShowS
showsPrec :: Int -> SectionKind -> ShowS
$cshow :: SectionKind -> String
show :: SectionKind -> String
$cshowList :: [SectionKind] -> ShowS
showList :: [SectionKind] -> ShowS
Show, SectionKind -> SectionKind -> Bool
(SectionKind -> SectionKind -> Bool)
-> (SectionKind -> SectionKind -> Bool) -> Eq SectionKind
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SectionKind -> SectionKind -> Bool
== :: SectionKind -> SectionKind -> Bool
$c/= :: SectionKind -> SectionKind -> Bool
/= :: SectionKind -> SectionKind -> Bool
Eq)