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.dart.element.element; | 5 library analyzer.src.dart.element.element; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:math' show min; | 8 import 'dart:math' show min; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1527 /** | 1527 /** |
1528 * Initialize a newly created synthetic field element to have the given | 1528 * Initialize a newly created synthetic field element to have the given |
1529 * [name] and [offset]. | 1529 * [name] and [offset]. |
1530 */ | 1530 */ |
1531 ConstFieldElementImpl(String name, int offset) : super(name, offset); | 1531 ConstFieldElementImpl(String name, int offset) : super(name, offset); |
1532 | 1532 |
1533 /** | 1533 /** |
1534 * Initialize a newly created field element to have the given [name]. | 1534 * Initialize a newly created field element to have the given [name]. |
1535 */ | 1535 */ |
1536 ConstFieldElementImpl.forNode(Identifier name) : super.forNode(name); | 1536 ConstFieldElementImpl.forNode(Identifier name) : super.forNode(name); |
| 1537 |
| 1538 /** |
| 1539 * Initialize using the given serialized information. |
| 1540 */ |
| 1541 ConstFieldElementImpl.forSerialized( |
| 1542 UnlinkedVariable unlinkedVariable, ElementImpl enclosingElement) |
| 1543 : super.forSerialized(unlinkedVariable, enclosingElement); |
1537 } | 1544 } |
1538 | 1545 |
1539 /** | 1546 /** |
1540 * A [LocalVariableElement] for a local 'const' variable that has an | 1547 * A [LocalVariableElement] for a local 'const' variable that has an |
1541 * initializer. | 1548 * initializer. |
1542 */ | 1549 */ |
1543 class ConstLocalVariableElementImpl extends LocalVariableElementImpl | 1550 class ConstLocalVariableElementImpl extends LocalVariableElementImpl |
1544 with ConstVariableElement { | 1551 with ConstVariableElement { |
1545 /** | 1552 /** |
1546 * Initialize a newly created local variable element to have the given [name] | 1553 * Initialize a newly created local variable element to have the given [name] |
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3278 * Initialize a newly created synthetic field element to have the given [name] | 3285 * Initialize a newly created synthetic field element to have the given [name] |
3279 * at the given [offset]. | 3286 * at the given [offset]. |
3280 */ | 3287 */ |
3281 FieldElementImpl(String name, int offset) : super(name, offset); | 3288 FieldElementImpl(String name, int offset) : super(name, offset); |
3282 | 3289 |
3283 /** | 3290 /** |
3284 * Initialize a newly created field element to have the given [name]. | 3291 * Initialize a newly created field element to have the given [name]. |
3285 */ | 3292 */ |
3286 FieldElementImpl.forNode(Identifier name) : super.forNode(name); | 3293 FieldElementImpl.forNode(Identifier name) : super.forNode(name); |
3287 | 3294 |
| 3295 /** |
| 3296 * Initialize using the given serialized information. |
| 3297 */ |
| 3298 FieldElementImpl.forSerialized( |
| 3299 UnlinkedVariable unlinkedVariable, ElementImpl enclosingElement) |
| 3300 : super.forSerialized(unlinkedVariable, enclosingElement); |
| 3301 |
3288 @override | 3302 @override |
3289 ClassElement get enclosingElement => super.enclosingElement as ClassElement; | 3303 ClassElement get enclosingElement => super.enclosingElement as ClassElement; |
3290 | 3304 |
3291 @override | 3305 @override |
3292 bool get isEnumConstant => | 3306 bool get isEnumConstant => |
3293 enclosingElement != null ? enclosingElement.isEnum : false; | 3307 enclosingElement != null ? enclosingElement.isEnum : false; |
3294 | 3308 |
3295 @override | 3309 @override |
3296 ElementKind get kind => ElementKind.FIELD; | 3310 ElementKind get kind => ElementKind.FIELD; |
3297 | 3311 |
(...skipping 3610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6908 | 6922 |
6909 @override | 6923 @override |
6910 void visitElement(Element element) { | 6924 void visitElement(Element element) { |
6911 int offset = element.nameOffset; | 6925 int offset = element.nameOffset; |
6912 if (offset != -1) { | 6926 if (offset != -1) { |
6913 map[offset] = element; | 6927 map[offset] = element; |
6914 } | 6928 } |
6915 super.visitElement(element); | 6929 super.visitElement(element); |
6916 } | 6930 } |
6917 } | 6931 } |
OLD | NEW |