Distribution.Fields.Lexer

Cabal-3.4.0.0: A framework for packaging Haskell software

License | BSD3
Maintainer | cabal-devel@haskell.org
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.Fields.Lexer

Description

Lexer for the cabal files.

Synopsis

- ltest :: Int -> String -> IO ()
- lexToken :: Lex LToken
- data Token
  - = TokSym !ByteString
  - | TokStr !ByteString
  - | TokOther !ByteString
  - | Indent !Int
  - | TokFieldLine !ByteString
  - | Colon
  - | OpenBrace
  - | CloseBrace
  - | EOF
  - | LexicalError InputStream
- data LToken = L !Position !Token
- bol_section :: Int
- in_section :: Int
- in_field_layout :: Int
- in_field_braces :: Int
- mkLexState :: ByteString -> LexState

# Documentation

ltest :: Int -> String -> IO () Source #

lexToken :: Lex LToken Source #

data Token Source #

Tokens of outer cabal file structure. Field values are treated opaquely.

Constructors

TokSym !ByteString | Haskell-like identifier, number or operator
TokStr !ByteString | String in quotes
TokOther !ByteString | Operators and parens
Indent !Int | Indentation token
TokFieldLine !ByteString | Lines after `:`
Colon |
OpenBrace |
CloseBrace |
EOF |
LexicalError InputStream |

#### Instances

Instances details

Show Token # |
Instance details Defined in Distribution.Fields.Lexer Methods showsPrec :: Int -> Token -> ShowS Source # show :: Token -> String Source # showList :: [Token] -> ShowS Source #

data LToken Source #

Constructors

L !Position !Token |

#### Instances

Instances details

Show LToken # |
Instance details Defined in Distribution.Fields.Lexer Methods showsPrec :: Int -> LToken -> ShowS Source # show :: LToken -> String Source # showList :: [LToken] -> ShowS Source #

bol_section :: Int Source #

in_section :: Int Source #

in_field_layout :: Int Source #

in_field_braces :: Int Source #

mkLexState :: ByteString -> LexState Source #