Files
wren/test/language/function/declaration_syntax.wren

32 lines
398 B
Plaintext
Raw Permalink Normal View History

2013-11-06 07:47:47 -08:00
// Single expression body.
fn a() { "ok" }
System.print(a()) // expect: ok
2013-11-05 15:40:21 -08:00
2013-11-06 07:47:47 -08:00
// Curly body.
fn b() {
System.print("ok") // expect: ok
}
b()
2013-11-05 15:40:21 -08:00
// Multiple statements.
fn c() {
System.print("1") // expect: 1
System.print("2") // expect: 2
}
c()
2013-11-05 15:40:21 -08:00
// Extra newlines.
fn d() {
2013-11-05 15:40:21 -08:00
System.print("1") // expect: 1
2013-11-05 15:40:21 -08:00
System.print("2") // expect: 2
2013-11-05 15:40:21 -08:00
}
d()
2015-11-27 21:17:34 -08:00
// TODO: Newlines before/after parameters.