Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Language.Lua.Annotated.Syntax
Description
Lua 5.2 syntax tree, as specified in http://www.lua.org/manual/5.2/manual.html#9. Annotation implementation is inspired by haskell-src-exts.
- data Name a = Name a String
- data Stat a
- = Assign a [Var a] [Exp a]
- | FunCall a (FunCall a)
- | Label a (Name a)
- | Break a
- | Goto a (Name a)
- | Do a (Block a)
- | While a (Exp a) (Block a)
- | Repeat a (Block a) (Exp a)
- | If a [(Exp a, Block a)] (Maybe (Block a))
- | ForRange a (Name a) (Exp a) (Exp a) (Maybe (Exp a)) (Block a)
- | ForIn a [Name a] [Exp a] (Block a)
- | FunAssign a (FunName a) (FunBody a)
- | LocalFunAssign a (Name a) (FunBody a)
- | LocalAssign a [Name a] (Maybe [Exp a])
- | EmptyStat a
- data Exp a
- data Var a
- data Binop a
- data Unop a
- data PrefixExp a
- data Table a = Table a [TableField a]
- data TableField a
- data Block a = Block a [Stat a] (Maybe [Exp a])
- data FunName a = FunName a (Name a) [Name a] (Maybe (Name a))
- data FunDef a = FunDef a (FunBody a)
- data FunBody a = FunBody a [Name a] (Maybe a) (Block a)
- data FunCall a
- = NormalFunCall a (PrefixExp a) (FunArg a)
- | MethodCall a (PrefixExp a) (Name a) (FunArg a)
- data FunArg a
- class Functor ast => Annotated ast where
Documentation
Constructors
Assign a [Var a] [Exp a] | var1, var2 .. = exp1, exp2 .. |
FunCall a (FunCall a) | function call |
Label a (Name a) | label for goto |
Break a | break |
Goto a (Name a) | goto label |
Do a (Block a) | do .. end |
While a (Exp a) (Block a) | while .. do .. end |
Repeat a (Block a) (Exp a) | repeat .. until .. |
If a [(Exp a, Block a)] (Maybe (Block a)) | if .. then .. [elseif ..] [else ..] end |
ForRange a (Name a) (Exp a) (Exp a) (Maybe (Exp a)) (Block a) | for x=start, end [, step] do .. end |
ForIn a [Name a] [Exp a] (Block a) | for x in .. do .. end |
FunAssign a (FunName a) (FunBody a) | function <var> (..) .. end |
LocalFunAssign a (Name a) (FunBody a) | local function <var> (..) .. end |
LocalAssign a [Name a] (Maybe [Exp a]) | local var1, var2 .. = exp1, exp2 .. |
EmptyStat a | ; |
Constructors
Nil a | |
Bool a Bool | |
Number a String | |
String a String | |
Vararg a | ... |
EFunDef a (FunDef a) | function (..) .. end |
PrefixExp a (PrefixExp a) | |
TableConst a (Table a) | table constructor |
Binop a (Binop a) (Exp a) (Exp a) | binary operators, + - * ^ % .. <= >= == ~= and or |
Unop a (Unop a) (Exp a) | unary operators, - not # |
Constructors
Table a [TableField a] | list of table fields |
data TableField a Source
Constructors
ExpField a (Exp a) (Exp a) | [exp] = exp |
NamedField a (Name a) (Exp a) | name = exp |
Field a (Exp a) |
Instances
Functor TableField | |
Annotated TableField | |
Eq a => Eq (TableField a) | |
Data a => Data (TableField a) | |
Show a => Show (TableField a) | |
Typeable (* -> *) TableField |
A block is list of statements with optional return statement.
Constructors
NormalFunCall a (PrefixExp a) (FunArg a) | prefixexp ( funarg ) |
MethodCall a (PrefixExp a) (Name a) (FunArg a) | prefixexp : name ( funarg ) |