mirror of https://github.com/Hilbis/Hilbish
Compare commits
5 Commits
4b5fcf24c2
...
23d18ef11c
Author | SHA1 | Date |
---|---|---|
TorchedSammy | 23d18ef11c | |
TorchedSammy | c05b1b6168 | |
TorchedSammy | 4f959c326a | |
TorchedSammy | 079bedc6dc | |
TorchedSammy | aa43515213 |
26
aliases.go
26
aliases.go
|
@ -9,40 +9,40 @@ import (
|
||||||
rt "github.com/arnodel/golua/runtime"
|
rt "github.com/arnodel/golua/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
var aliases *aliasHandler
|
var aliases *aliasModule
|
||||||
|
|
||||||
type aliasHandler struct {
|
type aliasModule struct {
|
||||||
aliases map[string]string
|
aliases map[string]string
|
||||||
mu *sync.RWMutex
|
mu *sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize aliases map
|
// initialize aliases map
|
||||||
func newAliases() *aliasHandler {
|
func newAliases() *aliasModule {
|
||||||
return &aliasHandler{
|
return &aliasModule{
|
||||||
aliases: make(map[string]string),
|
aliases: make(map[string]string),
|
||||||
mu: &sync.RWMutex{},
|
mu: &sync.RWMutex{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *aliasHandler) Add(alias, cmd string) {
|
func (a *aliasModule) Add(alias, cmd string) {
|
||||||
a.mu.Lock()
|
a.mu.Lock()
|
||||||
defer a.mu.Unlock()
|
defer a.mu.Unlock()
|
||||||
|
|
||||||
a.aliases[alias] = cmd
|
a.aliases[alias] = cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *aliasHandler) All() map[string]string {
|
func (a *aliasModule) All() map[string]string {
|
||||||
return a.aliases
|
return a.aliases
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *aliasHandler) Delete(alias string) {
|
func (a *aliasModule) Delete(alias string) {
|
||||||
a.mu.Lock()
|
a.mu.Lock()
|
||||||
defer a.mu.Unlock()
|
defer a.mu.Unlock()
|
||||||
|
|
||||||
delete(a.aliases, alias)
|
delete(a.aliases, alias)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *aliasHandler) Resolve(cmdstr string) string {
|
func (a *aliasModule) Resolve(cmdstr string) string {
|
||||||
a.mu.RLock()
|
a.mu.RLock()
|
||||||
defer a.mu.RUnlock()
|
defer a.mu.RUnlock()
|
||||||
|
|
||||||
|
@ -66,7 +66,9 @@ func (a *aliasHandler) Resolve(cmdstr string) string {
|
||||||
|
|
||||||
// lua section
|
// lua section
|
||||||
|
|
||||||
func (a *aliasHandler) Loader(rtm *rt.Runtime) *rt.Table {
|
// #interface
|
||||||
|
// ALIAS LOADER TEST
|
||||||
|
func (a *aliasModule) Loader(rtm *rt.Runtime) *rt.Table {
|
||||||
// create a lua module with our functions
|
// create a lua module with our functions
|
||||||
hshaliasesLua := map[string]util.LuaExport{
|
hshaliasesLua := map[string]util.LuaExport{
|
||||||
"add": util.LuaExport{hlalias, 2, false},
|
"add": util.LuaExport{hlalias, 2, false},
|
||||||
|
@ -81,7 +83,7 @@ func (a *aliasHandler) Loader(rtm *rt.Runtime) *rt.Table {
|
||||||
return mod
|
return mod
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *aliasHandler) luaList(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
func (a *aliasModule) luaList(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
aliasesList := rt.NewTable()
|
aliasesList := rt.NewTable()
|
||||||
for k, v := range a.All() {
|
for k, v := range a.All() {
|
||||||
aliasesList.Set(rt.StringValue(k), rt.StringValue(v))
|
aliasesList.Set(rt.StringValue(k), rt.StringValue(v))
|
||||||
|
@ -90,7 +92,7 @@ func (a *aliasHandler) luaList(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
return c.PushingNext1(t.Runtime, rt.TableValue(aliasesList)), nil
|
return c.PushingNext1(t.Runtime, rt.TableValue(aliasesList)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *aliasHandler) luaDelete(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
func (a *aliasModule) luaDelete(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
if err := c.Check1Arg(); err != nil {
|
if err := c.Check1Arg(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -103,7 +105,7 @@ func (a *aliasHandler) luaDelete(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
return c.Next(), nil
|
return c.Next(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *aliasHandler) luaResolve(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
func (a *aliasModule) luaResolve(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
if err := c.Check1Arg(); err != nil {
|
if err := c.Check1Arg(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
8
api.go
8
api.go
|
@ -159,10 +159,10 @@ func hilbishLoad(rtm *rt.Runtime) (rt.Value, func()) {
|
||||||
mod.Set(rt.StringValue("jobs"), rt.TableValue(jobModule))
|
mod.Set(rt.StringValue("jobs"), rt.TableValue(jobModule))
|
||||||
|
|
||||||
// hilbish.timers table
|
// hilbish.timers table
|
||||||
timers = newTimerHandler()
|
timers = newTimersModule()
|
||||||
timerModule := timers.loader(rtm)
|
timersModule := timers.loader(rtm)
|
||||||
util.Document(timerModule, "Timer interface, for control of all intervals and timeouts.")
|
util.Document(timersModule, "Timer interface, for control of all intervals and timeouts.")
|
||||||
mod.Set(rt.StringValue("timers"), rt.TableValue(timerModule))
|
mod.Set(rt.StringValue("timers"), rt.TableValue(timersModule))
|
||||||
|
|
||||||
editorModule := editorLoader(rtm)
|
editorModule := editorLoader(rtm)
|
||||||
util.Document(editorModule, "")
|
util.Document(editorModule, "")
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"go/token"
|
"go/token"
|
||||||
"strings"
|
"strings"
|
||||||
"os"
|
"os"
|
||||||
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
var header = `---
|
var header = `---
|
||||||
|
@ -29,6 +30,7 @@ type module struct {
|
||||||
Docs []docPiece
|
Docs []docPiece
|
||||||
ShortDescription string
|
ShortDescription string
|
||||||
Description string
|
Description string
|
||||||
|
Interface bool
|
||||||
}
|
}
|
||||||
type docPiece struct {
|
type docPiece struct {
|
||||||
Doc []string
|
Doc []string
|
||||||
|
@ -36,6 +38,56 @@ type docPiece struct {
|
||||||
FuncName string
|
FuncName string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var docs = make(map[string]module)
|
||||||
|
var emmyDocs = make(map[string][]emmyPiece)
|
||||||
|
var prefix = map[string]string{
|
||||||
|
"main": "hl",
|
||||||
|
"hilbish": "hl",
|
||||||
|
"fs": "f",
|
||||||
|
"commander": "c",
|
||||||
|
"bait": "b",
|
||||||
|
"terminal": "term",
|
||||||
|
}
|
||||||
|
|
||||||
|
func setupDoc(mod string, fun *doc.Func) *docPiece {
|
||||||
|
if !strings.HasPrefix(fun.Name, "hl") && mod == "main" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if !strings.HasPrefix(fun.Name, prefix[mod]) || fun.Name == "Loader" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
parts := strings.Split(strings.TrimSpace(fun.Doc), "\n")
|
||||||
|
funcsig := parts[0]
|
||||||
|
doc := parts[1:]
|
||||||
|
funcdoc := []string{}
|
||||||
|
em := emmyPiece{FuncName: strings.TrimPrefix(fun.Name, prefix[mod])}
|
||||||
|
for _, d := range doc {
|
||||||
|
if strings.HasPrefix(d, "---") {
|
||||||
|
emmyLine := strings.TrimSpace(strings.TrimPrefix(d, "---"))
|
||||||
|
emmyLinePieces := strings.Split(emmyLine, " ")
|
||||||
|
emmyType := emmyLinePieces[0]
|
||||||
|
if emmyType == "@param" {
|
||||||
|
em.Params = append(em.Params, emmyLinePieces[1])
|
||||||
|
}
|
||||||
|
if emmyType == "@vararg" {
|
||||||
|
em.Params = append(em.Params, "...") // add vararg
|
||||||
|
}
|
||||||
|
em.Docs = append(em.Docs, d)
|
||||||
|
} else {
|
||||||
|
funcdoc = append(funcdoc, d)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dps := docPiece{
|
||||||
|
Doc: funcdoc,
|
||||||
|
FuncSig: funcsig,
|
||||||
|
FuncName: strings.TrimPrefix(fun.Name, prefix[mod]),
|
||||||
|
}
|
||||||
|
|
||||||
|
emmyDocs[mod] = append(emmyDocs[mod], em)
|
||||||
|
return &dps
|
||||||
|
}
|
||||||
|
|
||||||
// feel free to clean this up
|
// feel free to clean this up
|
||||||
// it works, dont really care about the code
|
// it works, dont really care about the code
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -65,88 +117,22 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prefix := map[string]string{
|
|
||||||
"hilbish": "hl",
|
|
||||||
"fs": "f",
|
|
||||||
"commander": "c",
|
|
||||||
"bait": "b",
|
|
||||||
"terminal": "term",
|
|
||||||
}
|
|
||||||
docs := make(map[string]module)
|
|
||||||
emmyDocs := make(map[string][]emmyPiece)
|
|
||||||
|
|
||||||
for l, f := range pkgs {
|
for l, f := range pkgs {
|
||||||
p := doc.New(f, "./", doc.AllDecls)
|
p := doc.New(f, "./", doc.AllDecls)
|
||||||
pieces := []docPiece{}
|
pieces := []docPiece{}
|
||||||
mod := l
|
mod := l
|
||||||
for _, t := range p.Funcs {
|
for _, t := range p.Funcs {
|
||||||
if strings.HasPrefix(t.Name, "hl") { mod = "hilbish" }
|
piece := setupDoc(mod, t)
|
||||||
if !strings.HasPrefix(t.Name, "hl") && l == "main" { continue }
|
if piece != nil {
|
||||||
if !strings.HasPrefix(t.Name, prefix[mod]) || t.Name == "Loader" { continue }
|
pieces = append(pieces, *piece)
|
||||||
parts := strings.Split(strings.TrimSpace(t.Doc), "\n")
|
|
||||||
funcsig := parts[0]
|
|
||||||
doc := parts[1:]
|
|
||||||
funcdoc := []string{}
|
|
||||||
em := emmyPiece{FuncName: strings.TrimPrefix(t.Name, prefix[mod])}
|
|
||||||
for _, d := range doc {
|
|
||||||
if strings.HasPrefix(d, "---") {
|
|
||||||
emmyLine := strings.TrimSpace(strings.TrimPrefix(d, "---"))
|
|
||||||
emmyLinePieces := strings.Split(emmyLine, " ")
|
|
||||||
emmyType := emmyLinePieces[0]
|
|
||||||
if emmyType == "@param" {
|
|
||||||
em.Params = append(em.Params, emmyLinePieces[1])
|
|
||||||
}
|
|
||||||
if emmyType == "@vararg" {
|
|
||||||
em.Params = append(em.Params, "...") // add vararg
|
|
||||||
}
|
|
||||||
em.Docs = append(em.Docs, d)
|
|
||||||
} else {
|
|
||||||
funcdoc = append(funcdoc, d)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dps := docPiece{
|
|
||||||
Doc: funcdoc,
|
|
||||||
FuncSig: funcsig,
|
|
||||||
FuncName: strings.TrimPrefix(t.Name, prefix[mod]),
|
|
||||||
}
|
|
||||||
|
|
||||||
pieces = append(pieces, dps)
|
|
||||||
emmyDocs[mod] = append(emmyDocs[mod], em)
|
|
||||||
}
|
}
|
||||||
for _, t := range p.Types {
|
for _, t := range p.Types {
|
||||||
for _, m := range t.Methods {
|
for _, m := range t.Methods {
|
||||||
if !strings.HasPrefix(t.Name, "hl") && l == "main" { continue }
|
piece := setupDoc(mod, m)
|
||||||
if !strings.HasPrefix(m.Name, prefix[l]) || m.Name == "Loader" { continue }
|
if piece != nil {
|
||||||
parts := strings.Split(strings.TrimSpace(m.Doc), "\n")
|
pieces = append(pieces, *piece)
|
||||||
funcsig := parts[0]
|
|
||||||
doc := parts[1:]
|
|
||||||
funcdoc := []string{}
|
|
||||||
em := emmyPiece{FuncName: strings.TrimPrefix(m.Name, prefix[l])}
|
|
||||||
for _, d := range doc {
|
|
||||||
if strings.HasPrefix(d, "---") {
|
|
||||||
emmyLine := strings.TrimSpace(strings.TrimPrefix(d, "---"))
|
|
||||||
emmyLinePieces := strings.Split(emmyLine, " ")
|
|
||||||
emmyType := emmyLinePieces[0]
|
|
||||||
if emmyType == "@param" {
|
|
||||||
em.Params = append(em.Params, emmyLinePieces[1])
|
|
||||||
}
|
|
||||||
if emmyType == "@vararg" {
|
|
||||||
em.Params = append(em.Params, "...") // add vararg
|
|
||||||
}
|
|
||||||
em.Docs = append(em.Docs, d)
|
|
||||||
} else {
|
|
||||||
funcdoc = append(funcdoc, d)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
dps := docPiece{
|
|
||||||
Doc: funcdoc,
|
|
||||||
FuncSig: funcsig,
|
|
||||||
FuncName: strings.TrimPrefix(m.Name, prefix[l]),
|
|
||||||
}
|
|
||||||
|
|
||||||
pieces = append(pieces, dps)
|
|
||||||
emmyDocs[l] = append(emmyDocs[l], em)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,39 +146,52 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for mod, v := range docs {
|
var wg sync.WaitGroup
|
||||||
if mod == "main" { continue }
|
wg.Add(len(docs) * 2)
|
||||||
f, _ := os.Create("docs/api/" + mod + ".md")
|
|
||||||
f.WriteString(fmt.Sprintf(header, mod, v.ShortDescription))
|
|
||||||
f.WriteString(fmt.Sprintf("## Introduction\n%s\n\n## Functions\n", v.Description))
|
|
||||||
for _, dps := range v.Docs {
|
|
||||||
f.WriteString(fmt.Sprintf("### %s\n", dps.FuncSig))
|
|
||||||
for _, doc := range dps.Doc {
|
|
||||||
if !strings.HasPrefix(doc, "---") {
|
|
||||||
f.WriteString(doc + "\n")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
f.WriteString("\n")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for mod, v := range emmyDocs {
|
for mod, v := range docs {
|
||||||
if mod == "main" { continue }
|
modN := mod
|
||||||
f, _ := os.Create("emmyLuaDocs/" + mod + ".lua")
|
if mod == "main" {
|
||||||
f.WriteString("--- @meta\n\nlocal " + mod + " = {}\n\n")
|
modN = "hilbish"
|
||||||
for _, em := range v {
|
|
||||||
var funcdocs []string
|
|
||||||
for _, dps := range docs[mod].Docs {
|
|
||||||
if dps.FuncName == em.FuncName {
|
|
||||||
funcdocs = dps.Doc
|
|
||||||
}
|
|
||||||
}
|
|
||||||
f.WriteString("--- " + strings.Join(funcdocs, "\n--- ") + "\n")
|
|
||||||
if len(em.Docs) != 0 {
|
|
||||||
f.WriteString(strings.Join(em.Docs, "\n") + "\n")
|
|
||||||
}
|
|
||||||
f.WriteString("function " + mod + "." + em.FuncName + "(" + strings.Join(em.Params, ", ") + ") end\n\n")
|
|
||||||
}
|
}
|
||||||
f.WriteString("return " + mod + "\n")
|
|
||||||
|
go func(modName string, modu module) {
|
||||||
|
defer wg.Done()
|
||||||
|
|
||||||
|
f, _ := os.Create("docs/api/" + modName + ".md")
|
||||||
|
f.WriteString(fmt.Sprintf(header, modName, modu.ShortDescription))
|
||||||
|
f.WriteString(fmt.Sprintf("## Introduction\n%s\n\n## Functions\n", modu.Description))
|
||||||
|
for _, dps := range modu.Docs {
|
||||||
|
f.WriteString(fmt.Sprintf("### %s\n", dps.FuncSig))
|
||||||
|
for _, doc := range dps.Doc {
|
||||||
|
if !strings.HasPrefix(doc, "---") {
|
||||||
|
f.WriteString(doc + "\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
f.WriteString("\n")
|
||||||
|
}
|
||||||
|
}(modN, v)
|
||||||
|
|
||||||
|
go func(md, modName string) {
|
||||||
|
defer wg.Done()
|
||||||
|
|
||||||
|
ff, _ := os.Create("emmyLuaDocs/" + modName + ".lua")
|
||||||
|
ff.WriteString("--- @meta\n\nlocal " + modName + " = {}\n\n")
|
||||||
|
for _, em := range emmyDocs[md] {
|
||||||
|
funcdocs := []string{}
|
||||||
|
for _, dps := range docs[md].Docs {
|
||||||
|
if dps.FuncName == em.FuncName {
|
||||||
|
funcdocs = dps.Doc
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ff.WriteString("--- " + strings.Join(funcdocs, "\n--- ") + "\n")
|
||||||
|
if len(em.Docs) != 0 {
|
||||||
|
ff.WriteString(strings.Join(em.Docs, "\n") + "\n")
|
||||||
|
}
|
||||||
|
ff.WriteString("function " + modName + "." + em.FuncName + "(" + strings.Join(em.Params, ", ") + ") end\n\n")
|
||||||
|
}
|
||||||
|
ff.WriteString("return " + modName + "\n")
|
||||||
|
}(mod, modN)
|
||||||
}
|
}
|
||||||
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
2
timer.go
2
timer.go
|
@ -21,7 +21,7 @@ type timer struct{
|
||||||
running bool
|
running bool
|
||||||
dur time.Duration
|
dur time.Duration
|
||||||
fun *rt.Closure
|
fun *rt.Closure
|
||||||
th *timerHandler
|
th *timersModule
|
||||||
ticker *time.Ticker
|
ticker *time.Ticker
|
||||||
ud *rt.UserData
|
ud *rt.UserData
|
||||||
channel chan struct{}
|
channel chan struct{}
|
||||||
|
|
|
@ -10,10 +10,10 @@ import (
|
||||||
rt "github.com/arnodel/golua/runtime"
|
rt "github.com/arnodel/golua/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
var timers *timerHandler
|
var timers *timersModule
|
||||||
var timerMetaKey = rt.StringValue("hshtimer")
|
var timerMetaKey = rt.StringValue("hshtimer")
|
||||||
|
|
||||||
type timerHandler struct {
|
type timersModule struct {
|
||||||
mu *sync.RWMutex
|
mu *sync.RWMutex
|
||||||
wg *sync.WaitGroup
|
wg *sync.WaitGroup
|
||||||
timers map[int]*timer
|
timers map[int]*timer
|
||||||
|
@ -21,8 +21,8 @@ type timerHandler struct {
|
||||||
running int
|
running int
|
||||||
}
|
}
|
||||||
|
|
||||||
func newTimerHandler() *timerHandler {
|
func newTimersModule() *timersModule {
|
||||||
return &timerHandler{
|
return &timersModule{
|
||||||
timers: make(map[int]*timer),
|
timers: make(map[int]*timer),
|
||||||
latestID: 0,
|
latestID: 0,
|
||||||
mu: &sync.RWMutex{},
|
mu: &sync.RWMutex{},
|
||||||
|
@ -30,11 +30,11 @@ func newTimerHandler() *timerHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (th *timerHandler) wait() {
|
func (th *timersModule) wait() {
|
||||||
th.wg.Wait()
|
th.wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (th *timerHandler) create(typ timerType, dur time.Duration, fun *rt.Closure) *timer {
|
func (th *timersModule) create(typ timerType, dur time.Duration, fun *rt.Closure) *timer {
|
||||||
th.mu.Lock()
|
th.mu.Lock()
|
||||||
defer th.mu.Unlock()
|
defer th.mu.Unlock()
|
||||||
|
|
||||||
|
@ -54,14 +54,14 @@ func (th *timerHandler) create(typ timerType, dur time.Duration, fun *rt.Closure
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
func (th *timerHandler) get(id int) *timer {
|
func (th *timersModule) get(id int) *timer {
|
||||||
th.mu.RLock()
|
th.mu.RLock()
|
||||||
defer th.mu.RUnlock()
|
defer th.mu.RUnlock()
|
||||||
|
|
||||||
return th.timers[id]
|
return th.timers[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (th *timerHandler) luaCreate(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
func (th *timersModule) luaCreate(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
if err := c.CheckNArgs(3); err != nil {
|
if err := c.CheckNArgs(3); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ func (th *timerHandler) luaCreate(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
return c.PushingNext1(t.Runtime, rt.UserDataValue(tmr.ud)), nil
|
return c.PushingNext1(t.Runtime, rt.UserDataValue(tmr.ud)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (th *timerHandler) luaGet(thr *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
func (th *timersModule) luaGet(thr *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
if err := c.Check1Arg(); err != nil {
|
if err := c.Check1Arg(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ func (th *timerHandler) luaGet(thr *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
return c.Next(), nil
|
return c.Next(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (th *timerHandler) loader(rtm *rt.Runtime) *rt.Table {
|
func (th *timersModule) loader(rtm *rt.Runtime) *rt.Table {
|
||||||
timerMethods := rt.NewTable()
|
timerMethods := rt.NewTable()
|
||||||
timerFuncs := map[string]util.LuaExport{
|
timerFuncs := map[string]util.LuaExport{
|
||||||
"start": {timerStart, 1, false},
|
"start": {timerStart, 1, false},
|
||||||
|
|
Loading…
Reference in New Issue