1
0
forked from Mirror/wren
Files
wren/test/function/syntax.wren

26 lines
334 B
Plaintext
Raw Normal View History

2013-11-06 07:47:47 -08:00
// Single expression body.
2014-04-02 19:41:53 -07:00
new Fn { IO.print("ok") }.call // expect: ok
2013-11-05 15:40:21 -08:00
2013-11-06 07:47:47 -08:00
// Curly body.
2014-04-02 19:41:53 -07:00
new Fn {
IO.print("ok") // expect: ok
2013-11-05 15:40:21 -08:00
}.call
// Multiple statements.
2014-04-02 19:41:53 -07:00
new Fn {
IO.print("1") // expect: 1
IO.print("2") // expect: 2
2013-11-05 15:40:21 -08:00
}.call
// Extra newlines.
2014-04-02 19:41:53 -07:00
new Fn {
2013-11-05 15:40:21 -08:00
IO.print("1") // expect: 1
2013-11-05 15:40:21 -08:00
IO.print("2") // expect: 2
2013-11-05 15:40:21 -08:00
}.call