language-lua2-0.1.0.5: Lua parser and pretty printer

Safe HaskellNone
LanguageHaskell2010

Language.Lua.Syntax

Contents

Description

Abstract syntax of Lua 5.3 source files. See http://www.lua.org/manual/5.3/ for more information.

Synopsis

AST nodes

data Ident a Source

An identifier, defined as any string of letters, digits, or underscores, not beginning with a digit.

http://www.lua.org/manual/5.3/manual.html#3.1

Constructors

Ident !a !String 

data IdentList a Source

Zero or more Idents.

Constructors

IdentList !a ![Ident a] 

data Block a Source

A block of statements, possibly ending in a return statement.

http://www.lua.org/manual/5.3/manual.html#3.3.1

Constructors

Block !a ![Statement a] !(Maybe (ReturnStatement a)) 

data Statement a Source

Constructors

EmptyStmt !a
;
Assign !a !(VariableList1 a) !(ExpressionList1 a)
var1, var2, var3 = exp1, exp2, exp3
FunCall !a !(FunctionCall a)
foo.bar(args)
Label !a !(Ident a)
::label::
Break !a
break
Goto !a !(Ident a)
goto label
Do !a !(Block a)
do block end
While !a !(Expression a) !(Block a)
while exp do block end
Repeat !a !(Block a) !(Expression a)
repeat block until exp
If !a !(NonEmpty (Expression a, Block a)) !(Maybe (Block a))
if exp then block else block end
For !a !(Ident a) !(Expression a) !(Expression a) !(Maybe (Expression a)) !(Block a)
for x = exp do block end
ForIn !a !(IdentList1 a) !(ExpressionList1 a) !(Block a)
for a, b, c in exp1, exp2, exp3 do block end
FunAssign !a !(FunctionName a) !(FunctionBody a)
function name body
LocalFunAssign !a !(Ident a) !(FunctionBody a)
local function name body
LocalAssign !a !(IdentList1 a) !(ExpressionList a)
local x, y, z

data Field a Source

Constructors

FieldExp !a !(Expression a) !(Expression a)
[exp1] = exp2
FieldIdent !a !(Ident a) !(Expression a)
name = exp
Field !a !(Expression a)
exp

data FieldList a Source

Zero or more Fields, separated by , or ;.

Constructors

FieldList !a ![Field a] 

data Binop a Source

Constructors

Plus !a

+

Minus !a

-

Mult !a

*

FloatDiv !a

/

FloorDiv !a

//

Exponent !a

^

Modulo !a

%

BitwiseAnd !a

&

BitwiseXor !a

~

BitwiseOr !a

|

Rshift !a

>>

Lshift !a

<<

Concat !a

..

Lt !a

<

Leq !a

<=

Gt !a

>

Geq !a

>=

Eq !a

==

Neq !a

~=

And !a

and

Or !a

or

data Unop a Source

Constructors

Negate !a

-

Not !a

not

Length !a

#

BitwiseNot !a

~

Instances

Annotated typeclass