Copyright | (c) Eric Mertens 2017 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | Safe |
Language | Haskell2010 |
This module provides the token type used in the lexer and parser and provides the extra pass to insert layout tokens.
- data Token
- = StringToken Text
- | BareKeyToken Text
- | IntegerToken Integer
- | DoubleToken Double
- | ZonedTimeToken ZonedTime
- | LocalTimeToken LocalTime
- | TimeOfDayToken TimeOfDay
- | DayToken Day
- | CommaToken
- | PeriodToken
- | LeftBracketToken
- | RightBracketToken
- | LeftBraceToken
- | RightBraceToken
- | EqualToken
- | TrueToken
- | FalseToken
- | ErrorToken LexerError
- | EofToken
- data LexerError
Documentation
The token type used by Config.Lexer and Config.Parser
StringToken Text | string literal |
BareKeyToken Text | bare table key |
IntegerToken Integer | integer literal |
DoubleToken Double | floating -point literal |
ZonedTimeToken ZonedTime | offset date-time |
LocalTimeToken LocalTime | local date-time |
TimeOfDayToken TimeOfDay | local time |
DayToken Day | local date |
CommaToken | , |
PeriodToken | . |
LeftBracketToken | [ |
RightBracketToken | [ |
LeftBraceToken | { |
RightBraceToken | } |
EqualToken | = |
TrueToken | true |
FalseToken | false |
ErrorToken LexerError | lexical error |
EofToken | end-of-file |
data LexerError Source #
Errors possible in the course of lexing
UntermString | unterminated string literal |
BadEscape | invalid escape sequence |
NoMatch Char | no matching lexer rule |