I was attempting to run teal within gopher-lua - https://github.com/yuin/gopher-lua - and was running into a few odd errors. I was running the following scripts:
--addsub.tl
local addsub = {}
function addsub.add(a: number, b: number): number
return a + b
end
function addsub.sub(a: number, b: number): number
return a - b
end
return addsub
The code block i, node.decltype = i, decltype would cause a bubbling up error (since all the lua types were checked by Go) where i would occasionally be set to "decltype" (I have no idea why). The second edit is just a little check for 5.1, since Lua 5.1 doesn't have load, I added in loadstring if it detects that version. These 2 edits let this script run properly so that I can run teal in Golang, which is pretty neat.
Happy to fix up formatting or anything else - tonight is the first time I've ever used lua, so I'm not sure about conventions here.
Note: on my computer, not all tests pass. Made issue #521 about that. All the tests that pass in master repo also pass in this updated repo.
I was attempting to run teal within gopher-lua - https://github.com/yuin/gopher-lua - and was running into a few odd errors. I was running the following scripts:
The code block
i, node.decltype = i, decltype
would cause a bubbling up error (since all the lua types were checked by Go) wherei
would occasionally be set to "decltype" (I have no idea why). The second edit is just a little check for 5.1, since Lua 5.1 doesn't have load, I added in loadstring if it detects that version. These 2 edits let this script run properly so that I can run teal in Golang, which is pretty neat.Happy to fix up formatting or anything else - tonight is the first time I've ever used lua, so I'm not sure about conventions here.
Note: on my computer, not all tests pass. Made issue #521 about that. All the tests that pass in master repo also pass in this updated repo.