Copyright | (c) Don Stewart 2007 |
---|---|
License | GPL-2 |
Maintainer | yi-devel@googlegroups.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Extensions |
|
Yi.Syntax
Description
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.
Synopsis
- data Highlighter cache syntax = SynHL {}
- data Cache state result
- data Scanner st a = Scanner {
- scanInit :: st
- scanLooked :: st -> Point
- scanEmpty :: a
- scanRun :: st -> [(st, a)]
- data ExtHL syntax = forall cache. ExtHL (Highlighter cache syntax)
- noHighlighter :: Highlighter () syntax
- 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
- newtype Point = Point {}
- newtype Size = Size {}
- type Length = Int
- type Stroke = Span StyleName
- data Span a = Span {
- spanBegin :: !Point
- spanContents :: !a
- spanEnd :: !Point
Documentation
data Highlighter cache syntax Source #
The main type of syntax highlighters. This record type combines all the required functions, and is parametrized on the type of the internal state.
Constructors
SynHL | |
Fields
|
Constructors
Scanner | |
Fields
|
Constructors
forall cache. ExtHL (Highlighter cache syntax) |
noHighlighter :: Highlighter () syntax Source #
mkHighlighter :: forall state result. Show state => (Scanner Point Char -> Scanner state result) -> Highlighter (Cache state result) result Source #
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.
A point in a buffer
Instances
Bounded Point Source # | |
Enum Point Source # | |
Defined in Yi.Buffer.Basic Methods succ :: Point -> Point Source # pred :: Point -> Point Source # toEnum :: Int -> Point Source # fromEnum :: Point -> Int Source # enumFrom :: Point -> [Point] Source # enumFromThen :: Point -> Point -> [Point] Source # enumFromTo :: Point -> Point -> [Point] Source # enumFromThenTo :: Point -> Point -> Point -> [Point] Source # | |
Ix Point Source # | |
Defined in Yi.Buffer.Basic | |
Num Point Source # | |
Integral Point Source # | |
Real Point Source # | |
Defined in Yi.Buffer.Basic Methods toRational :: Point -> Rational Source # | |
Show Point Source # | |
Binary Point Source # | |
Eq Point Source # | |
Ord Point Source # | |
Defined in Yi.Buffer.Basic | |
SemiNum Point Size Source # | |
Size of a buffer region
Instances
Enum Size Source # | |
Num Size Source # | |
Integral Size Source # | |
Defined in Yi.Buffer.Basic | |
Real Size Source # | |
Defined in Yi.Buffer.Basic Methods toRational :: Size -> Rational Source # | |
Show Size Source # | |
Binary Size Source # | |
Eq Size Source # | |
Ord Size Source # | |
SemiNum Point Size Source # | |
Instances
Foldable Span Source # | |
Defined in Yi.Syntax Methods fold :: Monoid m => Span m -> m Source # foldMap :: Monoid m => (a -> m) -> Span a -> m Source # foldMap' :: Monoid m => (a -> m) -> Span a -> m Source # foldr :: (a -> b -> b) -> b -> Span a -> b Source # foldr' :: (a -> b -> b) -> b -> Span a -> b Source # foldl :: (b -> a -> b) -> b -> Span a -> b Source # foldl' :: (b -> a -> b) -> b -> Span a -> b Source # foldr1 :: (a -> a -> a) -> Span a -> a Source # foldl1 :: (a -> a -> a) -> Span a -> a Source # toList :: Span a -> [a] Source # null :: Span a -> Bool Source # length :: Span a -> Int Source # elem :: Eq a => a -> Span a -> Bool Source # maximum :: Ord a => Span a -> a Source # minimum :: Ord a => Span a -> a Source # | |
Traversable Span Source # | |
Functor Span Source # | |
Show a => Show (Span a) Source # | |