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.
Moduletoml-parser-2.0.0.0Haskell2010
Toml.Syntax
These are the low-level processing functions for transforming concrete TOML syntax into abstract TOML syntax. This module does not do any semantic validation of the parsed TOML.
- 7 types
- 3 values
- Packagetoml-parser-2.0.0.0
- Exports10
- LanguageHaskell2010
- LicenceISC
- SourceSyntax.hs
Parsing
4 declarationsNon-empty sequence of dotted simple keys
Headers and assignments corresponding to lines of a TOML file
Constructors
KeyValExpr (Key a) (Val a)key value assignment:
key = valueTableExpr (Key a)table:
[key]ArrayTableExpr (Key a)array of tables:
[[key]]
Unvalidated TOML values. Table are represented as a list of assignments rather than as resolved maps.
Lexing
3 declarationsGet the next token from a located string or a located error message.
Representation of the current lexer state.
Constructors
TopContexttop-level where
[[and]]have special meaningTableContextinline table - lex key names
ValueContextvalue lexer - lex number literals
MlBstrContext Position [Text]multiline basic string: position of opening delimiter and list of fragments
BstrContext Position [Text]basic string: position of opening delimiter and list of fragments
MlLstrContext Position [Text]multiline literal string: position of opening delimiter and list of fragments
LstrContext Position [Text]literal string: position of opening delimiter and list of fragments
Lexical token
Constructors
TokTruetrueTokFalsefalseTokComma','TokEquals=TokNewlineend-of-lineTokPeriodTokSquareO'['TokSquareC']'Tok2SquareO'[['Tok2SquareC']]'TokCurlyO'{'TokCurlyC'}'TokBareKey Textbare key
TokString Textstring literal
TokMlString Textmultiline string literal
TokInteger !Integerinteger literal
TokFloat !Doublefloating-point literal
TokOffsetDateTime !ZonedTimedate-time with timezone offset
TokLocalDateTime !LocalTimelocal date-time
TokLocalDate !Daylocal date
TokLocalTime !TimeOfDaylocal time
TokEOFend-of-input
Locations
3 declarationsA value annotated with its text file position
Constructors
LocatedlocPosition :: !Positionposition
locThing :: !athing at position
Instances5Functor, Foldable, Traversable, Read, Show
Functor LocatedDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Foldable LocatedDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Traversable LocatedDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Read a => Read (Located a)Defined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Show a => Show (Located a)Defined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
A position in a text file
Instances4Eq, Ord, Read, Show
Eq PositionDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Ord PositionDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Read PositionDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Show PositionDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
The initial Position for the start of a file