2024-07-17 12:39:44 +01:00
|
|
|
package main
|
|
|
|
|
2024-07-18 14:30:39 +01:00
|
|
|
import lualib "github.com/CompeyDev/lei/internal"
|
2024-07-17 16:44:41 +01:00
|
|
|
|
|
|
|
func main() {
|
2024-07-18 14:30:39 +01:00
|
|
|
lua := lualib.LNewState()
|
2024-07-18 17:34:27 +01:00
|
|
|
println("Lua VM Address: ", lua)
|
|
|
|
|
2024-07-18 14:30:39 +01:00
|
|
|
lualib.PushCClosureK(lua, func(L *lualib.LuaState) int32 {
|
2024-07-18 17:34:27 +01:00
|
|
|
println("hi from closure?")
|
2024-07-18 14:30:39 +01:00
|
|
|
return 0
|
|
|
|
}, "test", 0, nil)
|
2024-07-17 16:44:41 +01:00
|
|
|
|
2024-07-18 17:34:27 +01:00
|
|
|
if !lualib.IsCFunction(lua, 1) {
|
|
|
|
panic("CFunction was not correctly pushed onto stack")
|
|
|
|
}
|
2024-07-17 16:44:41 +01:00
|
|
|
}
|