Files
wren/test/language/block_argument/syntax.wren
2015-11-27 21:17:34 -08:00

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
}()