| 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/services/lint.dart'; | 10 import 'package:analyzer/src/services/lint.dart'; |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 | 630 |
| 631 /** | 631 /** |
| 632 * Given that the comparison is to begin with the given [element], capture | 632 * Given that the comparison is to begin with the given [element], capture |
| 633 * the enclosing elements that might be used while performing the comparison. | 633 * the enclosing elements that might be used while performing the comparison. |
| 634 */ | 634 */ |
| 635 void _captureEnclosingElements(Element element) { | 635 void _captureEnclosingElements(Element element) { |
| 636 Element parent = | 636 Element parent = |
| 637 element is CompilationUnitElement ? element : element.enclosingElement; | 637 element is CompilationUnitElement ? element : element.enclosingElement; |
| 638 while (parent != null) { | 638 while (parent != null) { |
| 639 if (parent is CompilationUnitElement) { | 639 if (parent is CompilationUnitElement) { |
| 640 _enclosingUnit = parent as CompilationUnitElement; | 640 _enclosingUnit = parent; |
| 641 _enclosingLibrary = element.library; | 641 _enclosingLibrary = element.library; |
| 642 } else if (parent is ClassElement) { | 642 } else if (parent is ClassElement) { |
| 643 if (_enclosingClass == null) { | 643 if (_enclosingClass == null) { |
| 644 _enclosingClass = parent as ClassElement; | 644 _enclosingClass = parent; |
| 645 } | 645 } |
| 646 } else if (parent is FunctionTypeAliasElement) { | 646 } else if (parent is FunctionTypeAliasElement) { |
| 647 if (_enclosingAlias == null) { | 647 if (_enclosingAlias == null) { |
| 648 _enclosingAlias = parent as FunctionTypeAliasElement; | 648 _enclosingAlias = parent; |
| 649 } | 649 } |
| 650 } else if (parent is ParameterElement) { | 650 } else if (parent is ParameterElement) { |
| 651 if (_enclosingParameter == null) { | 651 if (_enclosingParameter == null) { |
| 652 _enclosingParameter = parent as ParameterElement; | 652 _enclosingParameter = parent; |
| 653 } | 653 } |
| 654 } | 654 } |
| 655 parent = parent.enclosingElement; | 655 parent = parent.enclosingElement; |
| 656 } | 656 } |
| 657 } | 657 } |
| 658 | 658 |
| 659 void _gatherElements(Element element) { | 659 void _gatherElements(Element element) { |
| 660 _ElementsGatherer gatherer = new _ElementsGatherer(this); | 660 _ElementsGatherer gatherer = new _ElementsGatherer(this); |
| 661 element.accept(gatherer); | 661 element.accept(gatherer); |
| 662 // TODO(scheglov) what if a change in a directive? | 662 // TODO(scheglov) what if a change in a directive? |
| (...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1810 @override | 1810 @override |
| 1811 String toString() => name; | 1811 String toString() => name; |
| 1812 } | 1812 } |
| 1813 | 1813 |
| 1814 class _TokenPair { | 1814 class _TokenPair { |
| 1815 final _TokenDifferenceKind kind; | 1815 final _TokenDifferenceKind kind; |
| 1816 final Token oldToken; | 1816 final Token oldToken; |
| 1817 final Token newToken; | 1817 final Token newToken; |
| 1818 _TokenPair(this.kind, this.oldToken, this.newToken); | 1818 _TokenPair(this.kind, this.oldToken, this.newToken); |
| 1819 } | 1819 } |
| OLD | NEW |