1
0
Fork 0
mirror of https://github.com/Reuh/candran.git synced 2025-10-27 17:59:30 +00:00

Added push, table comprehension, fixed stuff

* Implicit returns are now implicit pushes
* Candran keywords can be used as variable name
* Better handling of continue
* Moar newlines in output
This commit is contained in:
Étienne Fildadut 2017-08-25 17:09:52 +02:00
parent 20e33c279e
commit 6b95bfb698
6 changed files with 1331 additions and 425 deletions

View file

@ -40,27 +40,6 @@ local a = new Thing()
->
(TODO: define how classes work. May even use ClassCommons)
* list comprehension
local a = [x for x in pairs(stuff)]
local a = [x for x in pairs(stuff) if x == true]
local a = [x for x in pairs(stuff) if x == true for...]
local a = x for x in pairs(stuff)
local a = for x in pairs(stuff) do x end
local no_color = {k,v for k,v in pairs(thing) if k ~= "color"}
local a = (x if x == true)
* expressions flow decorators
foo() while condition end
->
(function()
while condition do
return foo()
end
end)()
foo() if stuff > other end
* try / except|catch / finally / else / other keywords
try
error("hey")