-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Collection of language-related Yi libraries. -- -- Collection of language-related Yi libraries: lexers, scanners… @package yi-language @version 0.2.1 -- | Colors and friends. module Yi.Style -- | Visual text attributes to be applied during layout. data Attributes Attributes :: !Color -> !Color -> !Bool -> !Bool -> !Bool -> !Bool -> Attributes [foreground] :: Attributes -> !Color [background] :: Attributes -> !Color -- | The text should be show as "active" or "selected". This can be -- implemented by reverse video on the terminal. [reverseAttr] :: Attributes -> !Bool [bold] :: Attributes -> !Bool [italic] :: Attributes -> !Bool [underline] :: Attributes -> !Bool emptyAttributes :: Attributes -- | The style is used to transform attributes by modifying one or more of -- the visual text attributes. type Style = Endo Attributes -- | The UI type data UIStyle UIStyle :: Attributes -> Style -> Attributes -> Style -> Style -> Attributes -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> Style -> UIStyle -- | ground attributes for the modeline [modelineAttributes] :: UIStyle -> Attributes -- | transformation of modeline in focus [modelineFocusStyle] :: UIStyle -> Style -- | ground attributes for the tabbar [tabBarAttributes] :: UIStyle -> Attributes -- | a tab that currently holds the focus [tabInFocusStyle] :: UIStyle -> Style -- | a tab that does not have the current focus [tabNotFocusedStyle] :: UIStyle -> Style -- | ground attributes for the main text views [baseAttributes] :: UIStyle -> Attributes -- | the selected portion [selectedStyle] :: UIStyle -> Style -- | empty file marker colours [eofStyle] :: UIStyle -> Style -- | indicates errors in text [errorStyle] :: UIStyle -> Style -- | search matchesparen matchesother hints [hintStyle] :: UIStyle -> Style -- | current search match [strongHintStyle] :: UIStyle -> Style -- | all comments [commentStyle] :: UIStyle -> Style -- | additional only for block comments [blockCommentStyle] :: UIStyle -> Style -- | applied to language keywords [keywordStyle] :: UIStyle -> Style -- | numbers [numberStyle] :: UIStyle -> Style -- | preprocessor directive (often in Haskell or C) [preprocessorStyle] :: UIStyle -> Style -- | constant strings [stringStyle] :: UIStyle -> Style -- | additional style for long strings [longStringStyle] :: UIStyle -> Style -- | type name (such as class in an OO language) [typeStyle] :: UIStyle -> Style -- | data constructor [dataConstructorStyle] :: UIStyle -> Style -- | style of import names [importStyle] :: UIStyle -> Style -- | builtin things, e.g. Array in JavaScript [builtinStyle] :: UIStyle -> Style -- | regular expressions [regexStyle] :: UIStyle -> Style -- | any standard variable (identifier) [variableStyle] :: UIStyle -> Style -- | infix operators [operatorStyle] :: UIStyle -> Style -- | Style of a quotation (e.g. in template haskell) [quoteStyle] :: UIStyle -> Style -- | stuff that's passed to the shell in a Makefile [makeFileAction] :: UIStyle -> Style -- | makefile rule headers [makeFileRuleHead] :: UIStyle -> Style -- | A StyleName determines what style to use, taking into account the set -- of rendering preferences given by a UIStyle. Typically, style -- names will be Style-valued field names of UIStyle. type StyleName = UIStyle -> Style -- | A style that sets the foreground. withFg :: Color -> Style -- | A style that sets the background. withBg :: Color -> Style -- | A style that sets the font to bold withBd :: Bool -> Style -- | A style that sets the style to italics withItlc :: Bool -> Style -- | A style that sets the style to underlined withUnderline :: Bool -> Style -- | A style that sets the style to underlined withReverse :: Bool -> Style -- | The identity transform. defaultStyle :: StyleName data Color RGB :: {-# UNPACK #-} !Word8 -> {-# UNPACK #-} !Word8 -> {-# UNPACK #-} !Word8 -> Color -- | The system-default color of the engine used. e.g. in Gtk this should -- pick whatever the user has chosen as default color (background or -- forground depending on usage) for the text. Default :: Color -- | Convert a color to its text specification, as to be accepted by -- XParseColor colorToText :: Color -> String black :: Color grey :: Color lightGrey :: Color darkred :: Color red :: Color darkgreen :: Color green :: Color brown :: Color yellow :: Color darkblue :: Color blue :: Color purple :: Color magenta :: Color darkcyan :: Color cyan :: Color white :: Color brightwhite :: Color instance GHC.Show.Show Yi.Style.Attributes instance GHC.Classes.Ord Yi.Style.Attributes instance GHC.Classes.Eq Yi.Style.Attributes instance GHC.Show.Show Yi.Style.Color instance GHC.Classes.Ord Yi.Style.Color instance GHC.Classes.Eq Yi.Style.Color module Yi.Style.Library type Theme = Proto UIStyle -- | Abstract theme that provides useful defaults. defaultTheme :: Theme -- | A Theme inspired by the darkblue colorscheme of Vim. darkBlueTheme :: Theme -- | Various utility functions and instances used throughout Yi. Some of -- the functions from the now-removed Yi.Prelude found a new home here. module Yi.Utils io :: MonadBase IO m => IO a -> m a fst3 :: (a, b, c) -> a snd3 :: (a, b, c) -> b trd3 :: (a, b, c) -> c class SemiNum absolute relative | absolute -> relative (+~) :: SemiNum absolute relative => absolute -> relative -> absolute (-~) :: SemiNum absolute relative => absolute -> relative -> absolute (~-) :: SemiNum absolute relative => absolute -> absolute -> relative -- | As nub, but with O(n*log(n)) behaviour. nubSet :: (Ord a) => [a] -> [a] -- | As Map.adjust, but the combining function is applied strictly. mapAdjust' :: (Ord k) => (a -> a) -> k -> Map k a -> Map k a -- | Generalisation of fromList to arbitrary foldables. mapFromFoldable :: (Foldable t, Ord k) => t (k, a) -> Map k a -- | Alternative to groupBy. -- --
-- groupBy' (\a b -> abs (a - b) <= 1) [1,2,3] = [[1,2,3]] ---- -- whereas -- --
-- groupBy (\a b -> abs (a - b) <= 1) [1,2,3] = [[1,2],[3]] ---- -- TODO: Check in ghc 6.12 release if groupBy == groupBy'. groupBy' :: (a -> a -> Bool) -> [a] -> [[a]] chain :: (a -> a -> Bool) -> [a] -> ([a], [a]) -- | Return the longest common prefix of a set of lists. -- --
-- P(xs) === all (isPrefixOf (commonPrefix xs)) xs -- length s > length (commonPrefix xs) --> not (all (isPrefixOf s) xs) --commonPrefix :: Eq a => [[a]] -> [a] -- | Finds the first element satisfying the predicate, and returns a zipper -- pointing at it. findPL :: (a -> Bool) -> [a] -> Maybe (PointedList a) -- | Given a function which moves the focus from index A to index B, return -- a function which swaps the elements at indexes A and B and then moves -- the focus. See Yi.Editor.swapWinWithFirstE for an example. swapFocus :: (PointedList a -> PointedList a) -> (PointedList a -> PointedList a) makeClassyWithSuffix :: String -> Name -> Q [Dec] addSuffix :: Name -> String -> [DefName] makeLensesWithSuffix :: String -> Name -> Q [Dec] instance (GHC.Classes.Eq k, Data.Hashable.Class.Hashable k, Data.Binary.Class.Binary k, Data.Binary.Class.Binary v) => Data.Binary.Class.Binary (Data.HashMap.Base.HashMap k v) -- | Basic types useful everywhere we play with buffers. module Yi.Buffer.Basic -- | Direction of movement inside a buffer data Direction Backward :: Direction Forward :: Direction reverseDir :: Direction -> Direction -- | reverse if Backward mayReverse :: Direction -> [a] -> [a] -- | direction is in the same style of maybe or -- either functions, It takes one argument per direction -- (backward, then forward) and a direction to select the output. directionElim :: Direction -> a -> a -> a -- | A mark in a buffer newtype Mark Mark :: Int -> Mark [markId] :: Mark -> Int -- | Reference to a buffer. newtype BufferRef BufferRef :: Int -> BufferRef -- | A point in a buffer newtype Point Point :: Int -> Point [fromPoint] :: Point -> Int -- | Size of a buffer region newtype Size Size :: Int -> Size [fromSize] :: Size -> Int -- | Window references newtype WindowRef WindowRef :: Int -> WindowRef [unWindowRef] :: WindowRef -> Int instance Data.Binary.Class.Binary Yi.Buffer.Basic.WindowRef instance GHC.Show.Show Yi.Buffer.Basic.WindowRef instance GHC.Enum.Enum Yi.Buffer.Basic.WindowRef instance GHC.Classes.Ord Yi.Buffer.Basic.WindowRef instance GHC.Classes.Eq Yi.Buffer.Basic.WindowRef instance Data.Binary.Class.Binary Yi.Buffer.Basic.Size instance GHC.Real.Integral Yi.Buffer.Basic.Size instance GHC.Real.Real Yi.Buffer.Basic.Size instance GHC.Enum.Enum Yi.Buffer.Basic.Size instance GHC.Num.Num Yi.Buffer.Basic.Size instance GHC.Classes.Ord Yi.Buffer.Basic.Size instance GHC.Classes.Eq Yi.Buffer.Basic.Size instance GHC.Show.Show Yi.Buffer.Basic.Size instance GHC.Real.Integral Yi.Buffer.Basic.Point instance GHC.Real.Real Yi.Buffer.Basic.Point instance GHC.Num.Num Yi.Buffer.Basic.Point instance GHC.Arr.Ix Yi.Buffer.Basic.Point instance Data.Binary.Class.Binary Yi.Buffer.Basic.Point instance GHC.Enum.Bounded Yi.Buffer.Basic.Point instance GHC.Enum.Enum Yi.Buffer.Basic.Point instance GHC.Classes.Ord Yi.Buffer.Basic.Point instance GHC.Classes.Eq Yi.Buffer.Basic.Point instance GHC.Num.Num Yi.Buffer.Basic.BufferRef instance Data.Binary.Class.Binary Yi.Buffer.Basic.BufferRef instance GHC.Classes.Ord Yi.Buffer.Basic.BufferRef instance GHC.Classes.Eq Yi.Buffer.Basic.BufferRef instance Data.Binary.Class.Binary Yi.Buffer.Basic.Mark instance GHC.Show.Show Yi.Buffer.Basic.Mark instance GHC.Classes.Ord Yi.Buffer.Basic.Mark instance GHC.Classes.Eq Yi.Buffer.Basic.Mark instance GHC.Generics.Generic Yi.Buffer.Basic.Direction instance GHC.Enum.Enum Yi.Buffer.Basic.Direction instance GHC.Enum.Bounded Yi.Buffer.Basic.Direction instance GHC.Show.Show Yi.Buffer.Basic.Direction instance GHC.Classes.Ord Yi.Buffer.Basic.Direction instance GHC.Classes.Eq Yi.Buffer.Basic.Direction instance Data.Binary.Class.Binary Yi.Buffer.Basic.Direction instance GHC.Show.Show Yi.Buffer.Basic.BufferRef instance GHC.Show.Show Yi.Buffer.Basic.Point instance Yi.Utils.SemiNum Yi.Buffer.Basic.Point Yi.Buffer.Basic.Size instance Data.Default.Class.Default Yi.Buffer.Basic.WindowRef module Yi.Regex data SearchOption -- | Compile for matching that ignores char case IgnoreCase :: SearchOption -- | Compile for newline-insensitive matching NoNewLine :: SearchOption -- | Treat the input not as a regex but as a literal string to search for. QuoteRegex :: SearchOption makeSearchOptsM :: [SearchOption] -> String -> Either String SearchExp data SearchExp SearchExp :: String -> Regex -> Regex -> [SearchOption] -> SearchExp [seInput] :: SearchExp -> String [seCompiled] :: SearchExp -> Regex [seBackCompiled] :: SearchExp -> Regex [seOptions] :: SearchExp -> [SearchOption] searchString :: SearchExp -> String searchRegex :: Direction -> SearchExp -> Regex emptySearch :: SearchExp -- | The regular expression that matches nothing. emptyRegex :: Regex -- | Return an escaped (for parseRegex use) version of the string. regexEscapeString :: String -> String instance GHC.Generics.Generic Yi.Regex.SearchOption instance GHC.Classes.Eq Yi.Regex.SearchOption instance Data.Binary.Class.Binary Yi.Regex.SearchOption instance Data.Binary.Class.Binary Yi.Regex.SearchExp instance Yi.Regex.Plated Text.Regex.TDFA.Pattern.Pattern -- | This module defines the Region ADT module Yi.Region -- | The region data type. The region is semi open: it includes the start -- but not the end bound. This allows simpler region-manipulation -- algorithms. Invariant : regionStart r <= regionEnd r data Region -- | The empty region emptyRegion :: Region regionIsEmpty :: Region -> Bool -- | Construct a region from its bounds, emacs style: the right bound is -- excluded mkRegion :: Point -> Point -> Region mkRegion' :: Direction -> Point -> Point -> Region mkSizeRegion :: Point -> Size -> Region regionStart :: Region -> Point regionEnd :: Region -> Point regionSize :: Region -> Size regionDirection :: Region -> Direction -- | True if the given point is inside the given region. inRegion :: Point -> Region -> Bool -- | True if the given point is inside the given region or at the end of -- it. nearRegion :: Point -> Region -> Bool -- | Returns if a region (1st arg) is included in another (2nd arg) includedRegion :: Region -> Region -> Bool fmapRegion :: (Point -> Point) -> Region -> Region -- | Take the intersection of two regions intersectRegion :: Region -> Region -> Region -- | Take the union of two regions (including what is between them) unionRegion :: Region -> Region -> Region regionFirst :: Region -> Point regionLast :: Region -> Point regionsOverlap :: Bool -> Region -> Region -> Bool instance GHC.Generics.Generic Yi.Region.Region instance Data.Binary.Class.Binary Yi.Region.Region instance GHC.Show.Show Yi.Region.Region -- | This module defines a common interface for syntax-awareness. -- -- There have been many tens of wasted hours in this and lexer modules. -- This note is to commemorate those who have fallen in battle. module Yi.Syntax -- | The main type of syntax highlighters. This record type combines all -- the required functions, and is parametrized on the type of the -- internal state. data Highlighter cache syntax SynHL :: cache -> (Scanner Point Char -> Point -> cache -> cache) -> (cache -> WindowRef -> syntax) -> (Map WindowRef Region -> cache -> cache) -> Highlighter cache syntax -- | The start state for the highlighter. [hlStartState] :: Highlighter cache syntax -> cache [hlRun] :: Highlighter cache syntax -> Scanner Point Char -> Point -> cache -> cache [hlGetTree] :: Highlighter cache syntax -> cache -> WindowRef -> syntax -- | focus at a given point, and return the coresponding node. (hint -- the -- root can always be returned, at the cost of performance.) [hlFocus] :: Highlighter cache syntax -> Map WindowRef Region -> cache -> cache data Cache state result data Scanner st a Scanner :: st -> (st -> Point) -> a -> (st -> [(st, a)]) -> Scanner st a -- | Initial state [scanInit] :: Scanner st a -> st -- | How far did the scanner look to produce this intermediate state? The -- state can be reused as long as nothing changes before that point. [scanLooked] :: Scanner st a -> st -> Point [scanEmpty] :: Scanner st a -> a -- | Running function returns a list of results and intermediate states. -- Note: the state is the state before producing the result in the -- second component. [scanRun] :: Scanner st a -> st -> [(st, a)] data ExtHL syntax ExtHL :: (Highlighter cache syntax) -> ExtHL syntax noHighlighter :: Highlighter () syntax -- | This takes as input a scanner that returns the "full" result at each -- element in the list; perhaps in a different form for the purpose of -- incremental-lazy eval. mkHighlighter :: forall state result. Show state => (Scanner Point Char -> Scanner state result) -> Highlighter (Cache state result) result skipScanner :: Int -> Scanner st a -> Scanner st a emptyFileScan :: Scanner Point Char -- | A point in a buffer newtype Point Point :: Int -> Point [fromPoint] :: Point -> Int -- | Size of a buffer region newtype Size Size :: Int -> Size [fromSize] :: Size -> Int type Length = Int type Stroke = Span StyleName data Span a Span :: !Point -> !a -> !Point -> Span a [spanBegin] :: Span a -> !Point [spanContents] :: Span a -> !a [spanEnd] :: Span a -> !Point instance Data.Traversable.Traversable Yi.Syntax.Span instance Data.Foldable.Foldable Yi.Syntax.Span instance GHC.Base.Functor Yi.Syntax.Span instance GHC.Show.Show a => GHC.Show.Show (Yi.Syntax.Span a) instance GHC.Base.Functor (Yi.Syntax.Scanner st) -- | Utilities to turn a lexer generated by Alex into a Scanner that -- can be used by Yi. Most lexers will use the types defined here. Some -- things are exported for use by lexers themselves through the use of -- YiLexerscommon.hsinc. module Yi.Lexer.Alex -- | Encode a Haskell String to a list of Word8 values, in UTF8 format. utf8Encode :: Char -> [Word8] type Byte = Word8 type IndexedStr = [(Point, Char)] type AlexInput = (Char, [Byte], IndexedStr) type Action hlState token = IndexedStr -> hlState -> (hlState, token) -- | Lexer state data AlexState lexerState AlexState :: lexerState -> !Point -> !Posn -> AlexState lexerState [stLexer] :: AlexState lexerState -> lexerState [lookedOffset] :: AlexState lexerState -> !Point [stPosn] :: AlexState lexerState -> !Posn data Tok t Tok :: t -> Size -> Posn -> Tok t [tokT] :: Tok t -> t [tokLen] :: Tok t -> Size [tokPosn] :: Tok t -> Posn tokToSpan :: Tok t -> Span t tokFromT :: t -> Tok t tokBegin :: Tok t -> Point tokEnd :: Tok t -> Point data Posn Posn :: !Point -> !Int -> !Int -> Posn [posnOfs] :: Posn -> !Point [posnLine] :: Posn -> !Int [posnCol] :: Posn -> !Int startPosn :: Posn moveStr :: Posn -> IndexedStr -> Posn moveCh :: Posn -> Char -> Posn alexGetChar :: AlexInput -> Maybe (Char, AlexInput) alexGetByte :: AlexInput -> Maybe (Word8, AlexInput) alexCollectChar :: AlexInput -> [Char] alexInputPrevChar :: AlexInput -> Char -- | Return a constant token actionConst :: token -> Action lexState token -- | Return a constant token, and modify the lexer state actionAndModify :: (lexState -> lexState) -> token -> Action lexState token -- | Convert the parsed string into a token, and also modify the lexer -- state actionStringAndModify :: (s -> s) -> (String -> token) -> Action s token -- | Convert the parsed string into a token actionStringConst :: (String -> token) -> Action lexState token type ASI s = (AlexState s, AlexInput) -- | Function to (possibly) lex a single token and give us the remaining -- input. type TokenLexer l s t i = (l s, i) -> Maybe (t, (l s, i)) -- | Handy alias type CharScanner = Scanner Point Char -- | Generalises lexers. This allows us to easily use lexers which don't -- want to be cornered into the types we have predefined here and use in -- common.hsinc. data Lexer l s t i Lexer :: TokenLexer l s t i -> (s -> Point -> Posn -> l s) -> (Char -> [(Point, Char)] -> i) -> (l s -> Point) -> (l s -> Posn) -> t -> s -> Lexer l s t i [_step] :: Lexer l s t i -> TokenLexer l s t i [_starting] :: Lexer l s t i -> s -> Point -> Posn -> l s [_withChars] :: Lexer l s t i -> Char -> [(Point, Char)] -> i [_looked] :: Lexer l s t i -> l s -> Point [_statePosn] :: Lexer l s t i -> l s -> Posn [_lexEmpty] :: Lexer l s t i -> t [_startingState] :: Lexer l s t i -> s -- | Just like Lexer but also knows how to turn its tokens into -- StyleNames. data StyleLexer l s t i StyleLexer :: (t -> StyleName) -> Lexer l s (Tok t) i -> StyleLexer l s t i [_tokenToStyle] :: StyleLexer l s t i -> t -> StyleName [_styleLexer] :: StyleLexer l s t i -> Lexer l s (Tok t) i -- | StyleLexer over ASI. type StyleLexerASI s t = StyleLexer AlexState s t AlexInput -- | Defines a Lexer for ASI. This exists to make using the -- new lexScanner easier if you're using ASI as all our -- lexers do today, 23-08-2014. commonLexer :: (ASI s -> Maybe (Tok t, ASI s)) -> s -> Lexer AlexState s (Tok t) AlexInput -- | Combine a character scanner with a lexer to produce a token scanner. -- May be used together with mkHighlighter to produce a -- Highlighter, or with linearSyntaxMode to produce a -- Mode. lexScanner :: Lexer l s t i -> CharScanner -> Scanner (l s) t -- | unfold lexer into a function that returns a stream of (state, token) unfoldLexer :: ((state, input) -> Maybe (token, (state, input))) -> (state, input) -> [(state, token)] posnOfsA :: Lens' Posn Point posnLineA :: Lens' Posn Int posnColA :: Lens' Posn Int tokTA :: forall t_aySz t_azee. Lens (Tok t_aySz) (Tok t_azee) t_aySz t_azee tokPosnA :: forall t_aySz. Lens' (Tok t_aySz) Posn tokLenA :: forall t_aySz. Lens' (Tok t_aySz) Size withChars :: forall l_aySq s_aySr t_aySs i_aySt. Lens' (Lexer l_aySq s_aySr t_aySs i_aySt) (Char -> [(Point, Char)] -> i_aySt) step :: forall l_aySq s_aySr t_aySs i_aySt. Lens' (Lexer l_aySq s_aySr t_aySs i_aySt) (TokenLexer l_aySq s_aySr t_aySs i_aySt) statePosn :: forall l_aySq s_aySr t_aySs i_aySt. Lens' (Lexer l_aySq s_aySr t_aySs i_aySt) (l_aySq s_aySr -> Posn) startingState :: forall l_aySq s_aySr t_aySs i_aySt. Lens' (Lexer l_aySq s_aySr t_aySs i_aySt) s_aySr starting :: forall l_aySq s_aySr t_aySs i_aySt. Lens' (Lexer l_aySq s_aySr t_aySs i_aySt) (s_aySr -> Point -> Posn -> l_aySq s_aySr) looked :: forall l_aySq s_aySr t_aySs i_aySt. Lens' (Lexer l_aySq s_aySr t_aySs i_aySt) (l_aySq s_aySr -> Point) lexEmpty :: forall l_aySq s_aySr t_aySs i_aySt. Lens' (Lexer l_aySq s_aySr t_aySs i_aySt) t_aySs tokenToStyle :: forall l_aySm s_aySn t_aySo i_aySp. Lens' (StyleLexer l_aySm s_aySn t_aySo i_aySp) (t_aySo -> StyleName) styleLexer :: forall l_aySm s_aySn t_aySo i_aySp l_azlq s_azlr i_azls. Lens (StyleLexer l_aySm s_aySn t_aySo i_aySp) (StyleLexer l_azlq s_azlr t_aySo i_azls) (Lexer l_aySm s_aySn (Tok t_aySo) i_aySp) (Lexer l_azlq s_azlr (Tok t_aySo) i_azls) (+~) :: SemiNum absolute relative => absolute -> relative -> absolute (~-) :: SemiNum absolute relative => absolute -> absolute -> relative -- | Size of a buffer region newtype Size Size :: Int -> Size [fromSize] :: Size -> Int type Stroke = Span StyleName instance GHC.Show.Show lexerState => GHC.Show.Show (Yi.Lexer.Alex.AlexState lexerState) instance GHC.Base.Functor Yi.Lexer.Alex.Tok instance GHC.Arr.Ix Yi.Lexer.Alex.Posn instance GHC.Classes.Eq Yi.Lexer.Alex.Posn instance GHC.Classes.Eq (Yi.Lexer.Alex.Tok a) instance GHC.Show.Show t => GHC.Show.Show (Yi.Lexer.Alex.Tok t) instance GHC.Classes.Ord Yi.Lexer.Alex.Posn instance GHC.Show.Show Yi.Lexer.Alex.Posn module Yi.Lexer.Abella lexer :: StyleLexerASI HlState Token tokenToText :: Token -> Maybe String type TT = Tok Token isComment :: Token -> Bool data Token Number :: Token VarIdent :: Token ConsIdent :: Token Reserved :: !Reserved -> Token ReservedOp :: !ReservedOp -> Token CommentLine :: Token Skip :: Token Unrecognized :: Token type HlState = Int data Reserved Forall :: Reserved Exists :: Reserved Other :: Reserved data ReservedOp Or :: ReservedOp And :: ReservedOp BackSlash :: ReservedOp RightArrow :: ReservedOp DoubleRightArrow :: ReservedOp Dot :: ReservedOp OtherOp :: ReservedOp instance GHC.Show.Show Yi.Lexer.Abella.Token instance GHC.Classes.Eq Yi.Lexer.Abella.Token instance GHC.Show.Show Yi.Lexer.Abella.ReservedOp instance GHC.Classes.Eq Yi.Lexer.Abella.ReservedOp instance GHC.Show.Show Yi.Lexer.Abella.Reserved instance GHC.Classes.Eq Yi.Lexer.Abella.Reserved instance GHC.Base.Functor Yi.Lexer.Abella.AlexLastAcc module Yi.Lexer.Cabal lexer :: StyleLexerASI HlState Token instance GHC.Base.Functor Yi.Lexer.Cabal.AlexLastAcc module Yi.Lexer.Clojure lexer :: StyleLexerASI HlState Token instance GHC.Base.Functor Yi.Lexer.Clojure.AlexLastAcc module Yi.Lexer.Compilation lexer :: StyleLexerASI HlState Token data Token Report :: String -> Int -> Int -> String -> Token Text :: String -> Token instance GHC.Show.Show Yi.Lexer.Compilation.Token instance GHC.Base.Functor Yi.Lexer.Compilation.AlexLastAcc module Yi.Lexer.GNUMake lexer :: StyleLexerASI HlState Token instance GHC.Show.Show Yi.Lexer.GNUMake.HlState instance GHC.Base.Functor Yi.Lexer.GNUMake.AlexLastAcc module Yi.Lexer.GitCommit lexer :: StyleLexerASI HlState Token type Token = StyleName instance GHC.Classes.Eq Yi.Lexer.GitCommit.HlState instance GHC.Show.Show Yi.Lexer.GitCommit.HlState instance GHC.Base.Functor Yi.Lexer.GitCommit.AlexLastAcc module Yi.Lexer.Haskell initState :: HlState -- | Scan one token. Return (maybe) a token and a new state. alexScanToken :: (AlexState HlState, AlexInput) -> Maybe (Tok Token, (AlexState HlState, AlexInput)) tokenToStyle :: Token -> StyleName tokenToText :: Token -> Maybe String type TT = Tok Token isErrorTok :: Token -> Bool isSpecial :: String -> Token -> Bool startsLayout :: Token -> Bool isComment :: Token -> Bool data Token Number :: Token CharTok :: Token StringTok :: Token VarIdent :: Token ConsIdent :: Token Reserved :: !ReservedType -> Token ReservedOp :: !OpType -> Token Special :: Char -> Token ConsOperator :: String -> Token Operator :: String -> Token Comment :: !CommentType -> Token THQuote :: Token CppDirective :: Token Unrecognized :: Token type HlState = Int data CommentType Open :: CommentType Close :: CommentType Text :: CommentType Line :: CommentType data ReservedType Hiding :: ReservedType Qualified :: ReservedType As :: ReservedType Import :: ReservedType Data :: ReservedType NewType :: ReservedType Type :: ReservedType Where :: ReservedType Let :: ReservedType In :: ReservedType Do :: ReservedType Of :: ReservedType OtherLayout :: ReservedType Deriving :: ReservedType Module :: ReservedType Forall :: ReservedType Other :: ReservedType Class :: ReservedType Instance :: ReservedType data OpType Pipe :: OpType Equal :: OpType BackSlash :: OpType LeftArrow :: OpType RightArrow :: OpType DoubleRightArrow :: OpType DoubleColon :: OpType DoubleDot :: OpType Arobase :: OpType Tilda :: OpType instance GHC.Show.Show Yi.Lexer.Haskell.Token instance GHC.Classes.Eq Yi.Lexer.Haskell.Token instance GHC.Show.Show Yi.Lexer.Haskell.OpType instance GHC.Classes.Eq Yi.Lexer.Haskell.OpType instance GHC.Show.Show Yi.Lexer.Haskell.ReservedType instance GHC.Classes.Eq Yi.Lexer.Haskell.ReservedType instance GHC.Show.Show Yi.Lexer.Haskell.CommentType instance GHC.Classes.Eq Yi.Lexer.Haskell.CommentType instance GHC.Base.Functor Yi.Lexer.Haskell.AlexLastAcc module Yi.Lexer.JSON lexer :: StyleLexerASI HlState Token type Token = StyleName instance GHC.Base.Functor Yi.Lexer.JSON.AlexLastAcc module Yi.Lexer.JavaScript initState :: HlState -- | Scan one token. Return (maybe) a token and a new state. alexScanToken :: (AlexState HlState, AlexInput) -> Maybe (Tok Token, (AlexState HlState, AlexInput)) -- | Takes a Token and returns a style to be used for that type of -- token. -- -- TODO: The elem check is potentially unnecessarily slow. We -- could split the Const constructor into two different ones, one for -- builtins and one for others. tokenToStyle :: Token -> UIStyle -> Style type TT = Tok Token -- | The different tokens. data Token Unknown :: Token Res :: !Reserved -> Token Str :: !String -> Token Rex :: !String -> Token Op :: !Operator -> Token Special :: !Char -> Token Number :: !String -> Token ValidName :: !String -> Token Comment :: !CommentType -> Token Const :: !String -> Token -- | The constructors for Reserved have an apostrophe as a suffix -- because Default is already used. Also note that -- Undefined' is not intended as some sort of "backup" reserved -- word for things we don't care about -- it really means the "undefined" -- built-in in JavaScript. data Reserved Break' :: Reserved Case' :: Reserved Catch' :: Reserved Continue' :: Reserved Default' :: Reserved Delete' :: Reserved Do' :: Reserved Else' :: Reserved Finally' :: Reserved For' :: Reserved Function' :: Reserved If' :: Reserved In' :: Reserved InstanceOf' :: Reserved New' :: Reserved Return' :: Reserved Switch' :: Reserved This' :: Reserved Throw' :: Reserved Try' :: Reserved TypeOf' :: Reserved Var' :: Reserved Void' :: Reserved While' :: Reserved With' :: Reserved True' :: Reserved False' :: Reserved Null' :: Reserved Undefined' :: Reserved -- | The constructors for Operator have an apostrophe as a suffix -- because e.g. LT is already used by Prelude. data Operator Add' :: Operator Subtract' :: Operator Multiply' :: Operator Divide' :: Operator Modulo' :: Operator Increment' :: Operator Decrement' :: Operator Assign' :: Operator AddAssign' :: Operator SubtractAssign' :: Operator MultiplyAssign' :: Operator DivideAssign' :: Operator ModuloAssign' :: Operator Equals' :: Operator NotEquals' :: Operator GT' :: Operator GTE' :: Operator LT' :: Operator LTE' :: Operator EqualsType' :: Operator NotEqualsType' :: Operator And' :: Operator Or' :: Operator Not' :: Operator BitAnd' :: Operator BitOr' :: Operator BitXor' :: Operator LeftShift' :: Operator RightShift' :: Operator RightShiftZ' :: Operator BitNot' :: Operator Qualify' :: Operator -- | HlState is 0 when outside of a multi-line comment and -1 when -- inside one. type HlState = Int -- | Prefix operators. NOTE: Add' is also a valid prefix operator, but -- since it's completely useless in the real world, we don't care about -- it here. Doing this makes parsing much, much easier. prefixOperators :: [Operator] -- | Infix operators. infixOperators :: [Operator] -- | Postfix operators. postfixOperators :: [Operator] instance GHC.Classes.Eq Yi.Lexer.JavaScript.Token instance GHC.Show.Show Yi.Lexer.JavaScript.Token instance GHC.Classes.Eq Yi.Lexer.JavaScript.Operator instance GHC.Show.Show Yi.Lexer.JavaScript.Operator instance GHC.Classes.Eq Yi.Lexer.JavaScript.Reserved instance GHC.Show.Show Yi.Lexer.JavaScript.Reserved instance GHC.Classes.Eq Yi.Lexer.JavaScript.CommentType instance GHC.Show.Show Yi.Lexer.JavaScript.CommentType instance GHC.Base.Functor Yi.Lexer.JavaScript.AlexLastAcc module Yi.Lexer.Latex initState :: HlState -- | Scan one token. Return (maybe) a token and a new state. alexScanToken :: (AlexState HlState, AlexInput) -> Maybe (Tok Token, (AlexState HlState, AlexInput)) data Token Comment :: Token Text :: Token Special :: !Char -> Token Command :: !String -> Token Begin :: !String -> Token End :: !String -> Token NewCommand :: Token type HlState = Int tokenToText :: Token -> Maybe [Char] instance GHC.Classes.Ord Yi.Lexer.Latex.Token instance GHC.Show.Show Yi.Lexer.Latex.Token instance GHC.Classes.Eq Yi.Lexer.Latex.Token instance GHC.Base.Functor Yi.Lexer.Latex.AlexLastAcc module Yi.Lexer.LiterateHaskell initState :: HlState -- | Scan one token. Return (maybe) a token and a new state. alexScanToken :: (AlexState HlState, AlexInput) -> Maybe (Tok Token, (AlexState HlState, AlexInput)) data HlState instance GHC.Show.Show Yi.Lexer.LiterateHaskell.HlState instance GHC.Classes.Eq Yi.Lexer.LiterateHaskell.HlState instance GHC.Base.Functor Yi.Lexer.LiterateHaskell.AlexLastAcc module Yi.Lexer.OCaml lexer :: StyleLexerASI HlState Token data Token Number :: Token CharTok :: Token StringTok :: Token VarIdent :: Token ConsIdent :: Token IndentReserved :: Token Reserved :: Token ReservedOp :: Token Special :: Char -> Token ConsOperator :: Token Operator :: Token Comment :: Token instance GHC.Show.Show Yi.Lexer.OCaml.Token instance GHC.Classes.Eq Yi.Lexer.OCaml.Token instance GHC.Base.Functor Yi.Lexer.OCaml.AlexLastAcc module Yi.Lexer.Ott lexer :: StyleLexerASI HlState Token instance GHC.Base.Functor Yi.Lexer.Ott.AlexLastAcc module Yi.Lexer.SVNCommit lexer :: StyleLexerASI HlState Token instance GHC.Show.Show Yi.Lexer.SVNCommit.HlState instance GHC.Base.Functor Yi.Lexer.SVNCommit.AlexLastAcc module Yi.Lexer.Whitespace lexer :: StyleLexerASI HlState Token instance GHC.Base.Functor Yi.Lexer.Whitespace.AlexLastAcc module Yi.Lexer.C lexer :: StyleLexerASI HlState Token instance GHC.Base.Functor Yi.Lexer.C.AlexLastAcc module Yi.Lexer.Cplusplus lexer :: StyleLexerASI HlState Token instance GHC.Base.Functor Yi.Lexer.Cplusplus.AlexLastAcc module Yi.Lexer.Java lexer :: StyleLexerASI HlState Token instance GHC.Base.Functor Yi.Lexer.Java.AlexLastAcc module Yi.Lexer.ObjectiveC lexer :: StyleLexerASI HlState Token instance GHC.Base.Functor Yi.Lexer.ObjectiveC.AlexLastAcc module Yi.Lexer.Perl lexer :: StyleLexerASI HlState Token instance GHC.Show.Show Yi.Lexer.Perl.HlState instance GHC.Base.Functor Yi.Lexer.Perl.AlexLastAcc module Yi.Lexer.Python lexer :: StyleLexerASI HlState Token instance GHC.Base.Functor Yi.Lexer.Python.AlexLastAcc module Yi.Lexer.R lexer :: StyleLexerASI HlState Token instance GHC.Base.Functor Yi.Lexer.R.AlexLastAcc module Yi.Lexer.Ruby lexer :: StyleLexerASI HlState Token instance GHC.Base.Functor Yi.Lexer.Ruby.AlexLastAcc module Yi.Lexer.Srmc lexer :: StyleLexerASI HlState Token instance GHC.Base.Functor Yi.Lexer.Srmc.AlexLastAcc