1 Star 0 Fork 0

ai/golua

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
coro.go 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
Adam Reese 提交于 2018-11-15 15:45 +08:00 . fix(*): run gofmt
package coro
import (
"fmt"
"github.com/Azure/golua/lua"
)
//
// Lua Standard Library -- coroutine
//
func Open(state *lua.State) int {
// Create 'coroutine' table.
var coroutineFuncs = map[string]lua.Func{
"create": lua.Func(coroutineCreate),
"resume": lua.Func(coroutineResume),
"running": lua.Func(coroutineRunning),
"status": lua.Func(coroutineStatus),
"wrap": lua.Func(coroutineWrap),
"yield": lua.Func(coroutineYield),
"isyieldable": lua.Func(coroutineIsYieldable),
}
state.NewTableSize(0, 7)
state.SetFuncs(coroutineFuncs, 0)
// Return 'coroutine' table.
return 1
}
func coroutineCreate(state *lua.State) int {
unimplemented("coroutine")
return 0
}
func coroutineResume(state *lua.State) int {
unimplemented("coroutine")
return 0
}
func coroutineRunning(state *lua.State) int {
unimplemented("coroutine")
return 0
}
func coroutineStatus(state *lua.State) int {
unimplemented("coroutine")
return 0
}
func coroutineWrap(state *lua.State) int {
unimplemented("coroutine")
return 0
}
func coroutineYield(state *lua.State) int {
unimplemented("coroutine")
return 0
}
func coroutineIsYieldable(state *lua.State) int {
unimplemented("coroutine")
return 0
}
func unimplemented(msg string) { panic(fmt.Errorf(msg)) }
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/aiwep/golua.git
git@gitee.com:aiwep/golua.git
aiwep
golua
golua
4ee7f28eeb95

搜索帮助