Added support for continue in while/do while.

This commit is contained in:
Pavel Talanov
2011-11-18 13:24:18 +04:00
parent 16c6e8bee5
commit f06fa3c295
3 changed files with 40 additions and 0 deletions
@@ -42,4 +42,14 @@ public final class WhileTest extends AbstractExpressionTest {
public void breakDoWhile() throws Exception {
testFooBoxIsTrue("breakDoWhile.kt");
}
@Test
public void continueWhile() throws Exception {
testFooBoxIsTrue("continueWhile.kt");
}
@Test
public void continueDoWhile() throws Exception {
testFooBoxIsTrue("continueDoWhile.kt");
}
}
@@ -0,0 +1,15 @@
namespace foo
fun box() : Boolean {
var i = 0
var b = true
do {
++i;
if (i >= 1) {
continue;
}
b =false;
} while (i < 100)
return b
}
@@ -0,0 +1,15 @@
namespace foo
fun box() : Boolean {
var i = 0
var b = true
while (i < 100) {
++i;
if (i >= 1) {
continue;
}
b =false;
}
return b
}