License | BSD3 |
---|---|
Maintainer | cabal-devel@haskell.org |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- type InputStream = ByteString
- data LexState = LexState {
- curPos :: !Position
- curInput :: !InputStream
- curCode :: !StartCode
- warnings :: [LexWarning]
- data LexResult a = LexResult !LexState a
- newtype Lex a = Lex {}
- execLexer :: Lex a -> InputStream -> ([LexWarning], a)
- getPos :: Lex Position
- setPos :: Position -> Lex ()
- adjustPos :: (Position -> Position) -> Lex ()
- getInput :: Lex InputStream
- setInput :: InputStream -> Lex ()
- getStartCode :: Lex Int
- setStartCode :: Int -> Lex ()
- data LexWarning = LexWarning !LexWarningType !Position !String
- data LexWarningType
- addWarning :: LexWarningType -> String -> Lex ()
- toPWarning :: LexWarning -> PWarning
Documentation
type InputStream = ByteString Source #
LexState | |
|
execLexer :: Lex a -> InputStream -> ([LexWarning], a) Source #
Execute the given lexer on the supplied input stream.
setInput :: InputStream -> Lex () Source #
getStartCode :: Lex Int Source #
setStartCode :: Int -> Lex () Source #
data LexWarning Source #
Instances
Show LexWarning # | |
data LexWarningType Source #
LexWarningNBSP | Encountered non breaking space |
LexWarningBOM | BOM at the start of the cabal file |
Instances
Show LexWarningType # | |
addWarning :: LexWarningType -> String -> Lex () Source #
Add warning at the current position
toPWarning :: LexWarning -> PWarning Source #