annah-1.0.0: Medium-level language that desugars to Morte

Safe HaskellNone

Annah.Lexer

Contents

Description

Lexing logic for the Annah language

Synopsis

Lexer

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

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 Source

Token type, used to communicate between the lexer and parser

Instances

Eq Token 
Show Token 

data Position Source

The cursor's location while lexing the text

Constructors

P 

Fields

lineNo :: !Int
 
columnNo :: !Int
 

Instances

Show Position 

data LocatedToken Source

A Token augmented with Position information

Constructors

LocatedToken 

Fields

token :: !Token
 
position :: !Position
 

Instances