ddc-core-0.2.0.2: Disciple Core language and type checker.

Safe HaskellSafe-Infered

DDC.Core.Parser.Lexer

Contents

Description

Reference lexer for core langauge parser. Slow but Simple.

Synopsis

Constructors

isConName :: String -> BoolSource

String is a constructor name.

isConStart :: Char -> BoolSource

Character can start a constructor name.

isConBody :: Char -> BoolSource

Charater can be part of a constructor body.

readTcConBuiltin :: String -> Maybe TcConSource

Read a builtin TcCon with a non-symbolic name, ie not '->'.

readCon :: String -> Maybe StringSource

Read a named, user defined TcCon.

We won't know its kind, so fill this in with the Bottom element for computatation kinds (**0).

Variables

isVarName :: String -> BoolSource

String is a variable name.

isVarStart :: Char -> BoolSource

Charater can start a variable name.

isVarBody :: Char -> BoolSource

Character can be part of a variable body.

readVar :: String -> Maybe StringSource

Read a named, user defined variable.

Lexer

lexExp :: Int -> String -> [Token (Tok String)]Source

Lex a string into tokens.