gopher-lua
gopher-lua copied to clipboard
Incorrect behavior for string.gmatch
Gopher Lua version: 9d7d921 Go version: 1.21.0
Ran the following file:
local x = string.gmatch("asdf", "a")
print(x())
$ lua5.1 test.lua
a
$ glua test.lua
test.lua:2: bad argument #1 to x (userdata expected, got nil)
stack traceback:
[G]: in function 'x'
test.lua:2: in main chunk
[G]: ?
It seems like string.gmatch
produces a closure that expects some internal userdata. Thanks for your help!