Copyright | Copyright (C) 2008 John MacFarlane |
---|---|
License | GNU GPL, version 2 or above |
Maintainer | John MacFarlane <jgm@berkeley.edu> |
Stability | alpha |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
Text.Highlighting.Kate.Types
Description
Definitions for data structures needed by highlighting-kate.
Synopsis
- type Context = (String, String)
- type ContextStack = [Context]
- data SyntaxState = SyntaxState {
- synStContexts :: ContextStack
- synStLineNumber :: Int
- synStPrevChar :: Char
- synStPrevNonspace :: Bool
- synStContinuation :: Bool
- synStCaseSensitive :: Bool
- synStKeywordCaseSensitive :: Bool
- synStCaptures :: [String]
- defaultSyntaxState :: SyntaxState
- type Token = (TokenType, String)
- data TokenType
- = KeywordTok
- | DataTypeTok
- | DecValTok
- | BaseNTok
- | FloatTok
- | ConstantTok
- | CharTok
- | SpecialCharTok
- | StringTok
- | VerbatimStringTok
- | SpecialStringTok
- | ImportTok
- | CommentTok
- | DocumentationTok
- | AnnotationTok
- | CommentVarTok
- | OtherTok
- | FunctionTok
- | VariableTok
- | ControlFlowTok
- | OperatorTok
- | BuiltInTok
- | ExtensionTok
- | PreprocessorTok
- | AttributeTok
- | RegionMarkerTok
- | InformationTok
- | WarningTok
- | AlertTok
- | ErrorTok
- | NormalTok
- type SourceLine = [Token]
- type KateParser = GenParser Char SyntaxState
- data TokenStyle = TokenStyle {
- tokenColor :: Maybe Color
- tokenBackground :: Maybe Color
- tokenBold :: Bool
- tokenItalic :: Bool
- tokenUnderline :: Bool
- defStyle :: TokenStyle
- data Color = RGB Word8 Word8 Word8
- class ToColor a where
- class FromColor a where
- data Style = Style {
- tokenStyles :: [(TokenType, TokenStyle)]
- defaultColor :: Maybe Color
- backgroundColor :: Maybe Color
- lineNumberColor :: Maybe Color
- lineNumberBackgroundColor :: Maybe Color
- data FormatOptions = FormatOptions {
- numberLines :: Bool
- startNumber :: Int
- lineAnchors :: Bool
- titleAttributes :: Bool
- codeClasses :: [String]
- containerClasses :: [String]
- defaultFormatOpts :: FormatOptions
Documentation
type ContextStack = [Context] Source #
A stack of contexts. (Language-specific context stacks must be maintained because of IncludeRules.)
data SyntaxState Source #
State for syntax parser.
Constructors
SyntaxState | |
Fields
|
Instances
Show SyntaxState Source # | |
Defined in Text.Highlighting.Kate.Types Methods showsPrec :: Int -> SyntaxState -> ShowS show :: SyntaxState -> String showList :: [SyntaxState] -> ShowS |
Constructors
Instances
Enum TokenType Source # | |
Defined in Text.Highlighting.Kate.Types | |
Eq TokenType Source # | |
Data TokenType Source # | |
Defined in Text.Highlighting.Kate.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TokenType -> c TokenType gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TokenType toConstr :: TokenType -> Constr dataTypeOf :: TokenType -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TokenType) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TokenType) gmapT :: (forall b. Data b => b -> b) -> TokenType -> TokenType gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TokenType -> r gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TokenType -> r gmapQ :: (forall d. Data d => d -> u) -> TokenType -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> TokenType -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> TokenType -> m TokenType gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TokenType -> m TokenType gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TokenType -> m TokenType | |
Read TokenType Source # | |
Defined in Text.Highlighting.Kate.Types | |
Show TokenType Source # | |
type SourceLine = [Token] Source #
A line of source, list of labeled source items.
type KateParser = GenParser Char SyntaxState Source #
data TokenStyle Source #
Constructors
TokenStyle | |
Fields
|
Instances
Data TokenStyle Source # | |
Defined in Text.Highlighting.Kate.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TokenStyle -> c TokenStyle gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TokenStyle toConstr :: TokenStyle -> Constr dataTypeOf :: TokenStyle -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TokenStyle) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TokenStyle) gmapT :: (forall b. Data b => b -> b) -> TokenStyle -> TokenStyle gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TokenStyle -> r gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TokenStyle -> r gmapQ :: (forall d. Data d => d -> u) -> TokenStyle -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> TokenStyle -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> TokenStyle -> m TokenStyle gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TokenStyle -> m TokenStyle gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TokenStyle -> m TokenStyle | |
Read TokenStyle Source # | |
Defined in Text.Highlighting.Kate.Types Methods readsPrec :: Int -> ReadS TokenStyle readList :: ReadS [TokenStyle] readPrec :: ReadPrec TokenStyle readListPrec :: ReadPrec [TokenStyle] | |
Show TokenStyle Source # | |
Defined in Text.Highlighting.Kate.Types Methods showsPrec :: Int -> TokenStyle -> ShowS show :: TokenStyle -> String showList :: [TokenStyle] -> ShowS |
Constructors
RGB Word8 Word8 Word8 |
Instances
Data Color Source # | |
Defined in Text.Highlighting.Kate.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Color -> c Color gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Color dataTypeOf :: Color -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Color) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Color) gmapT :: (forall b. Data b => b -> b) -> Color -> Color gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Color -> r gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Color -> r gmapQ :: (forall d. Data d => d -> u) -> Color -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> Color -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> Color -> m Color gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Color -> m Color gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Color -> m Color | |
Read Color Source # | |
Defined in Text.Highlighting.Kate.Types | |
Show Color Source # | |
class ToColor a where Source #
Instances
ToColor Int Source # | |
Defined in Text.Highlighting.Kate.Types | |
ToColor String Source # | |
Defined in Text.Highlighting.Kate.Types | |
ToColor (Double, Double, Double) Source # | |
Defined in Text.Highlighting.Kate.Types | |
ToColor (Word8, Word8, Word8) Source # | |
Defined in Text.Highlighting.Kate.Types |
class FromColor a where Source #
Instances
FromColor String Source # | |
Defined in Text.Highlighting.Kate.Types | |
FromColor (Double, Double, Double) Source # | |
Defined in Text.Highlighting.Kate.Types | |
FromColor (Word8, Word8, Word8) Source # | |
Defined in Text.Highlighting.Kate.Types |
Constructors
Style | |
Fields
|
Instances
Data Style Source # | |
Defined in Text.Highlighting.Kate.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Style -> c Style gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Style dataTypeOf :: Style -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Style) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Style) gmapT :: (forall b. Data b => b -> b) -> Style -> Style gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Style -> r gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Style -> r gmapQ :: (forall d. Data d => d -> u) -> Style -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> Style -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> Style -> m Style gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Style -> m Style gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Style -> m Style | |
Read Style Source # | |
Defined in Text.Highlighting.Kate.Types | |
Show Style Source # | |
data FormatOptions Source #
Options for formatting source code.
Constructors
FormatOptions | |
Fields
|
Instances
Eq FormatOptions Source # | |
Defined in Text.Highlighting.Kate.Types | |
Read FormatOptions Source # | |
Defined in Text.Highlighting.Kate.Types Methods readsPrec :: Int -> ReadS FormatOptions readList :: ReadS [FormatOptions] readPrec :: ReadPrec FormatOptions readListPrec :: ReadPrec [FormatOptions] | |
Show FormatOptions Source # | |
Defined in Text.Highlighting.Kate.Types Methods showsPrec :: Int -> FormatOptions -> ShowS show :: FormatOptions -> String showList :: [FormatOptions] -> ShowS |