Files
wren/test/language/while/syntax.wren
T

17 lines
227 B
Plaintext
Raw Normal View History

2013-11-17 22:38:59 -08:00
// Single-expression body.
var c = 0
2015-09-15 07:46:09 -07:00
while (c < 3) System.print(c = c + 1)
2013-11-17 22:38:59 -08:00
// expect: 1
// expect: 2
// expect: 3
// Block body.
var a = 0
while (a < 3) {
2015-09-15 07:46:09 -07:00
System.print(a)
2013-12-04 07:43:50 -08:00
a = a + 1
2013-11-17 22:38:59 -08:00
}
// expect: 0
// expect: 1
// expect: 2