| License | BSD3 | 
|---|---|
| Maintainer | cabal-devel@haskell.org | 
| Portability | portable | 
| Safe Haskell | Safe-Inferred | 
| Language | Haskell2010 | 
Distribution.Fields.LexerMonad
Description
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 ()
 - addWarningAt :: Position -> LexWarningType -> Lex ()
 - toPWarnings :: [LexWarning] -> [PWarning]
 
Documentation
type InputStream = ByteString Source #
Constructors
| LexState | |
Fields 
  | |
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 #
Constructors
| LexWarning !LexWarningType !Position | 
Instances
| Show LexWarning Source # | |
Defined in Distribution.Fields.LexerMonad Methods showsPrec :: Int -> LexWarning -> ShowS # show :: LexWarning -> String # showList :: [LexWarning] -> ShowS #  | |
data LexWarningType Source #
Constructors
| LexWarningNBSP | Encountered non breaking space  | 
| LexWarningBOM | BOM at the start of the cabal file  | 
| LexWarningTab | Leading tags  | 
Instances
| Show LexWarningType Source # | |
Defined in Distribution.Fields.LexerMonad Methods showsPrec :: Int -> LexWarningType -> ShowS # show :: LexWarningType -> String # showList :: [LexWarningType] -> ShowS #  | |
| Eq LexWarningType Source # | |
Defined in Distribution.Fields.LexerMonad Methods (==) :: LexWarningType -> LexWarningType -> Bool # (/=) :: LexWarningType -> LexWarningType -> Bool #  | |
| Ord LexWarningType Source # | |
Defined in Distribution.Fields.LexerMonad Methods compare :: LexWarningType -> LexWarningType -> Ordering # (<) :: LexWarningType -> LexWarningType -> Bool # (<=) :: LexWarningType -> LexWarningType -> Bool # (>) :: LexWarningType -> LexWarningType -> Bool # (>=) :: LexWarningType -> LexWarningType -> Bool # max :: LexWarningType -> LexWarningType -> LexWarningType # min :: LexWarningType -> LexWarningType -> LexWarningType #  | |
addWarning :: LexWarningType -> Lex () Source #
Add warning at the current position
addWarningAt :: Position -> LexWarningType -> Lex () Source #
Add warning at specific position
toPWarnings :: [LexWarning] -> [PWarning] Source #