| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 serialization.summarize_ast; | 5 library serialization.summarize_ast; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
| 9 import 'package:analyzer/dart/ast/visitor.dart'; | 9 import 'package:analyzer/dart/ast/visitor.dart'; |
| 10 import 'package:analyzer/src/generated/utilities_dart.dart'; | 10 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 node.documentationComment, | 833 node.documentationComment, |
| 834 node.metadata); | 834 node.metadata); |
| 835 } | 835 } |
| 836 | 836 |
| 837 @override | 837 @override |
| 838 void visitConstructorDeclaration(ConstructorDeclaration node) { | 838 void visitConstructorDeclaration(ConstructorDeclaration node) { |
| 839 UnlinkedExecutableBuilder b = new UnlinkedExecutableBuilder(); | 839 UnlinkedExecutableBuilder b = new UnlinkedExecutableBuilder(); |
| 840 if (node.name != null) { | 840 if (node.name != null) { |
| 841 b.name = node.name.name; | 841 b.name = node.name.name; |
| 842 b.nameOffset = node.name.offset; | 842 b.nameOffset = node.name.offset; |
| 843 b.periodOffset = node.period.offset; |
| 844 b.nameEnd = node.name.end; |
| 843 } else { | 845 } else { |
| 844 b.nameOffset = node.returnType.offset; | 846 b.nameOffset = node.returnType.offset; |
| 845 } | 847 } |
| 846 b.parameters = node.parameters.parameters | 848 b.parameters = node.parameters.parameters |
| 847 .map((FormalParameter p) => p.accept(this)) | 849 .map((FormalParameter p) => p.accept(this)) |
| 848 .toList(); | 850 .toList(); |
| 849 b.kind = UnlinkedExecutableKind.constructor; | 851 b.kind = UnlinkedExecutableKind.constructor; |
| 850 if (node.factoryKeyword != null) { | 852 if (node.factoryKeyword != null) { |
| 851 b.isFactory = true; | 853 b.isFactory = true; |
| 852 if (node.redirectedConstructor != null) { | 854 if (node.redirectedConstructor != null) { |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 /** | 1125 /** |
| 1124 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1126 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
| 1125 */ | 1127 */ |
| 1126 class _TypeParameterScope extends _Scope { | 1128 class _TypeParameterScope extends _Scope { |
| 1127 /** | 1129 /** |
| 1128 * Get the number of [_ScopedTypeParameter]s defined in this | 1130 * Get the number of [_ScopedTypeParameter]s defined in this |
| 1129 * [_TypeParameterScope]. | 1131 * [_TypeParameterScope]. |
| 1130 */ | 1132 */ |
| 1131 int get length => _definedNames.length; | 1133 int get length => _definedNames.length; |
| 1132 } | 1134 } |
| OLD | NEW |