Safe Haskell | None |
---|
This module defines a common interface for syntax-awareness.
- 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.
SynHL | |
|
Scanner | |
|
forall cache . ExtHL (Highlighter cache syntax) |
noHighlighter :: Highlighter () syntaxSource
mkHighlighter :: forall state result. Show state => (Scanner Point Char -> Scanner state result) -> Highlighter (Cache state result) resultSource
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 aSource
A point in a buffer
Size of a buffer region