Lua.VM (Lua v1.0.0-rc.3)

View Source

Public API for the Lua Virtual Machine.

Executes compiled Lua prototypes.

Summary

Functions

execute(proto, state \\ State.new(), opts \\ [])

@spec execute(Lua.Compiler.Prototype.t(), Lua.VM.State.t(), keyword()) ::
  {:ok, list(), Lua.VM.State.t()}

Executes a compiled prototype.

Returns {:ok, results, state} on success.

Options

  • :reset_instructions - (default true) reset the :max_instructions instruction tally to 0 before executing. True at a genuine top-level evaluation (Lua.eval/eval!). Internal re-entries that run mid-evaluation — notably require, which loads and runs a module's chunk through this function — must pass false so the module body accumulates against the one per-evaluation budget instead of resetting it.