lua

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VM

type VM struct {
	State *lua.LState
}

VM has a single State field which holds a pointer to our lua VM state TODO: Implement VM pool to save on memory consumption

var LuaMachine VM

LuaMachine is a global var which points to our VM struct TODO: Replace the need for this with a channel and pool

func (VM) GetTable

func (v VM) GetTable() lua.LValue

GetTable pops a variable from the lua stack, then returns the next variable TODO: This is temporary. Need to figure out a better way to handle multiple return types

func (VM) LoadModule

func (v VM) LoadModule(lfunc string)

LoadModule takes a string containing lua code and executes it. Storing it in the lua global environment

func (VM) ParseTable

func (v VM) ParseTable(table *lua.LValue, lfunc string) string

ParseTable takes a lua table and lua function string, then executes the function with our table as a parameter. This is used for any table formatting/parsing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL