Add continue statement.

This commit is contained in:
Stephen Chung
2020-04-01 16:22:18 +08:00
parent 9aff10aca4
commit 4ea2fb88ae
6 changed files with 69 additions and 37 deletions

View File

@@ -12,8 +12,9 @@ fn test_loop() -> Result<(), EvalAltResult> {
loop {
if i < 10 {
i += 1;
if x > 20 { continue; }
x = x + i;
i = i + 1;
} else {
break;
}
@@ -22,7 +23,7 @@ fn test_loop() -> Result<(), EvalAltResult> {
return x;
"
)?,
45
21
);
Ok(())