Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Side by Side Diff: utils/pub/version.dart

Issue 12090093: Reapply "Rename mappedBy to map." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed bug in previous commit. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/validator/name.dart ('k') | utils/pub/version_solver.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /// Handles version numbers, following the [Semantic Versioning][semver] spec. 5 /// Handles version numbers, following the [Semantic Versioning][semver] spec.
6 /// 6 ///
7 /// [semver]: http://semver.org/ 7 /// [semver]: http://semver.org/
8 library version; 8 library version;
9 9
10 import 'dart:math'; 10 import 'dart:math';
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 return aPart.compareTo(bPart); 185 return aPart.compareTo(bPart);
186 } 186 }
187 } 187 }
188 } 188 }
189 } 189 }
190 } 190 }
191 191
192 /// Splits a string of dot-delimited identifiers into their component parts. 192 /// Splits a string of dot-delimited identifiers into their component parts.
193 /// Identifiers that are numeric are converted to numbers. 193 /// Identifiers that are numeric are converted to numbers.
194 List _splitParts(String text) { 194 List _splitParts(String text) {
195 return text.split('.').mappedBy((part) { 195 return text.split('.').map((part) {
196 try { 196 try {
197 return int.parse(part); 197 return int.parse(part);
198 } on FormatException catch (ex) { 198 } on FormatException catch (ex) {
199 // Not a number. 199 // Not a number.
200 return part; 200 return part;
201 } 201 }
202 }).toList(); 202 }).toList();
203 } 203 }
204 } 204 }
205 205
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 419
420 class _EmptyVersion implements VersionConstraint { 420 class _EmptyVersion implements VersionConstraint {
421 const _EmptyVersion(); 421 const _EmptyVersion();
422 422
423 bool get isEmpty => true; 423 bool get isEmpty => true;
424 bool get isAny => false; 424 bool get isAny => false;
425 bool allows(Version other) => false; 425 bool allows(Version other) => false;
426 VersionConstraint intersect(VersionConstraint other) => this; 426 VersionConstraint intersect(VersionConstraint other) => this;
427 String toString() => '<empty>'; 427 String toString() => '<empty>';
428 } 428 }
OLDNEW
« no previous file with comments | « utils/pub/validator/name.dart ('k') | utils/pub/version_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698