| 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 * A class for holding onto the data for a date so that it can be built | 6 * A class for holding onto the data for a date so that it can be built |
| 7 * up incrementally. | 7 * up incrementally. |
| 8 */ | 8 */ |
| 9 class _DateBuilder { | 9 class _DateBuilder { |
| 10 // Default the date values to the EPOCH so that there's a valid date | 10 // Default the date values to the EPOCH so that there's a valid date |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 /** | 119 /** |
| 120 * Assuming that the contents are characters, read as many digits as we | 120 * Assuming that the contents are characters, read as many digits as we |
| 121 * can see and then return the corresponding integer. Advance the stream. | 121 * can see and then return the corresponding integer. Advance the stream. |
| 122 */ | 122 */ |
| 123 var digitMatcher = const RegExp(@'\d+'); | 123 var digitMatcher = const RegExp(@'\d+'); |
| 124 int nextInteger() { | 124 int nextInteger() { |
| 125 var string = digitMatcher.stringMatch(rest()); | 125 var string = digitMatcher.stringMatch(rest()); |
| 126 if (string == null || string.isEmpty()) return null; | 126 if (string == null || string.isEmpty()) return null; |
| 127 read(string.length); | 127 read(string.length); |
| 128 return parseInt(string); | 128 return int.parse(string); |
| 129 } | 129 } |
| 130 } | 130 } |
| OLD | NEW |