| transformation continue_break(); |
| |
| main() { |
| |
| var index := 0; |
| while(true) { |
| index := 1 + index; |
| if 5 < index then |
| break |
| else { |
| continue; |
| } |
| endif; |
| }; |
| assert fatal (index = 6); |
| |
| var col := Sequence{1, 2, 3}; |
| |
| col->forEach(i) { |
| if i > 1 then continue endif; |
| index := index + 1; |
| }; |
| assert fatal (index = 7); |
| |
| col->forEach(i) { |
| if i = 1 then break endif; |
| index := index + 1; |
| }; |
| assert fatal (index = 7); |
| |
| var col1 := col->collectselect(i; |
| res = compute (x : String := i.toString()) { |
| if i > 2 then break else continue endif; |
| } |
| | true |
| ); |
| assert fatal (col1 <> null and col1->size() = 0); |
| |
| col1 := col->collectselect(i; |
| res = compute (x := i.toString()) { |
| switch { |
| case (i > 2) break; |
| } |
| } |
| | true |
| ); |
| assert fatal (col1 <> null and col1->size() = 2); |
| |
| } |
| |