mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-15 16:18:04 +01:00
28 lines
365 B
Plaintext
28 lines
365 B
Plaintext
fn block(arg) { arg }
|
|
|
|
// Single expression body.
|
|
System.print(block { "ok" }()) // expect: ok
|
|
|
|
// Curly body.
|
|
block {
|
|
System.print("ok") // expect: ok
|
|
}()
|
|
|
|
// Multiple statements.
|
|
block {
|
|
System.print("1") // expect: 1
|
|
System.print("2") // expect: 2
|
|
}()
|
|
|
|
// Extra newlines.
|
|
block {
|
|
|
|
|
|
System.print("1") // expect: 1
|
|
|
|
|
|
System.print("2") // expect: 2
|
|
|
|
|
|
}()
|