/ˈliɹ.ɪks/
llix is Lua interpreter, added the try-catch syntax.
try
if tonumber(io.read()) < 5 then
throw()
end
catch
io.stderr:write "Error\n"
end
You can annotate type of variable:
-- in comment, `T@ <varname> :: <type>`
local num = 3 -- T@ num :: number
-- yes, you fail
local notstr = 0 -- T@ notstr :: string
only allowed to annotate monomorphic type and can't do about functions' return value.
local t = {1, 2, 3, 4, 5}
local x = delim
for i = 1, #t do
if t[i] > 3 then
continue t[i]
end
end
end
print(x) -- prints `4' !!!
$ llix
llix - Lightweight Lua Interpreter eXtended (MoonScript version 0.4.0 on Lua 5.3)
> try
>> if tonumber(io.read()) < 5 then
>> throw()
>> end
>> print "foo"
>> catch
>> io.stderr:write "Error\n"
>> end
3
Error
>
$ luarocks install --local llix
or
$ git clone https://github.com/Nymphium/llix
$ cd llix
$ luarocks install --local make llix-build-1.rockspec
- Lua
$ grep -E '\b(TODO)|(XXX)\b' *