language-lua-0.1.6: Lua parser and pretty-printer

Safe HaskellSafe-Inferred

Language.Lua.Types

Description

Lua 5.2 syntax tree, as specified in http://www.lua.org/manual/5.2/manual.html#9.

Synopsis

Documentation

data Stat Source

Constructors

Assign [Var] [Exp]

var1, var2 .. = exp1, exp2 ..

FunCall FunCall

function call

Label Name

label for goto

Break

break

Goto Name

goto label

Do Block

do .. end

While Exp Block

while .. do .. end

Repeat Block Exp

repeat .. until ..

If [(Exp, Block)] (Maybe Block)

if .. then .. [elseif ..] [else ..] end

ForRange Name Exp Exp (Maybe Exp) Block

for x=start, end [, step] do .. end

ForIn [Name] [Exp] Block

for x in .. do .. end

FunAssign FunName FunBody

function <var> (..) .. end

LocalFunAssign Name FunBody

local function <var> (..) .. end

LocalAssign [Name] (Maybe [Exp])

local var1, var2 .. = exp1, exp2 ..

EmptyStat

;

Instances

data Exp Source

Constructors

Nil 
Bool Bool 
Number String 
String String 
Vararg

...

EFunDef FunDef

function (..) .. end

PrefixExp PrefixExp 
TableConst Table

table constructor

Binop Binop Exp Exp

binary operators, + - * ^ % .. < <= > >= == ~= and or

Unop Unop Exp

unary operators, - not #

Instances

data Var Source

Constructors

Name Name

variable

Select PrefixExp Exp

table[exp]

SelectName PrefixExp Name

table.variable

Instances

data Binop Source

Constructors

Add 
Sub 
Mul 
Div 
Exp 
Mod 
Concat 
LT 
LTE 
GT 
GTE 
EQ 
NEQ 
And 
Or 

data Unop Source

Constructors

Neg 
Not 
Len 

Instances

data Table Source

Constructors

Table [TableField]

list of table fields

data TableField Source

Constructors

ExpField Exp Exp

[exp] = exp

NamedField Name Exp

name = exp

Field Exp 

data Block Source

A block is list of statements with optional return statement.

Constructors

Block [Stat] (Maybe [Exp]) 

data FunDef Source

Constructors

FunDef FunBody 

data FunBody Source

Constructors

FunBody [Name] Bool Block

(args, vararg predicate, block)

data FunCall Source

Constructors

NormalFunCall PrefixExp FunArg

prefixexp ( funarg )

MethodCall PrefixExp Name FunArg

prefixexp : name ( funarg )

data FunArg Source

Constructors

Args [Exp]

list of args

TableArg Table

table constructor

StringArg String

string