mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-12 06:38:45 +01:00
32 lines
418 B
Plaintext
32 lines
418 B
Plaintext
// Single expression body.
|
|
(fn io.write("ok")).call // expect: ok
|
|
|
|
// TODO: Precedence of fn body.
|
|
|
|
// Curly body.
|
|
fn {
|
|
io.write("ok") // expect: ok
|
|
}.call
|
|
|
|
// No trailing newline.
|
|
fn {
|
|
io.write("ok") }.call // expect: ok
|
|
|
|
// Multiple expressions.
|
|
fn {
|
|
io.write("1") // expect: 1
|
|
io.write("2") // expect: 2
|
|
}.call
|
|
|
|
// Extra newlines.
|
|
fn {
|
|
|
|
|
|
io.write("1") // expect: 1
|
|
|
|
|
|
io.write("2") // expect: 2
|
|
|
|
|
|
}.call
|