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

This commit is contained in:
Tyler
2020-07-09 21:01:29 -04:00
parent afb79eaceb
commit b52b38179a
32 changed files with 1798 additions and 302 deletions

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
}