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

Side by Side Diff: lib/src/version_constraint.dart

Issue 1417163006: Fix three strong mode analysis issues. (Closed) Base URL: https://github.com/dart-lang/pub_semver.git@master
Patch Set: v.1.2.3 Created 5 years, 1 month 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
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/version_union.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library pub_semver.src.version_constraint; 5 library pub_semver.src.version_constraint;
6 6
7 import 'patterns.dart'; 7 import 'patterns.dart';
8 import 'version.dart'; 8 import 'version.dart';
9 import 'version_range.dart'; 9 import 'version_range.dart';
10 import 'version_union.dart'; 10 import 'version_union.dart';
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 throw new FormatException('Cannot include other constraints with ' 107 throw new FormatException('Cannot include other constraints with '
108 '"$COMPATIBLE_WITH" constraint in "$originalText".'); 108 '"$COMPATIBLE_WITH" constraint in "$originalText".');
109 } 109 }
110 110
111 return new VersionConstraint.compatibleWith(version); 111 return new VersionConstraint.compatibleWith(version);
112 } 112 }
113 113
114 var compatibleWith = matchCompatibleWith(); 114 var compatibleWith = matchCompatibleWith();
115 if (compatibleWith != null) return compatibleWith; 115 if (compatibleWith != null) return compatibleWith;
116 116
117 var constraints = []; 117 var constraints = <VersionConstraint>[];
118 118
119 while (true) { 119 while (true) {
120 skipWhitespace(); 120 skipWhitespace();
121 121
122 if (text.isEmpty) break; 122 if (text.isEmpty) break;
123 123
124 var version = matchVersion(); 124 var version = matchVersion();
125 if (version != null) { 125 if (version != null) {
126 constraints.add(version); 126 constraints.add(version);
127 continue; 127 continue;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 String toString() => '<empty>'; 216 String toString() => '<empty>';
217 } 217 }
218 218
219 class _CompatibleWithVersionRange extends VersionRange { 219 class _CompatibleWithVersionRange extends VersionRange {
220 _CompatibleWithVersionRange(Version version) : super( 220 _CompatibleWithVersionRange(Version version) : super(
221 min: version, includeMin: true, 221 min: version, includeMin: true,
222 max: version.nextBreaking, includeMax: false); 222 max: version.nextBreaking, includeMax: false);
223 223
224 String toString() => '^$min'; 224 String toString() => '^$min';
225 } 225 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/version_union.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698