aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/cond.yue
blob: cce96df50e4c2210520b61889e74d766ba751156 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267

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", nil, nil if something



---

j = if 1
	if 2
		3
else 6


m = if 1



	if 2


		3


else 6

do
	a
		:b
	return if a
		:b
	else if c
		d: e
	else
		f: 123

do
	c
		d: e
	if a
		:b = tb
	elseif c
		d: e = tb

if :pi := math
	print pi

do
	local math
	if :pi := math
		print pi

do
	if _M := {}
		:Thing = _M
		:a, :b = _M

do
	global _M
	if _M := {}
		:Thing = _M
		:a, :b = _M

do
	v = if 1 and do
			0 ~= 1
		1
	else
		2

do
	condChain = 1 < 2 <= 2 < 3 == 3 > 2 >= 1 == 1 < 3 != 5

	v = (x)->
		print x
		x

	evaluation = v(1) < v(2) <= v(3)

	evaluation = v(1) > v(2) <= v(3)

do
	a = v(1) < v(2) < v(3) < v(4)
	a = x and y or v(1) < v(2) < v(3) < v(4)
	a = v(1) < v(2) < v(3) < v(4) or x and y
	a = x and y or v(1) < v(2) < v(3) < v(4) or w and z

	a = v(1) < v(2) < v(3) and b < v(4) < v(5) < v(6)
	a = x and y or v(1) < v(2) < v(3) and b < v(4) < v(5) < v(6)
	a = v(1) < v(2) < v(3) and b < v(4) < v(5) < v(6) or x and y
	a = x and y or v(1) < v(2) < v(3) and b < v(4) < v(5) < v(6) or w and z
	a = 1 < 2 == v1 > 3

	local v1, v2, v3, v4, v5, v6
	a = v1 < v2 < v3 < v4
	a = x and y or v1 < v2 < v3 < v4
	a = v1 < v2 < v3 < v4 or x and y
	a = x and y or v1 < v2 < v3 < v4 or w and z

	a = v1 < v2 < v3 and b < v4 < v5 < v6
	a = x and y or v1 < v2 < v3 and b < v4 < v5 < v6
	a = v1 < v2 < v3 and b < v4 < v5 < v6 or x and y
	a = x and y or v1 < v2 < v3 and b < v4 < v5 < v6 or w and z
	a = 1 < 2 == v1 > 3

nil