Files
wren/test/for/syntax.wren
T

24 lines
375 B
Plaintext
Raw Normal View History

2013-12-24 21:04:11 -08:00
// Single-expression body.
2014-01-05 12:27:12 -08:00
for (i in [1, 2, 3]) IO.print(i)
2013-12-24 21:04:11 -08:00
// expect: 1
// expect: 2
// expect: 3
// Block body.
for (i in [1, 2, 3]) {
2014-01-05 12:27:12 -08:00
IO.print(i)
2013-12-24 21:04:11 -08:00
}
// expect: 1
// expect: 2
// expect: 3
// Newline after "for".
for
2014-01-05 12:27:12 -08:00
(i in [1, 2, 3]) IO.print(i)
2013-12-24 21:04:11 -08:00
// expect: 1
// expect: 2
// expect: 3
2014-01-06 08:01:04 -08:00
// TODO: Return from inside for loop.
// TODO: Return closure from inside for loop.