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

Side by Side Diff: pkg/analyzer/lib/src/generated/element.dart

Issue 742103003: Update 'nameOffset' for elements during incremental analysis. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/engine.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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.element; 8 library engine.element;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 3433 matching lines...) Expand 10 before | Expand all | Expand 10 after
3444 int _modifiers = 0; 3444 int _modifiers = 0;
3445 3445
3446 /** 3446 /**
3447 * An array containing all of the metadata associated with this element. 3447 * An array containing all of the metadata associated with this element.
3448 */ 3448 */
3449 List<ElementAnnotation> metadata = ElementAnnotationImpl.EMPTY_ARRAY; 3449 List<ElementAnnotation> metadata = ElementAnnotationImpl.EMPTY_ARRAY;
3450 3450
3451 /** 3451 /**
3452 * A cached copy of the calculated hashCode for this element. 3452 * A cached copy of the calculated hashCode for this element.
3453 */ 3453 */
3454 int _cachedHashCode = 0; 3454 int _cachedHashCode;
3455 3455
3456 /** 3456 /**
3457 * A cached copy of the calculated location for this element. 3457 * A cached copy of the calculated location for this element.
3458 */ 3458 */
3459 ElementLocation _cachedLocation; 3459 ElementLocation _cachedLocation;
3460 3460
3461 /** 3461 /**
3462 * Initialize a newly created element to have the given name. 3462 * Initialize a newly created element to have the given name.
3463 * 3463 *
3464 * @param name the name of this element 3464 * @param name the name of this element
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
3497 * @param element the enclosing element of this element 3497 * @param element the enclosing element of this element
3498 */ 3498 */
3499 void set enclosingElement(Element element) { 3499 void set enclosingElement(Element element) {
3500 _enclosingElement = element as ElementImpl; 3500 _enclosingElement = element as ElementImpl;
3501 } 3501 }
3502 3502
3503 @override 3503 @override
3504 int get hashCode { 3504 int get hashCode {
3505 // TODO: We might want to re-visit this optimization in the future. 3505 // TODO: We might want to re-visit this optimization in the future.
3506 // We cache the hash code value as this is a very frequently called method. 3506 // We cache the hash code value as this is a very frequently called method.
3507 if (_cachedHashCode == 0) { 3507 if (_cachedHashCode == null) {
3508 int hashIdentifier = identifier.hashCode; 3508 int hashIdentifier = identifier.hashCode;
3509 Element enclosing = enclosingElement; 3509 Element enclosing = enclosingElement;
3510 if (enclosing != null) { 3510 if (enclosing != null) {
3511 _cachedHashCode = hashIdentifier + enclosing.hashCode; 3511 _cachedHashCode = hashIdentifier + enclosing.hashCode;
3512 } else { 3512 } else {
3513 _cachedHashCode = hashIdentifier; 3513 _cachedHashCode = hashIdentifier;
3514 } 3514 }
3515 } 3515 }
3516 return _cachedHashCode; 3516 return _cachedHashCode;
3517 } 3517 }
(...skipping 5279 matching lines...) Expand 10 before | Expand all | Expand 10 after
8797 : super(name, nameOffset); 8797 : super(name, nameOffset);
8798 8798
8799 /** 8799 /**
8800 * Initialize a newly created local variable element to have the given name. 8800 * Initialize a newly created local variable element to have the given name.
8801 * 8801 *
8802 * @param name the name of this element 8802 * @param name the name of this element
8803 */ 8803 */
8804 LocalVariableElementImpl.forNode(Identifier name) : super.forNode(name); 8804 LocalVariableElementImpl.forNode(Identifier name) : super.forNode(name);
8805 8805
8806 @override 8806 @override
8807 String get identifier => "${super.identifier}@$nameOffset"; 8807 String get identifier {
8808 int enclosingOffset =
8809 enclosingElement != null ? enclosingElement.nameOffset : 0;
8810 int delta = nameOffset - enclosingOffset;
8811 return '${super.identifier}@$delta';
8812 }
8808 8813
8809 @override 8814 @override
8810 bool get isPotentiallyMutatedInClosure => 8815 bool get isPotentiallyMutatedInClosure =>
8811 hasModifier(Modifier.POTENTIALLY_MUTATED_IN_CONTEXT); 8816 hasModifier(Modifier.POTENTIALLY_MUTATED_IN_CONTEXT);
8812 8817
8813 @override 8818 @override
8814 bool get isPotentiallyMutatedInScope => 8819 bool get isPotentiallyMutatedInScope =>
8815 hasModifier(Modifier.POTENTIALLY_MUTATED_IN_SCOPE); 8820 hasModifier(Modifier.POTENTIALLY_MUTATED_IN_SCOPE);
8816 8821
8817 @override 8822 @override
(...skipping 2737 matching lines...) Expand 10 before | Expand all | Expand 10 after
11555 } 11560 }
11556 return newTypes; 11561 return newTypes;
11557 } 11562 }
11558 } 11563 }
11559 11564
11560 class TypeImpl_TypePair { 11565 class TypeImpl_TypePair {
11561 final DartType _firstType; 11566 final DartType _firstType;
11562 11567
11563 final DartType _secondType; 11568 final DartType _secondType;
11564 11569
11565 int _cachedHashCode = 0; 11570 int _cachedHashCode;
11566 11571
11567 TypeImpl_TypePair(this._firstType, this._secondType); 11572 TypeImpl_TypePair(this._firstType, this._secondType);
11568 11573
11569 @override 11574 @override
11570 int get hashCode { 11575 int get hashCode {
11571 if (_cachedHashCode == 0) { 11576 if (_cachedHashCode == null) {
11572 int firstHashCode = 0; 11577 int firstHashCode = 0;
11573 if (_firstType != null) { 11578 if (_firstType != null) {
11574 Element firstElement = _firstType.element; 11579 Element firstElement = _firstType.element;
11575 firstHashCode = firstElement == null ? 0 : firstElement.hashCode; 11580 firstHashCode = firstElement == null ? 0 : firstElement.hashCode;
11576 } 11581 }
11577 int secondHashCode = 0; 11582 int secondHashCode = 0;
11578 if (_secondType != null) { 11583 if (_secondType != null) {
11579 Element secondElement = _secondType.element; 11584 Element secondElement = _secondType.element;
11580 secondHashCode = secondElement == null ? 0 : secondElement.hashCode; 11585 secondHashCode = secondElement == null ? 0 : secondElement.hashCode;
11581 } 11586 }
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
12488 // bottom <: void (as bottom is a subtype of all types). 12493 // bottom <: void (as bottom is a subtype of all types).
12489 // void <: dynamic (as dynamic is a supertype of all types) 12494 // void <: dynamic (as dynamic is a supertype of all types)
12490 return identical(type, this) || type.isDynamic; 12495 return identical(type, this) || type.isDynamic;
12491 } 12496 }
12492 12497
12493 @override 12498 @override
12494 VoidTypeImpl substitute2(List<DartType> argumentTypes, 12499 VoidTypeImpl substitute2(List<DartType> argumentTypes,
12495 List<DartType> parameterTypes) => 12500 List<DartType> parameterTypes) =>
12496 this; 12501 this;
12497 } 12502 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698