| 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 | 5 |
| 6 part of intl; | 6 part of intl; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * A class for holding onto the data for a date so that it can be built | 9 * A class for holding onto the data for a date so that it can be built |
| 10 * up incrementally. | 10 * up incrementally. |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 while (!atEnd()) { | 126 while (!atEnd()) { |
| 127 if (f(next())) results.add(index - 1); | 127 if (f(next())) results.add(index - 1); |
| 128 } | 128 } |
| 129 return results; | 129 return results; |
| 130 } | 130 } |
| 131 | 131 |
| 132 /** | 132 /** |
| 133 * Assuming that the contents are characters, read as many digits as we | 133 * Assuming that the contents are characters, read as many digits as we |
| 134 * can see and then return the corresponding integer. Advance the stream. | 134 * can see and then return the corresponding integer. Advance the stream. |
| 135 */ | 135 */ |
| 136 var digitMatcher = new RegExp(r'\d+'); | 136 var digitMatcher = const RegExp(r'\d+'); |
| 137 int nextInteger() { | 137 int nextInteger() { |
| 138 var string = digitMatcher.stringMatch(rest()); | 138 var string = digitMatcher.stringMatch(rest()); |
| 139 if (string == null || string.isEmpty) return null; | 139 if (string == null || string.isEmpty) return null; |
| 140 read(string.length); | 140 read(string.length); |
| 141 return int.parse(string); | 141 return int.parse(string); |
| 142 } | 142 } |
| 143 } | 143 } |
| OLD | NEW |