mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +00:00
debug
This commit is contained in:
parent
582ad5668e
commit
0d62ae0814
29 changed files with 99479 additions and 1166 deletions
44
tests/flow_control.lang
Normal file
44
tests/flow_control.lang
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
decl flow_control_test : Unit -> Unit
|
||||
def flow_control_test = {
|
||||
// if && || a < b
|
||||
// || a == b
|
||||
// && b < c
|
||||
// && c > 10
|
||||
|
||||
if ((a < b) || (a == b)) && (b < c)
|
||||
then IO.print x
|
||||
elif x < 0
|
||||
then {
|
||||
; ++x
|
||||
; IO.print y
|
||||
} else {
|
||||
return {}
|
||||
}
|
||||
|
||||
while (a > 0) && (!array.is_empty)
|
||||
do {
|
||||
; --a
|
||||
; 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 { // TODO: decide ??? does it work (like auto zip) ???
|
||||
; IO.print 1
|
||||
; IO.print 2
|
||||
; IO.print 128
|
||||
}
|
||||
|
||||
loop {
|
||||
; ++y
|
||||
if y > 100 then
|
||||
break
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue