Safe Haskell | None |
---|---|
Language | Haskell2010 |
Resolves indentation into explicit nesting using { }
- data LayEnv = LayEnv {}
- type LastNl = (Int, Int)
- type Position = Posn
- data ExToken
- data LEnv = LEnv [Int] (Maybe LastNl)
- getToken :: Monad m => ExToken -> ClaferT m Token
- layoutOpen :: String
- layoutClose :: String
- resolveLayout :: Monad m => [Token] -> ClaferT m [Token]
- resolve :: Monad m => LEnv -> [ExToken] -> ClaferT m [Token]
- indent :: Token
- dedent :: Token
- toToken :: ExToken -> [Token]
- isExTokenIn :: [String] -> ExToken -> Bool
- isNewLine :: Token -> Token -> Bool
- incrGlobal :: Monad m => Position -> Int -> Token -> ClaferT m Token
- tokenLookup :: String -> Maybe Int
- position :: Token -> Position
- line :: Token -> Int
- column :: Token -> Int
- isTokenIn :: [String] -> Token -> Bool
- isLayoutOpen :: Token -> Bool
- isBracketOpen :: Token -> Bool
- isLayoutClose :: Token -> Bool
- isBracketClose :: Token -> Bool
- tokenLength :: Token -> Int
- addNewLines :: Monad m => [Token] -> ClaferT m [ExToken]
- addNewLines' :: Monad m => Int -> [Token] -> ClaferT m [ExToken]
- adjust :: Monad m => [Token] -> ClaferT m [Token]
- updToken :: Monad m => [Token] -> ClaferT m [Token]
- addToken :: Monad m => Position -> String -> [Token] -> ClaferT m [Token]
- resLayout :: String -> String
- resolveLayout' :: StateT LayEnv Identity ()
- handleIndent :: Char -> StateT LayEnv Identity Char
- emit :: MonadState LayEnv m => Char -> m ()
- readC :: (Num a, Ord a) => a -> StateT LayEnv Identity Char
- eatSpaces :: StateT LayEnv Identity Int
- emitIndent :: MonadState LayEnv m => Int -> m ()
- emitDedent :: MonadState LayEnv m => Int -> m ()
- isEof :: StateT LayEnv Identity Bool
- getc :: StateT LayEnv Identity Char
- revertLayout :: String -> String
- revertLayout' :: [String] -> Int -> [String]
Documentation
layoutOpen :: String Source #
layoutClose :: String Source #
:: Monad m | |
=> Position | If the token is on the same line as this position, update the column position. |
-> Int | Number of characters to add to the position. |
-> Token | |
-> ClaferT m Token |
Add to the global and column positions of a token. | The column position is only changed if the token is on | the same line as the given position.
isLayoutOpen :: Token -> Bool Source #
Check if a token is the layout open token.
isBracketOpen :: Token -> Bool Source #
isLayoutClose :: Token -> Bool Source #
Check if a token is the layout close token.
isBracketClose :: Token -> Bool Source #
tokenLength :: Token -> Int Source #
Get the number of characters in the token.
:: Monad m | |
=> Position | Position of the new token. |
-> String | Symbol in the new token. |
-> [Token] | The rest of the tokens. These will have their positions updated to make room for the new token. |
-> ClaferT m [Token] |
Insert a new symbol token at the begninning of a list of tokens.
emitIndent :: MonadState LayEnv m => Int -> m () Source #
emitDedent :: MonadState LayEnv m => Int -> m () Source #
revertLayout :: String -> String Source #