yi-0.8.1: The Haskell-Scriptable Editor

Safe HaskellNone



Parser for haskell that takes in account only parenthesis and layout



type Expr t = [Tree t] Source

data Tree t Source


Paren t (Expr t) t 
Block [Tree t] 
Atom t 
Error t 
Expr [Tree t] 


getIndentingSubtree :: Tree TT -> Point -> Int -> Maybe (Tree TT) Source

Search the given list, and return the 1st tree after the given point on the given line. This is the tree that will be moved if something is inserted at the point. Precondition: point is in the given line.

getSubtreeSpan :: Tree TT -> (Point, Int) Source

Given a tree, return (first offset, number of lines).

parse' :: (TT -> Token) -> (Token -> TT) -> P TT [Tree TT] Source

errTok :: Parser (Tok t) (Tok Token) Source

Create a special error token. (e.g. fill in where there is no correct token to parse) Note that the position of the token has to be correct for correct computation of node spans.