OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 simpleForLoop(count) { | |
6 for (int i = 0; i < count; i = i + 1) { | |
7 print(i); | |
8 } | |
9 } | |
10 | |
11 simpleForLoopWithBreak(count) { | |
12 /*0@break*/ for (int i = 0; i < count; i = i + 1) { | |
13 if (i % 2 == 0) /*target=0*/ break; | |
14 print(i); | |
15 } | |
16 } | |
17 | |
18 main() { | |
19 simpleForLoop(10); | |
20 simpleForLoopWithBreak(10); | |
21 } | |
OLD | NEW |