Safe Haskell | Safe-Inferred |
---|
Lua 5.2 syntax tree, as specified in http://www.lua.org/manual/5.2/manual.html#9.
- type Name = String
- data Stat
- = Assign [Var] [Exp]
- | FunCall FunCall
- | Label Name
- | Break
- | Goto Name
- | Do Block
- | While Exp Block
- | Repeat Block Exp
- | If [(Exp, Block)] (Maybe Block)
- | ForRange Name Exp Exp (Maybe Exp) Block
- | ForIn [Name] [Exp] Block
- | FunAssign FunName FunBody
- | LocalFunAssign Name FunBody
- | LocalAssign [Name] (Maybe [Exp])
- | EmptyStat
- data Exp
- data Var
- data Binop
- data Unop
- data PrefixExp
- data TableField
- data Block = Block [Stat] (Maybe [Exp])
- data FunName = FunName Name [Name] (Maybe Name)
- data FunBody = FunBody [Name] Bool Block
- data FunCall
- data FunArg
Documentation
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 | ; |
data TableField Source
A block is list of statements with optional return statement.
NormalFunCall PrefixExp FunArg | prefixexp ( funarg ) |
MethodCall PrefixExp Name FunArg | prefixexp : name ( funarg ) |