mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 22:28:45 +01:00
25 lines
329 B
Plaintext
25 lines
329 B
Plaintext
// Single-expression body.
|
|
var c = 0
|
|
while (c < 3) IO.write(c = c + 1)
|
|
// expect: 1
|
|
// expect: 2
|
|
// expect: 3
|
|
|
|
// Block body.
|
|
var a = 0
|
|
while (a < 3) {
|
|
IO.write(a)
|
|
a = a + 1
|
|
}
|
|
// expect: 0
|
|
// expect: 1
|
|
// expect: 2
|
|
|
|
// Newline after "while".
|
|
var d = 0
|
|
while
|
|
(d < 3) IO.write(d = d + 1)
|
|
// expect: 1
|
|
// expect: 2
|
|
// expect: 3
|