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
- data LexWarningType
- addWarning :: LexWarningType -> Lex ()
- toPWarnings :: [LexWarning] -> [PWarning]
Documentation
type InputStream = ByteString #
LexState | |
|
execLexer :: Lex a -> InputStream -> ([LexWarning], a) #
Execute the given lexer on the supplied input stream.
getInput :: Lex InputStream #
setInput :: InputStream -> Lex () #
getStartCode :: Lex Int #
setStartCode :: Int -> Lex () #
data LexWarning #
Instances
Show LexWarning # | |
Defined in Distribution.Fields.LexerMonad showsPrec :: Int -> LexWarning -> ShowS # show :: LexWarning -> String # showList :: [LexWarning] -> ShowS # |
data LexWarningType #
LexWarningNBSP | Encountered non breaking space |
LexWarningBOM | BOM at the start of the cabal file |
LexWarningTab | Leading tags |
Instances
Eq LexWarningType # | |
Defined in Distribution.Fields.LexerMonad (==) :: LexWarningType -> LexWarningType -> Bool # (/=) :: LexWarningType -> LexWarningType -> Bool # | |
Ord LexWarningType # | |
Defined in Distribution.Fields.LexerMonad compare :: LexWarningType -> LexWarningType -> Ordering # (<) :: LexWarningType -> LexWarningType -> Bool # (<=) :: LexWarningType -> LexWarningType -> Bool # (>) :: LexWarningType -> LexWarningType -> Bool # (>=) :: LexWarningType -> LexWarningType -> Bool # max :: LexWarningType -> LexWarningType -> LexWarningType # min :: LexWarningType -> LexWarningType -> LexWarningType # | |
Show LexWarningType # | |
Defined in Distribution.Fields.LexerMonad showsPrec :: Int -> LexWarningType -> ShowS # show :: LexWarningType -> String # showList :: [LexWarningType] -> ShowS # |
addWarning :: LexWarningType -> Lex () #
Add warning at the current position
toPWarnings :: [LexWarning] -> [PWarning] #