| Copyright | (c) Don Stewart 2007 |
|---|---|
| License | GPL-2 |
| Maintainer | yi-devel@googlegroups.com |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| 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 = ExtHL (Highlighter cache syntax)
- noHighlighter :: Highlighter () syntax
- mkHighlighter :: 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 {
- fromPoint :: Int
- newtype Size = Size {
- fromSize :: Int
- 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
| ExtHL (Highlighter cache syntax) |
noHighlighter :: Highlighter () syntax Source #
mkHighlighter :: 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.
skipScanner :: Int -> Scanner st a -> Scanner st a Source #
emptyFileScan :: Scanner Point Char Source #
A point in a buffer
Instances
| Binary Point Source # | |
| Bounded Point Source # | |
Defined in Yi.Buffer.Basic | |
| Enum Point Source # | |
| Ix Point Source # | |
| Num Point Source # | |
| Integral Point Source # | |
| Real Point Source # | |
Defined in Yi.Buffer.Basic Methods toRational :: Point -> Rational | |
| Show Point Source # | |
| Eq Point Source # | |
| Ord Point Source # | |
| SemiNum Point Size Source # | |
Size of a buffer region
Instances
| Functor Span Source # | |
| Foldable Span Source # | |
Defined in Yi.Syntax Methods fold :: Monoid m => Span m -> m foldMap :: Monoid m => (a -> m) -> Span a -> m foldMap' :: Monoid m => (a -> m) -> Span a -> m foldr :: (a -> b -> b) -> b -> Span a -> b foldr' :: (a -> b -> b) -> b -> Span a -> b foldl :: (b -> a -> b) -> b -> Span a -> b foldl' :: (b -> a -> b) -> b -> Span a -> b foldr1 :: (a -> a -> a) -> Span a -> a foldl1 :: (a -> a -> a) -> Span a -> a elem :: Eq a => a -> Span a -> Bool maximum :: Ord a => Span a -> a | |
| Traversable Span Source # | |
| Show a => Show (Span a) Source # | |