Safe Haskell | None |
---|---|
Language | Haskell98 |
Lexer for Source Tetra tokens.
- data Name
- = NameVar !Text
- | NameCon !Text
- | NamePrimType !PrimType
- | NamePrimValLit !PrimLit
- | NamePrimValOp !PrimVal
- lexModuleString :: String -> Int -> String -> [Located (Token Name)]
Documentation
Union of all names that we detect during lexing.
NameVar !Text | A user defined variable. |
NameCon !Text | A user defined constructor. |
NamePrimType !PrimType | Primitive type names. |
NamePrimValLit !PrimLit | Primitive literal values. |
NamePrimValOp !PrimVal | Primitive operator values. |
lexModuleString :: String -> Int -> String -> [Located (Token Name)] Source #
Lex a string to tokens, using primitive names.
The first argument gives the starting source line number.
We're currently re-using the lexer for the core language, which has *mostly* the same lexical structure as Source Tetra. There are a few tokens accepted by one language but not the other, but it'll do for now.