moonscript/spec/inputs/cond.moon
2016-09-25 14:07:35 -07:00

191 lines
2.0 KiB
Plaintext

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
--
if something = 10
print something
else
print "else"
hello = if something = 10
print something
else
print "else"
hello = 5 + if something = 10
print something
---
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
---
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!"
z = unless nil
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
--
do
j = 100
unless j = hi!
error "not j!"
----------------
a = 12
a,c,b = "cool" if something
---
j = if 1
if 2
3
else 6
m = if 1
if 2
3
else 6
nil