2
2
镜像来自 https://github.com/Hilbis/Hilbish synced 2025-07-15 15:22:03 +00:00
Hilbish/moonlight/export_golua.go
sammyette 4524c1451a
feat: add moonlight lua abstraction library
future plans: add the ability to use c lua
(or luajit) with hilbish

benefits? speed, i guess?
2024-07-19 16:54:15 -04:00

14 line
306 B
Go

package moonlight
type Export struct{
Function GoToLuaFunc
ArgNum int
Variadic bool
}
func (mlr *Runtime) SetExports(tbl *Table, exports map[string]Export) {
for name, export := range exports {
mlr.rt.SetEnvGoFunc(tbl.lt, name, mlr.GoFunction(export.Function), export.ArgNum, export.Variadic)
}
}