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

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

Issue 10919024: - Change "static final" to "static const" in the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/repo_source.dart ('k') | utils/pub/yaml/model.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 /** 5 /**
6 * Handles version numbers, following the [Semantic Versioning][semver] spec. 6 * Handles version numbers, following the [Semantic Versioning][semver] spec.
7 * 7 *
8 * [semver]: http://semver.org/ 8 * [semver]: http://semver.org/
9 */ 9 */
10 #library('version'); 10 #library('version');
11 11
12 #import('dart:math'); 12 #import('dart:math');
13 13
14 #import('utils.dart'); 14 #import('utils.dart');
15 15
16 /** A parsed semantic version number. */ 16 /** A parsed semantic version number. */
17 class Version implements Comparable, Hashable, VersionConstraint { 17 class Version implements Comparable, Hashable, VersionConstraint {
18 /** No released version: i.e. "0.0.0". */ 18 /** No released version: i.e. "0.0.0". */
19 static Version get none => new Version(0, 0, 0); 19 static Version get none => new Version(0, 0, 0);
20 20
21 static final _PARSE_REGEX = const RegExp( 21 static const _PARSE_REGEX = const RegExp(
22 @'^' // Start at beginning. 22 @'^' // Start at beginning.
23 @'(\d+).(\d+).(\d+)' // Version number. 23 @'(\d+).(\d+).(\d+)' // Version number.
24 @'(-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?' // Pre-release. 24 @'(-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?' // Pre-release.
25 @'(\+([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?' // Build. 25 @'(\+([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?' // Build.
26 @'$'); // Consume entire string. 26 @'$'); // Consume entire string.
27 27
28 /** The major version number: "1" in "1.2.3". */ 28 /** The major version number: "1" in "1.2.3". */
29 final int major; 29 final int major;
30 30
31 /** The minor version number: "2" in "1.2.3". */ 31 /** The minor version number: "2" in "1.2.3". */
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 case '<': return new VersionRange(max: version, includeMax: false); 420 case '<': return new VersionRange(max: version, includeMax: false);
421 case '>=': return new VersionRange(min: version, includeMin: true); 421 case '>=': return new VersionRange(min: version, includeMin: true);
422 case '>': return new VersionRange(min: version, includeMin: false); 422 case '>': return new VersionRange(min: version, includeMin: false);
423 } 423 }
424 } 424 }
425 425
426 // Otherwise, it must be an explicit version. 426 // Otherwise, it must be an explicit version.
427 return new Version.parse(text); 427 return new Version.parse(text);
428 } 428 }
429 } 429 }
OLDNEW
« no previous file with comments | « utils/pub/repo_source.dart ('k') | utils/pub/yaml/model.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698