Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Contains class instances and functions related to tokens
Synopsis
- type MTokenAlgebra mtok = Region -> Token -> mtok
- mpos :: MToken -> Region
- mtok :: MToken -> Token
- emptyRg :: Region
- rgOr :: Region -> Region -> Region
- customAdvanceChr :: LineColPos -> Char -> LineColPos
- customAdvanceStr :: LineColPos -> String -> LineColPos
- customAdvanceToken :: LineColPos -> Token -> LineColPos
- before :: Region -> Region -> Bool
- beforeOrOnLine :: Region -> Region -> Bool
- beforeEnd :: Region -> Region -> Bool
- beforeEndLine :: Region -> Region -> Bool
- rgStart :: Region -> LineColPos
- rgEnd :: Region -> LineColPos
- upto :: Region -> Region -> Region
- foldMToken :: MTokenAlgebra t -> MToken -> t
- mFold :: TokenAlgebra a -> MToken -> a
- type TokenAlgebra token = ((String -> token, String -> token, Int -> String -> token, String -> token, String -> token, token), (String -> token, String -> token, String -> token, String -> token, token, token, token, token), (token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token), (token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token), (token, token, token, token, token, token), (String -> token, String -> token))
- foldToken :: TokenAlgebra t -> Token -> t
- isWhitespace :: MToken -> Bool
- isComment :: MToken -> Bool
- splitComments :: [MToken] -> ([MToken], [MToken])
- tokenLabel :: MToken -> String
- tokenSize :: Token -> Int
- isSingleLineComment :: Token -> Bool
Documentation
type MTokenAlgebra mtok = Region -> Token -> mtok Source #
Metatoken algebra
customAdvanceChr :: LineColPos -> Char -> LineColPos Source #
customAdvanceStr :: LineColPos -> String -> LineColPos Source #
customAdvanceToken :: LineColPos -> Token -> LineColPos Source #
before :: Region -> Region -> Bool Source #
Whether the first region ends strictly before the second region starts
beforeOrOnLine :: Region -> Region -> Bool Source #
Whether the first region ends before or on the same line as the second region
beforeEnd :: Region -> Region -> Bool Source #
Whether the first region ends before the second region ends
beforeEndLine :: Region -> Region -> Bool Source #
Whether the first region ends before or on the same line as the END of the second region
rgStart :: Region -> LineColPos Source #
rgEnd :: Region -> LineColPos Source #
upto :: Region -> Region -> Region Source #
Returns a region that starts at the start of the first region and ends BEFORE the start of the second region
foldMToken :: MTokenAlgebra t -> MToken -> t Source #
Fold over metatoken
mFold :: TokenAlgebra a -> MToken -> a Source #
mFold: Apply a TokenAlgebra to an MToken
type TokenAlgebra token = ((String -> token, String -> token, Int -> String -> token, String -> token, String -> token, token), (String -> token, String -> token, String -> token, String -> token, token, token, token, token), (token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token), (token, token, token, token, token, token, token, token, token, token, token, token, token, token, token, token), (token, token, token, token, token, token), (String -> token, String -> token)) Source #
Huge token algebra
foldToken :: TokenAlgebra t -> Token -> t Source #
Fold over token definition
isWhitespace :: MToken -> Bool Source #
Whether an mtoken is a comment
splitComments :: [MToken] -> ([MToken], [MToken]) Source #
Split the tokens by comments and other tokens
tokenLabel :: MToken -> String Source #
isSingleLineComment :: Token -> Bool Source #