Exemplo n.º 1
0
func printStackTypes(state *lua.State) {
	topIndex := state.GetTop()
	segments := make([]interface{}, topIndex+1)
	segments[0] = "Stack types:"
	for i := 1; i <= topIndex; i++ {
		segments[i] = state.LTypename(i)
	}
	log.Println(segments...)
}
Exemplo n.º 2
0
Arquivo: luar.go Projeto: imvu/Tetra
// A new LuaObject from stack index.
func NewLuaObject(L *lua.State, idx int) *LuaObject {
	tp := L.LTypename(idx)
	L.PushValue(idx)
	ref := L.Ref(lua.LUA_REGISTRYINDEX)
	return &LuaObject{L, ref, tp}
}