| Copyright | (c) Eric Mertens 2023 |
|---|---|
| License | ISC |
| Maintainer | emertens@gmail.com |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Toml.Lexer.Utils
Description
This module provides a custom engine for the Alex generated lexer. This lexer drive provides nested states, unicode support, and file location tracking.
Synopsis
- type Action = Located String -> State [Context] [Located Token]
- data Context
- value :: (String -> Token) -> Action
- value_ :: Token -> Action
- token :: (String -> Token) -> Action
- token_ :: Token -> Action
- squareO :: Action
- squareC :: Action
- curlyO :: Action
- curlyC :: Action
- equals :: Action
- timeValue :: ParseTime a => String -> [String] -> (a -> Token) -> Action
- strFrag :: Action
- startMlStr :: Action
- startStr :: Action
- endStr :: Action
- unicodeEscape :: Action
- eofToken :: [Context] -> Located String -> Located Token
- type AlexInput = Located String
- alexGetByte :: AlexInput -> Maybe (Int, AlexInput)
Types
Constructors
| ListContext Position | processing an inline list, lex values |
| TableContext Position | processing an inline table, don't lex values |
| ValueContext | processing after an equals, lex one value |
| MlStrContext Position [String] | |
| StrContext Position [String] |
Actions
startMlStr :: Action Source #