moonscript/tests/outputs/cond.lua

253 lines
3.3 KiB
Lua
Raw Normal View History

2011-05-23 08:16:49 +00:00
local you_cool = false
if cool then
if you_cool then
local _ = one
2011-05-23 08:16:49 +00:00
else
if eatdic then
local _ = yeah
2011-05-23 08:16:49 +00:00
else
local _ = two
_ = three
2011-05-23 08:16:49 +00:00
end
end
else
local _ = no
2011-05-23 08:16:49 +00:00
end
if cool then
local _ = no
2011-05-23 08:16:49 +00:00
end
if cool then
local _ = no
2011-05-23 08:16:49 +00:00
else
local _ = yes
2011-05-23 08:16:49 +00:00
end
if cool then
wow(cool)
else
noso(cool)
end
if working then
if cool then
if cool then
local _ = okay
2011-05-23 08:16:49 +00:00
else
local _ = what
2011-05-23 08:16:49 +00:00
end
else
local _ = nah
2011-05-23 08:16:49 +00:00
end
end
if yeah then
no(day)
elseif cool(me) then
okay(ya)
else
u(way)
end
if yeah then
no(dad)
else
if cool(you) then
okay(bah)
else
p(way)
end
end
if (function() end)() then
what(ever)
end
if nil then
flip(me)
else
it(be, rad)
end
if things(great) then
no(way)
elseif okay(sure) then
what(here)
end
if things then
no(chance)
elseif okay then
what(now)
end
if things then
yes(man)
elseif okay(person) then
hi(there)
else
hmm(sure)
end
if lets(go) then
print("greetings")
elseif "just us" then
print("will smith")
else
show(5555555)
2012-10-01 16:19:19 +00:00
end
do
local something = 10
if something then
print(something)
else
print("else")
end
end
local hello
do
local something = 10
if something then
hello = print(something)
else
hello = print("else")
end
end
hello = 5 + (function()
do
local something = 10
if something then
return print(something)
end
end
2012-10-01 19:30:16 +00:00
end)()
local z = false
if false then
local _ = one
else
do
local x = true
if x then
local _ = two
else
do
z = true
if z then
local _ = three
else
local _ = four
end
end
end
end
end
local out
if false then
out = one
else
do
local x = true
if x then
out = two
else
do
z = true
if z then
out = three
else
out = four
end
end
end
end
2012-10-25 22:23:24 +00:00
end
local kzy
kzy = function()
do
local something = true
if something then
return 1
else
do
local another = false
if another then
return 2
end
end
end
end
end
2012-10-25 22:23:24 +00:00
if not (true) then
print("cool!")
end
if not (true and false) then
print("cool!")
end
if not (false) then
print("cool!")
end
if not (false) then
print("cool!")
else
print("no way!")
end
if not (nil) then
print("hello")
else
print("world")
end
local x
if not (true) then
x = print("cool!")
end
if not (true and false) then
x = print("cool!")
end
local y
2012-10-25 22:23:24 +00:00
if not (false) then
y = print("cool!")
2012-10-25 22:23:24 +00:00
end
if not (false) then
y = print("cool!")
2012-10-25 22:23:24 +00:00
else
y = print("no way!")
2012-10-25 22:23:24 +00:00
end
if not (nil) then
z = print("hello")
2012-10-25 22:23:24 +00:00
else
z = print("world")
2012-10-25 22:23:24 +00:00
end
print((function()
if not (true) then
return print("cool!")
end
end)())
print((function()
if not (true and false) then
return print("cool!")
end
end)())
print((function()
if not (false) then
return print("cool!")
end
end)())
print((function()
if not (false) then
return print("cool!")
else
return print("no way!")
end
end)())
print((function()
if not (nil) then
return print("hello")
else
return print("world")
end
end)())
if not (value) then
print("hello")
end
local dddd
2012-10-25 22:23:24 +00:00
if not (value) then
dddd = {
2012-10-25 22:23:24 +00:00
1,
2,
3
}
end
local a = 12
local c, b
if something then
a, c, b = "cool"
2012-10-01 19:30:16 +00:00
end