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
10
11
12
13
14
-- v2.11 CORPUS-II: nested table flatten via recursion.
local function flatten(t, out)
  out = out or {}
  for _, v in ipairs(t) do
    if type(v) == "table" then
      flatten(v, out)
    else
      out[#out+1] = v
    end
  end
  return out
end
local f = flatten({1, {2, 3}, {{4, 5}}, 6})
print(table.concat(f, ","))