Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Lua 5.3 syntax tree, as specified in http://www.lua.org/manual/5.3/manual.html#9. Annotation implementation is inspired by haskell-src-exts.
- data Name a = Name a Text
- 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
- = Neg a
- | Not a
- | Len a
- | Complement 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
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 | ; |
Neg a | |
Not a | |
Len a | |
Complement a |
Table a [TableField a] | list of table fields |
data TableField a Source #
Functor TableField Source # | |
Annotated TableField Source # | |
Eq a => Eq (TableField a) Source # | |
Data a => Data (TableField a) Source # | |
Show a => Show (TableField a) Source # | |
Generic (TableField a) Source # | |
NFData a => NFData (TableField a) Source # | |
type Rep (TableField a) Source # | |
A block is list of statements with optional return statement.
NormalFunCall a (PrefixExp a) (FunArg a) | prefixexp ( funarg ) |
MethodCall a (PrefixExp a) (Name a) (FunArg a) | prefixexp : name ( funarg ) |
class Functor ast => Annotated ast where Source #
Retrieve the annotation of an AST node.
amap :: (l -> l) -> ast l -> ast l Source #
Change the annotation of an AST node. Note that only the annotation of
the node itself is affected, and not the annotations of any child nodes.
if all nodes in the AST tree are to be affected, use fmap
.