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

26 lines
342 B
Plaintext

// Single expression body.
System.print(fn () { "ok" }()) // expect: ok
// Curly body.
fn () {
System.print("ok") // expect: ok
}()
// Multiple statements.
fn () {
System.print("1") // expect: 1
System.print("2") // expect: 2
}()
// Extra newlines.
fn () {
System.print("1") // expect: 1
System.print("2") // expect: 2
}()