镜像来自
https://github.com/Hilbis/Hilbish
synced 2025-07-15 15:22:03 +00:00
future plans: add the ability to use c lua (or luajit) with hilbish benefits? speed, i guess?
14 line
306 B
Go
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)
|
|
}
|
|
}
|