Safe Haskell | None |
---|
- data Tok n
- renameTok :: Ord n2 => (n1 -> Maybe n2) -> Tok n1 -> Maybe (Tok n2)
- describeTok :: Pretty n => Tok n -> String
- data TokMeta
- describeTokMeta :: TokMeta -> String
- data TokAtom
- = KRoundBra
- | KRoundKet
- | KSquareBra
- | KSquareKet
- | KBraceBra
- | KBraceKet
- | KAngleBra
- | KAngleKet
- | KSquareColonBra
- | KSquareColonKet
- | KAngleColonBra
- | KAngleColonKet
- | KDot
- | KBar
- | KHat
- | KPlus
- | KColon
- | KComma
- | KBackSlash
- | KSemiColon
- | KUnderscore
- | KEquals
- | KAmpersand
- | KDash
- | KColonColon
- | KBigLambda
- | KSortComp
- | KSortProp
- | KKindValue
- | KKindRegion
- | KKindEffect
- | KKindClosure
- | KKindWitness
- | KArrowTilde
- | KArrowDash
- | KArrowDashLeft
- | KArrowEquals
- | KBotEffect
- | KBotClosure
- | KModule
- | KImports
- | KExports
- | KWith
- | KWhere
- | KIn
- | KLet
- | KLazy
- | KLetRec
- | KLetRegions
- | KLetRegion
- | KWithRegion
- | KCase
- | KOf
- | KType
- | KWeakEff
- | KWeakClo
- | KPurify
- | KForget
- | KDo
- | KMatch
- | KElse
- | KIndex Int
- | KDaConUnit
- | KTwConBuiltin TwCon
- | KWbConBuiltin WbCon
- | KTcConBuiltin TcCon
- describeTokAtom :: TokAtom -> String
- data TokNamed n
- describeTokNamed :: Pretty n => TokNamed n -> String
Tokens
Tokens accepted by the core language parser.
KJunk String | Some junk symbol that isn't part of the language. |
KM !TokMeta | Meta tokens contain out-of-band information that is eliminated before parsing proper. |
KA !TokAtom | Atomic tokens are keywords, punctuation and baked-in constructor names. |
KN !(TokNamed n) | A named token that is specific to the language fragment (maybe it's a primop), or a user defined name. |
renameTok :: Ord n2 => (n1 -> Maybe n2) -> Tok n1 -> Maybe (Tok n2)Source
Apply a function to all the names in a Tok
.
describeTok :: Pretty n => Tok n -> StringSource
Describe a token for parser error messages.
Meta Tokens
Meta tokens contain out-of-band information that is eliminated before parsing proper.
KNewLine | |
KCommentLineStart | |
KCommentBlockStart | |
KCommentBlockEnd | |
KCommentUnterminated | This is injected by |
KOffsideClosingBrace | This is injected by |
describeTokMeta :: TokMeta -> StringSource
Describe a TokMeta, for lexer error messages.
Atomic Tokens
Atomic tokens are keywords, punctuation and baked-in constructor names. They don't contain user-defined names or primops specific to the language fragment.
describeTokAtom :: TokAtom -> StringSource
Describe a TokAtom
, for parser error messages.
Named Tokens
A token with a user-defined name.