Lua.AST.Chunk (Lua v1.0.0-rc.2)

View Source

Represents the top-level chunk (file or string) in Lua.

A chunk is essentially a block that represents a complete unit of Lua code.

Summary

Functions

Creates a new Chunk.

Types

t()

@type t() :: %Lua.AST.Chunk{block: Lua.AST.Block.t(), meta: Lua.AST.Meta.t() | nil}

Functions

new(block, meta \\ nil)

@spec new(Lua.AST.Block.t(), Lua.AST.Meta.t() | nil) :: t()

Creates a new Chunk.

Examples

iex> Lua.AST.Chunk.new(%Lua.AST.Block{stmts: []})
%Lua.AST.Chunk{block: %Lua.AST.Block{stmts: [], meta: nil}, meta: nil}