lang_2023/tests/flow_control.lang
2023-05-13 14:54:48 +03:00

33 lines
514 B
Text

decl flow_control_test : -> Unit
def flow_control_test = {
if (a < b ||. a == b) && (b < c) then IO.print: x
elif x < 0 then {
; x += 1
; IO.print: y
} else {
return {}
}
while (a > 0) && not: (array.is_empty:) do {
; a -= 1
; array.pop:
}
while x < 10 do x +=. x + 3
for i in 0--y do {
; IO.print: i
}
for & i & j in (& 0--y & 0--k) do { // ??
; IO.print: 1
; IO.print: 2
; IO.print: 128
}
loop {
; y += 1
if y > 100 then
break
}
}