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
-- v2.10 CORPUS: recursive local functions.
local function fact(n)
  if n <= 1 then return 1 end
  return n * fact(n - 1)
end
print(fact(5), fact(10))

-- mutual recursion via forward-decl
local iseven, isodd
iseven = function(n) if n == 0 then return true else return isodd(n - 1) end end
isodd = function(n) if n == 0 then return false else return iseven(n - 1) end end
print(iseven(10), isodd(7))