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 5543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5554 int offset = super.nameOffset; | 5554 int offset = super.nameOffset; |
5555 if (offset == 0 && | 5555 if (offset == 0 && |
5556 _unlinkedLabel != null && | 5556 _unlinkedLabel != null && |
5557 _unlinkedLabel.nameOffset != 0) { | 5557 _unlinkedLabel.nameOffset != 0) { |
5558 return _unlinkedLabel.nameOffset; | 5558 return _unlinkedLabel.nameOffset; |
5559 } | 5559 } |
5560 return offset; | 5560 return offset; |
5561 } | 5561 } |
5562 | 5562 |
5563 @override | 5563 @override |
5564 T accept<T>(ElementVisitor<T> visitor) => visitor.visitLabelElement(this); | 5564 T accept<T>(ElementVisitor<T> visitor) => null; |
Brian Wilkerson
2017/07/06 22:42:52
It would be better to throw a not-implemented exce
scheglov
2017/07/07 15:05:33
Done.
| |
5565 | 5565 |
5566 /** | 5566 /** |
5567 * Create and return [LabelElement]s for the given [unlinkedLabels]. | 5567 * Create and return [LabelElement]s for the given [unlinkedLabels]. |
5568 */ | 5568 */ |
5569 static List<LabelElement> resynthesizeList( | 5569 static List<LabelElement> resynthesizeList( |
5570 ExecutableElementImpl enclosingExecutable, | 5570 ExecutableElementImpl enclosingExecutable, |
5571 List<UnlinkedLabel> unlinkedLabels) { | 5571 List<UnlinkedLabel> unlinkedLabels) { |
5572 int length = unlinkedLabels.length; | 5572 int length = unlinkedLabels.length; |
5573 if (length != 0) { | 5573 if (length != 0) { |
5574 List<LabelElement> elements = new List<LabelElement>(length); | 5574 List<LabelElement> elements = new List<LabelElement>(length); |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6375 return new SourceRange( | 6375 return new SourceRange( |
6376 _unlinkedVariable.visibleOffset, _unlinkedVariable.visibleLength); | 6376 _unlinkedVariable.visibleOffset, _unlinkedVariable.visibleLength); |
6377 } | 6377 } |
6378 if (_visibleRangeLength < 0) { | 6378 if (_visibleRangeLength < 0) { |
6379 return null; | 6379 return null; |
6380 } | 6380 } |
6381 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); | 6381 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); |
6382 } | 6382 } |
6383 | 6383 |
6384 @override | 6384 @override |
6385 T accept<T>(ElementVisitor<T> visitor) => | 6385 T accept<T>(ElementVisitor<T> visitor) => null; |
6386 visitor.visitLocalVariableElement(this); | |
6387 | 6386 |
6388 @override | 6387 @override |
6389 void appendTo(StringBuffer buffer) { | 6388 void appendTo(StringBuffer buffer) { |
6390 buffer.write(type); | 6389 buffer.write(type); |
6391 buffer.write(" "); | 6390 buffer.write(" "); |
6392 buffer.write(displayName); | 6391 buffer.write(displayName); |
6393 } | 6392 } |
6394 | 6393 |
6395 @override | 6394 @override |
6396 Declaration computeNode() => getNodeMatching( | 6395 Declaration computeNode() => getNodeMatching( |
(...skipping 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8934 | 8933 |
8935 @override | 8934 @override |
8936 DartObject computeConstantValue() => null; | 8935 DartObject computeConstantValue() => null; |
8937 | 8936 |
8938 @override | 8937 @override |
8939 void visitChildren(ElementVisitor visitor) { | 8938 void visitChildren(ElementVisitor visitor) { |
8940 super.visitChildren(visitor); | 8939 super.visitChildren(visitor); |
8941 _initializer?.accept(visitor); | 8940 _initializer?.accept(visitor); |
8942 } | 8941 } |
8943 } | 8942 } |
OLD | NEW |