| 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 engine.incremental_resolver; | 5 library engine.incremental_resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/constant.dart'; | 10 import 'package:analyzer/src/generated/constant.dart'; |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 { | 965 { |
| 966 CompilationUnit unit = node.getAncestor((n) => n is CompilationUnit); | 966 CompilationUnit unit = node.getAncestor((n) => n is CompilationUnit); |
| 967 ConstantValueComputer computer = | 967 ConstantValueComputer computer = |
| 968 new ConstantValueComputer(_typeProvider, _context.declaredVariables); | 968 new ConstantValueComputer(_typeProvider, _context.declaredVariables); |
| 969 computer.add(unit); | 969 computer.add(unit); |
| 970 computer.computeValues(); | 970 computer.computeValues(); |
| 971 } | 971 } |
| 972 // validate | 972 // validate |
| 973 { | 973 { |
| 974 ErrorReporter errorReporter = new ErrorReporter(errorListener, _source); | 974 ErrorReporter errorReporter = new ErrorReporter(errorListener, _source); |
| 975 ConstantVerifier constantVerifier = | 975 ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, |
| 976 new ConstantVerifier(errorReporter, _definingLibrary, _typeProvider); | 976 _definingLibrary, _typeProvider, _context.declaredVariables); |
| 977 node.accept(constantVerifier); | 977 node.accept(constantVerifier); |
| 978 } | 978 } |
| 979 } | 979 } |
| 980 | 980 |
| 981 /** | 981 /** |
| 982 * Starting at [node], find the smallest AST node that can be resolved | 982 * Starting at [node], find the smallest AST node that can be resolved |
| 983 * independently of any other nodes. Return the node that was found. | 983 * independently of any other nodes. Return the node that was found. |
| 984 * | 984 * |
| 985 * [node] - the node at which the search is to begin | 985 * [node] - the node at which the search is to begin |
| 986 * | 986 * |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1843 @override | 1843 @override |
| 1844 String toString() => name; | 1844 String toString() => name; |
| 1845 } | 1845 } |
| 1846 | 1846 |
| 1847 class _TokenPair { | 1847 class _TokenPair { |
| 1848 final _TokenDifferenceKind kind; | 1848 final _TokenDifferenceKind kind; |
| 1849 final Token oldToken; | 1849 final Token oldToken; |
| 1850 final Token newToken; | 1850 final Token newToken; |
| 1851 _TokenPair(this.kind, this.oldToken, this.newToken); | 1851 _TokenPair(this.kind, this.oldToken, this.newToken); |
| 1852 } | 1852 } |
| OLD | NEW |