blob: 7deab4cafcb770037b8ed90957b8209c3f716fa6 (
plain) (
blame)
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
|
discard """
output: '''10
true true
true false
false true
false false'''
"""
var
x = false
run = true
while run:
run = false
block myblock:
if true:
break
echo "leaving myblock"
x = true
doAssert(x)
# bug #1418
iterator foo: int =
for x in 0 .. 9:
for y in [10,20,30,40,50,60,70,80,90]:
yield x + y
for p in foo():
echo p
break
iterator permutations: int =
yield 10
for p in permutations():
break
# regression:
proc main =
for x in [true, false]:
for y in [true, false]:
echo x, " ", y
main()
|