2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-07-15 15:22:03 +00:00
Hilbish/util/export.go
TorchedSammy 016a3a2ec7
refactor: start work on lua 5.4
lots of commented out code

ive found a go lua library which implements lua 5.4
and found an opportunity to start working on it.
this commit basically removes everything and just leaves
enough for the shell to be "usable" and able to start.
there are no builtins or libraries (besides the `hilbish` global)
2022-03-27 22:17:59 -04:00

18 lines
348 B
Go

package util
import (
rt "github.com/arnodel/golua/runtime"
)
type LuaExport struct {
Function rt.GoFunctionFunc
ArgNum int
Variadic bool
}
func SetExports(rtm *rt.Runtime, tbl *rt.Table, exports map[string]LuaExport) {
for name, export := range exports {
rtm.SetEnvGoFunc(tbl, name, export.Function, export.ArgNum, export.Variadic)
}
}