remedy-lua 0.1.2

A Lua 5.4 superset in safe Rust for running untrusted scripts: exact fuel, memory and depth limits, an incremental collector, an optional typed dialect and a capability-based host API.
Documentation
math.abs(math.mininteger)
math.fmod(5, 0)
math.fmod(5.0, 0)
math.fmod(math.mininteger, -1)
math.fmod(-6, 4)
math.fmod(6, -4.0)
math.floor(-0.0)
math.ceil(2^63)
math.floor(-2^63)
math.tointeger("8")
math.tointeger(3.5)
math.tointeger(2^53)
math.ult(-1, 1)
math.max(1, 2.0)
math.max()
math.min(0.0, -0.0)
math.modf(3.7)
math.modf(-3.7)
math.modf(math.huge)
math.modf(-math.huge)
math.modf(5)
math.log(8, 2)
math.log(100, 10)
math.log(27, 3)
math.log(0)
math.exp(1)
math.sqrt(-1)
math.type("1")
math.type(1//1)
math.random(0)~=nil
math.random(3, 1)
math.random(1, 2, 3)
math.random(math.mininteger, math.maxinteger)~=nil
(function() math.randomseed(42); return math.random(1,100), math.random(), math.random(0) end)()
(function() math.randomseed(42, 7); return math.random(1,1000000) end)()
(function() math.randomseed(1.5); return math.random(1,1000000) end)()
math.randomseed(3)
math.atan(1, -1)
math.atan(1)
math.frexp(8)
math.ldexp(1, 3)
math.ldexp(1, 3.5)
math.pow(2, 0.5)
math.log10(1000)
math.cosh(1), math.sinh(1), math.tanh(1)
math.deg(math.pi), math.rad(180)
math.abs(-0.0)
math.floor(3.5), math.ceil(-3.5)
math.floor("3.5")
math.abs("x")
3 // 0
3.0 // 0
-3 % 0.0
math.mininteger // -1
math.mininteger % -1
1e308 * 10
string.format("%5.2f|%-5d|%+d|%x|%X|%o|%e|%g|%a", 3.14159, 42, 5, 255, 255, 8, 12345.678, 0.0001, 1)
string.format("%q", 1/0)
string.format("%q", 0/0)
string.format("%q", math.mininteger)
string.format("%q", "a\0b\r\n\"\\\200")
string.format("%q", 0.1)
string.format("%10.3s|", "abcdef")
string.format("%c%c", 65, 0)
string.format("%i", 3.0)
string.format("%d", 3.5)
string.format("%5%")
string.format("%")
string.format("%y", 1)
string.format("%100d", 1)
string.format("%99d", 1)
string.format("%.99f", 1)
string.format("%s", setmetatable({}, {__tostring=function() return "X" end}))
string.format("%s %s", 1)
string.format("%-#10x|%#o", 255, 8)
string.format("% d", 5)
string.format("%05.1f", -2.5)
string.format("%.3q", "a")
string.format("%q", {})
string.format("%s", 1.0)
string.format("%d", "10")
string.format("%x", -1)
string.format("%.0f", 0.5)
string.format("%g", 1e20), string.format("%g", 1e-5)
string.format("%.14g", 2^53)
string.format("%a", 0.5)
string.format("%A", -1.75)
string.format("%e", 0/0)
string.format("%f", 1/0), string.format("%f", -1/0)
string.format("%5s", "\0a")
string.rep("ab", 3, ",")
string.rep("x", 0)
string.rep("x", -1)
string.rep("", 1e9)
string.rep("x", 2, "")
string.sub("hello", -3)
string.sub("hello", 2, -2)
string.sub("hello", 0)
string.sub("hello", math.mininteger, math.maxinteger)
string.sub("hello", 3.0)
string.sub("hello", 3.5)
string.byte("hello", -1)
string.byte("hello", 1, -1)
string.byte("", 1)
string.byte("abc", 0)
string.char()
string.char(256)
string.char(-1)
string.reverse("abc")
string.upper("aBc\200")
string.lower("ÀB")
string.len("\0\0")
("x"):rep(3)
#"abc" + "2"
"10" + 1
"0x10" + 0
"1e2" * 1
"10" // "3"
"3" | 0
"3.0" | 0
"3.5" | 0
" 10 " + 0
"abc" + 1
10 .. 20
1.5 .. ""
-0.0 .. ""
2^63 .. ""
math.mininteger .. ""
1e100 .. ""
tostring(1e15), tostring(1e16), tostring(-1e15)
tostring(0/0), tostring(-(0/0))
tostring(2^24), tostring(123456789012.0)
string.find("abc", "b", 1, true)
string.find("abc", "", 10)
string.find("abc", "", 4)
string.find("abc", "", 3)
string.find("a.b", ".", 1, true)
string.find("abc", "(b)(c)")
string.find("abc", "b", -1)
string.find("abc", "b", -10)
string.match("key = value", "(%w+)%s*=%s*(%w+)")
string.match("hello", "()ll()")
string.match("  x", "^%s*(.-)%s*$")
string.match("abc", "%f[%w]%w+")
string.match("THE (quick) fox", "%((%a+)%)")
string.match("abc", "[%a-]+")
string.match("a]b", "[]]")
string.match("a^b", "[%^]")
string.match("abc", "[^a]+")
string.match("x", "%")
string.match("x", "[a")
string.match("x", "(()")
string.match("x", "%1")
string.match("aa", "(a)%1")
string.match("x", "%b")
string.match("(a(b)c)", "%b()")
string.match("abc", ".-b")
string.match("abc", "a*?")
string.match("\0abc", "%z")
string.match("hello world", "%g+")
string.match("x", "%q")
string.gsub("hello world", "o", "0")
string.gsub("hello", "", "-")
string.gsub("abc", "%w", "%0%0")
string.gsub("abc", "%w", "%1")
string.gsub("abc", "(%w)", "%2")
string.gsub("abc", "%w", "%")
string.gsub("abc", "%w", "%x")
string.gsub("abc", "b", {b = false})
string.gsub("abc", "b", {b = 1.5})
string.gsub("abc", "b", {b = {}})
string.gsub("abc", "b", function() return nil end)
string.gsub("abc", ".", "x", 2)
string.gsub("abc", ".", "x", -1)
string.gsub("abc", ".", "x", 2.5)
string.gsub("abc", ".", 1)
string.gsub("abc", ".", true)
string.gsub("abc", "^.", "x")
string.gsub("a,b,,c", ",", ";")
(function() local t = {} for k, v in string.gmatch("a=1, b=2", "(%w+)=(%w+)") do t[#t+1]=k..v end return table.concat(t, " ") end)()
(function() local t = {} for w in string.gmatch("one two", "%a+", 3) do t[#t+1]=w end return table.concat(t, " ") end)()
(function() local t = {} for w in string.gmatch("abc", "") do t[#t+1]="["..w.."]" end return table.concat(t) end)()
(function() local t = {} for a in string.gmatch("abc", "()") do t[#t+1]=a end return table.concat(t, ",") end)()
(function() local t = {} for w in string.gmatch("abc", "^a") do t[#t+1]=w end return #t end)()
string.pack("i4", 100):byte(1, -1)
string.pack(">i2", 1):byte(1, -1)
string.pack("z", "ab"):byte(1, -1)
string.pack("s1", "ab"):byte(1, -1)
string.pack("d", 1.5):len()
string.pack("j", 1):len()
string.pack("i17", 1)
string.pack("i0", 1)
string.pack("i1", 200)
string.pack("I1", -1)
string.pack("!4 i1 i4", 1, 2):len()
string.pack("<i3", -2):byte(1, -1)
string.pack("f", 1/3):len()
string.pack("c3", "ab"):byte(1, -1)
string.pack("c2", "abc")
string.pack("Xi4")
string.pack("b x h", 1, 2):len()
string.unpack("<i4", "\1\0\0\0")
string.unpack("<i2", "\255\255")
string.unpack("<I2", "\255\255")
string.unpack("z", "ab\0c")
string.unpack("s1", "\2abc")
string.unpack("i4", "abc")
string.unpack("b", "a", 2)
string.unpack("b", "a", 3)
string.unpack("b", "a", -1)
string.unpack("<i9", "\1\0\0\0\0\0\0\0\0")
string.unpack("<i9", "\1\0\0\0\0\0\0\0\1")
string.unpack("<I16", string.rep("\255", 8)..string.rep("\0", 8))
string.packsize("i4i8")
string.packsize("!8 i1 i8")
string.packsize("s")
string.packsize("z")
string.packsize("c0")
string.unpack(">d", string.pack(">d", -0.5))
string.pack("=I4", 0xdeadbeef):byte(1, -1)
string.pack("j", math.mininteger) == string.pack("J", math.mininteger)
string.pack(" < i 2 ", 3):byte(1, -1)
string.pack("!3i4", 1)
string.pack("!16 d", 1):len()
string.pack("i4 Xi8 i1", 1, 2):len()
string.pack("Xz", 1)
string.unpack("j", string.pack("n", 1.0)) ~= nil
string.unpack("c0", "")