OLD | NEW |
1 part of intl; | |
2 | |
3 // 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 |
4 // 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 |
5 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
6 | 4 |
7 /** | 5 /** |
8 * 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 |
9 * up incrementally. | 7 * up incrementally. |
10 */ | 8 */ |
11 class _DateBuilder { | 9 class _DateBuilder { |
12 // 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 * can see and then return the corresponding integer. Advance the stream. | 131 * can see and then return the corresponding integer. Advance the stream. |
134 */ | 132 */ |
135 var digitMatcher = const RegExp(r'\d+'); | 133 var digitMatcher = const RegExp(r'\d+'); |
136 int nextInteger() { | 134 int nextInteger() { |
137 var string = digitMatcher.stringMatch(rest()); | 135 var string = digitMatcher.stringMatch(rest()); |
138 if (string == null || string.isEmpty()) return null; | 136 if (string == null || string.isEmpty()) return null; |
139 read(string.length); | 137 read(string.length); |
140 return int.parse(string); | 138 return int.parse(string); |
141 } | 139 } |
142 } | 140 } |
OLD | NEW |