moonscript/tests/inputs/cond.moon

157 lines
1.9 KiB
Plaintext
Raw Normal View History

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