Major updates/patches, functionality, api
continuous-integration/drone/push Build is failing

This commit is contained in:
Tyler committed 2020-07-09 21:01:29 -04:00
1 parent afb79eaceb
commit b52b38179a
32 files changed
+1798 -302

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
package regexp
import (
lua "github.com/yuin/gopher-lua"
luar "layeh.com/gopher-luar"
"regexp"
)
func Loader(L *lua.LState) int {
// register functions to the table
mod := L.SetFuncs(L.NewTable(), exports)
// returns the module
L.Push(mod)
return 1
}
var exports = map[string]lua.LGFunction{
"MustCompile": compileFunc,
}
func compileFunc(L *lua.LState) int {
str := L.CheckString(1)
re := regexp.MustCompile(str)
L.Push(luar.New(L, re))
return 1
}