Lua.AST.Block (Lua v1.0.0-rc.1)
View SourceRepresents a block of statements in Lua.
A block is a sequence of statements that execute in order. Blocks create a new scope for local variables.
Summary
Functions
Creates a new Block.
Types
@type t() :: %Lua.AST.Block{ meta: Lua.AST.Meta.t() | nil, stmts: [Lua.AST.Statement.t()] }
Functions
@spec new([Lua.AST.Statement.t()], Lua.AST.Meta.t() | nil) :: t()
Creates a new Block.
Examples
iex> Lua.AST.Block.new([])
%Lua.AST.Block{stmts: [], meta: nil}
iex> Lua.AST.Block.new([], %Lua.AST.Meta{})
%Lua.AST.Block{stmts: [], meta: %Lua.AST.Meta{start: nil, end: nil, metadata: %{}}}