mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-12 06:38:45 +01:00
- Rename IO.write -> IO.print. - Make IO.write not print a newline. - Support \u Unicode escapes in strings.
26 lines
367 B
Plaintext
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. |