Allow statement bodies for flow control.
This means this works now: if (foo) return bar
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
IO.write(fn {
|
||||
if (false) "no" else return "ok"
|
||||
}.call) // expect: ok
|
||||
@@ -0,0 +1,3 @@
|
||||
IO.write(fn {
|
||||
if (true) return "ok"
|
||||
}.call) // expect: ok
|
||||
@@ -0,0 +1,3 @@
|
||||
IO.write(fn {
|
||||
while (true) return "ok"
|
||||
}.call) // expect: ok
|
||||
@@ -0,0 +1 @@
|
||||
var a = "ok"; IO.write(a) // expect: ok
|
||||
@@ -0,0 +1,8 @@
|
||||
class Foo {
|
||||
method {
|
||||
return "ok"
|
||||
IO.write("bad")
|
||||
}
|
||||
}
|
||||
|
||||
IO.write((new Foo).method) // expect: ok
|
||||
Reference in New Issue
Block a user