Files
wren/test/while/syntax.wren
Bob Nystrom b979272305 Clean up text handling a bit:
- Rename IO.write -> IO.print.
- Make IO.write not print a newline.
- Support \u Unicode escapes in strings.
2014-01-05 12:27:12 -08:00

26 lines
367 B
Plaintext

// Single-expression body.
var c = 0
while (c < 3) IO.print(c = c + 1)
// expect: 1
// expect: 2
// expect: 3
// Block body.
var a = 0
while (a < 3) {
IO.print(a)
a = a + 1
}
// expect: 0
// expect: 1
// expect: 2
// Newline after "while".
var d = 0
while
(d < 3) IO.print(d = d + 1)
// expect: 1
// expect: 2
// expect: 3
// TODO: Close over variable in body.