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 library pub.solver.backtracking_solver; | 5 library pub.solver.backtracking_solver; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection' show Queue; | 8 import 'dart:collection' show Queue; |
9 | 9 |
10 import '../barback.dart' as barback; | 10 import '../barback.dart' as barback; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 for (var override in root.dependencyOverrides) { | 88 for (var override in root.dependencyOverrides) { |
89 _overrides[override.name] = override; | 89 _overrides[override.name] = override; |
90 } | 90 } |
91 | 91 |
92 // A deeply nested statement that's hard on the formatter. | 92 // A deeply nested statement that's hard on the formatter. |
93 isTwoWay = !isEvent && bindings.isWhole && (isCustomTag || | 93 isTwoWay = !isEvent && bindings.isWhole && (isCustomTag || |
94 tag == 'input' && (name == 'value' || name =='checked') || | 94 tag == 'input' && (name == 'value' || name =='checked') || |
95 tag == 'select' && (name == 'selectedindex' || name == 'value') || | 95 tag == 'select' && (name == 'selectedindex' || name == 'value') || |
96 tag == 'textarea' && name == 'value'); | 96 tag == 'textarea' && name == 'value'); |
| 97 |
| 98 // Even more deeply nested pathological example. |
| 99 if (javaBooleanAnd( |
| 100 javaBooleanAnd( |
| 101 javaBooleanAnd( |
| 102 javaBooleanAnd( |
| 103 javaBooleanAnd( |
| 104 javaBooleanAnd( |
| 105 javaBooleanAnd( |
| 106 javaBooleanAnd(), |
| 107 _isEqualTokens( |
| 108 node.period, |
| 109 toNode.period)), |
| 110 _isEqualNodes( |
| 111 node.name, |
| 112 toNode.name)), |
| 113 _isEqualNodes( |
| 114 node.parameters, |
| 115 toNode.parameters)), |
| 116 _isEqualTokens( |
| 117 node.separator, |
| 118 toNode.separator)), |
| 119 _isEqualNodeLists(node.initializers, toNode.initializers)), |
| 120 _isEqualNodes( |
| 121 node.redirectedConstructor, |
| 122 toNode.redirectedConstructor)), |
| 123 _isEqualNodes(node.body, toNode.body))) { |
| 124 toNode.element = node.element; |
| 125 } |
97 } | 126 } |
98 | 127 |
99 /// Run the solver. | 128 /// Run the solver. |
100 /// | 129 /// |
101 /// Completes with a list of specific package versions if successful or an | 130 /// Completes with a list of specific package versions if successful or an |
102 /// error if it failed to find a solution. | 131 /// error if it failed to find a solution. |
103 Future<SolveResult> solve() { | 132 Future<SolveResult> solve() { |
104 var stopwatch = new Stopwatch(); | 133 var stopwatch = new Stopwatch(); |
105 | 134 |
106 _logParameters(); | 135 _logParameters(); |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 /// | 835 /// |
807 /// Throws a [SolveFailure] if not. | 836 /// Throws a [SolveFailure] if not. |
808 void _validateSdkConstraint(Pubspec pubspec) { | 837 void _validateSdkConstraint(Pubspec pubspec) { |
809 if (pubspec.environment.sdkVersion.allows(sdk.version)) return; | 838 if (pubspec.environment.sdkVersion.allows(sdk.version)) return; |
810 | 839 |
811 throw new BadSdkVersionException( | 840 throw new BadSdkVersionException( |
812 pubspec.name, | 841 pubspec.name, |
813 'Package ${pubspec.name} requires SDK version ' | 842 'Package ${pubspec.name} requires SDK version ' |
814 '${pubspec.environment.sdkVersion} but the current SDK is ' '${sdk.ver
sion}.'); | 843 '${pubspec.environment.sdkVersion} but the current SDK is ' '${sdk.ver
sion}.'); |
815 } | 844 } |
OLD | NEW |