mirror of
https://github.com/CompeyDev/lei.git
synced 2024-12-12 12:50:42 +00:00
24 lines
513 B
Go
24 lines
513 B
Go
package main
|
|
|
|
import lualib "github.com/CompeyDev/lei/internal"
|
|
|
|
func main() {
|
|
lua := lualib.LNewState()
|
|
println("Lua VM Address: ", lua)
|
|
|
|
lualib.PushCFunction(lua, func(L *lualib.LuaState) int32 {
|
|
println("hi from closure?")
|
|
return 0
|
|
})
|
|
|
|
lualib.PushString(lua, "123")
|
|
lualib.PushNumber(lua, lualib.ToNumber(lua, 2))
|
|
|
|
if !lualib.IsCFunction(lua, 1) {
|
|
panic("CFunction was not correctly pushed onto stack")
|
|
}
|
|
|
|
if !lualib.IsNumber(lua, 3) {
|
|
panic("Number was not correctly pushed onto stack")
|
|
}
|
|
}
|