luna-core 2.13.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
-- v2.13 CORPUS-IV: setmetatable(t, nil) clears; returns t itself.
local mt = { __index = function() return "x" end }
local t = setmetatable({}, mt)
print(t.missing)
local same = setmetatable(t, nil)
print(same == t, getmetatable(t), t.missing)
-- setmetatable rejects non-table/non-nil second arg
print((pcall(setmetatable, {}, 42)))
print((pcall(setmetatable, {}, "mt")))