morte-1.6.9: A bare-bones calculus of constructions

Safe HaskellNone
LanguageHaskell98

Morte.Lexer

Contents

Description

Lexing logic for the Morte language

Synopsis

Lexer

lexExpr :: Text -> Producer LocatedToken (State Position) (Maybe Text) #

Convert a text representation of an expression into a stream of tokens

lexExpr keeps track of position and returns the remainder of the input if lexing fails.

Types

data Token #

Token type, used to communicate between the lexer and parser

Instances

Eq Token # 

Methods

(==) :: Token -> Token -> Bool #

(/=) :: Token -> Token -> Bool #

Show Token # 

Methods

showsPrec :: Int -> Token -> ShowS #

show :: Token -> String #

showList :: [Token] -> ShowS #

data Position #

The cursor's location while lexing the text

Constructors

P 

Fields

Instances

data LocatedToken #

A Token augmented with Position information

Constructors

LocatedToken 

Fields