luna-core 2.12.0

Pure-Rust Lua runtime (interpreter only, zero third-party dependencies). The JIT-equipped variant lives in the `luna-jit` crate.
Documentation
1
2
3
4
5
6
7
8
9
10
-- v2.11 CORPUS-II: closure over tbc variable.
local function make()
  local x <close> = setmetatable({v=42}, {__close = function() end})
  return function() return x.v end
end
-- Note: closure escapes scope of tbc, but x is captured before close
-- fires. Lua semantic: x still valid to reference via closure after
-- the do-end, but if __close mutated it we'd see the change.
local f = make()
print(f())  -- 42