OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.core; | 5 part of dart.core; |
6 | 6 |
7 /** | 7 /** |
8 * An arbitrarily large integer. | 8 * An arbitrarily large integer. |
9 * | 9 * |
10 * **Note:** When compiling to JavaScript, integers are | 10 * **Note:** When compiling to JavaScript, integers are |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 * sign, the [onError] is called with the [source] as argument, and its return | 268 * sign, the [onError] is called with the [source] as argument, and its return |
269 * value is used instead. If no [onError] is provided, a [FormatException] | 269 * value is used instead. If no [onError] is provided, a [FormatException] |
270 * is thrown. | 270 * is thrown. |
271 * | 271 * |
272 * The [onError] function is only invoked if [source] is a [String]. It is | 272 * The [onError] function is only invoked if [source] is a [String]. It is |
273 * not invoked if the [source] is, for example, `null`. | 273 * not invoked if the [source] is, for example, `null`. |
274 */ | 274 */ |
275 external static int parse(String source, | 275 external static int parse(String source, |
276 { int radix, | 276 { int radix, |
277 int onError(String source) }); | 277 int onError(String source) }); |
| 278 |
| 279 /** |
| 280 * Create an `Iterable<int>` iterating from `this` to `to`, inclusive. |
| 281 * |
| 282 * The iteration starts with `this` as the first value, and then |
| 283 * progresses towards `to` in increments of `step`, and stops when reaching |
| 284 * or overshooting `to`. If it hits `to` the `to` value is included, |
| 285 * otherwise it isn't. |
| 286 * |
| 287 * If `to` is less than `from`, the values are in decreasing order. |
| 288 * |
| 289 * The [step] value must always be positive. It defaults to `1`. |
| 290 * |
| 291 * This is a shorthand for [Iterable.range]. |
| 292 */ |
| 293 static Iterable<int> to(int to, {int step: 1}) => |
| 294 return Iterable.range(this, to, step); |
278 } | 295 } |
OLD | NEW |