| OLD | NEW |
| 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 analyzer.src.generated.constant; | 5 library analyzer.src.generated.constant; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| (...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 * expressions. | 1234 * expressions. |
| 1235 */ | 1235 */ |
| 1236 class ConstantExpressionsDependenciesFinder extends RecursiveAstVisitor { | 1236 class ConstantExpressionsDependenciesFinder extends RecursiveAstVisitor { |
| 1237 /** | 1237 /** |
| 1238 * The constants whose values need to be computed. | 1238 * The constants whose values need to be computed. |
| 1239 */ | 1239 */ |
| 1240 HashSet<ConstantEvaluationTarget> dependencies = | 1240 HashSet<ConstantEvaluationTarget> dependencies = |
| 1241 new HashSet<ConstantEvaluationTarget>(); | 1241 new HashSet<ConstantEvaluationTarget>(); |
| 1242 | 1242 |
| 1243 @override | 1243 @override |
| 1244 void visitInstanceCreationExpression(InstanceCreationExpression node) { |
| 1245 if (node.isConst) { |
| 1246 _find(node); |
| 1247 } else { |
| 1248 super.visitInstanceCreationExpression(node); |
| 1249 } |
| 1250 } |
| 1251 |
| 1252 @override |
| 1244 void visitListLiteral(ListLiteral node) { | 1253 void visitListLiteral(ListLiteral node) { |
| 1245 if (node.constKeyword != null) { | 1254 if (node.constKeyword != null) { |
| 1246 _find(node); | 1255 _find(node); |
| 1247 } else { | 1256 } else { |
| 1248 super.visitListLiteral(node); | 1257 super.visitListLiteral(node); |
| 1249 } | 1258 } |
| 1250 } | 1259 } |
| 1251 | 1260 |
| 1252 @override | 1261 @override |
| 1253 void visitMapLiteral(MapLiteral node) { | 1262 void visitMapLiteral(MapLiteral node) { |
| (...skipping 4187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5441 return BoolState.from(_element == rightElement); | 5450 return BoolState.from(_element == rightElement); |
| 5442 } else if (rightOperand is DynamicState) { | 5451 } else if (rightOperand is DynamicState) { |
| 5443 return BoolState.UNKNOWN_VALUE; | 5452 return BoolState.UNKNOWN_VALUE; |
| 5444 } | 5453 } |
| 5445 return BoolState.FALSE_STATE; | 5454 return BoolState.FALSE_STATE; |
| 5446 } | 5455 } |
| 5447 | 5456 |
| 5448 @override | 5457 @override |
| 5449 String toString() => _element == null ? "-unknown-" : _element.name; | 5458 String toString() => _element == null ? "-unknown-" : _element.name; |
| 5450 } | 5459 } |
| OLD | NEW |