Lua.AST.Statement.FuncDecl (Lua v1.0.0-rc.1)

View Source

Represents a function declaration: function name(params) body end

The name can be a path for nested names:

  • function foo() end -> name: ["foo"], is_method: false
  • function a.b.c() end -> name: ["a", "b", "c"], is_method: false
  • function obj:method() end -> name: ["obj", "method"], is_method: true

When is_method is true, an implicit self parameter is added.

Summary

Types

t()

@type t() :: %Lua.AST.Statement.FuncDecl{
  body: Lua.AST.Block.t(),
  is_method: boolean(),
  meta: Lua.AST.Meta.t() | nil,
  name: [String.t()],
  params: [Lua.AST.Expr.Function.param()]
}