| 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/dart/element/type.dart' show DartType; | 10 import 'package:analyzer/dart/element/type.dart' show DartType; |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 * Serialize a [FieldFormalParameter], [FunctionTypedFormalParameter], or | 801 * Serialize a [FieldFormalParameter], [FunctionTypedFormalParameter], or |
| 802 * [SimpleFormalParameter] into an [UnlinkedParam]. | 802 * [SimpleFormalParameter] into an [UnlinkedParam]. |
| 803 */ | 803 */ |
| 804 UnlinkedParamBuilder serializeParameter(NormalFormalParameter node) { | 804 UnlinkedParamBuilder serializeParameter(NormalFormalParameter node) { |
| 805 UnlinkedParamBuilder b = new UnlinkedParamBuilder(); | 805 UnlinkedParamBuilder b = new UnlinkedParamBuilder(); |
| 806 b.name = node.identifier.name; | 806 b.name = node.identifier.name; |
| 807 b.nameOffset = node.identifier.offset; | 807 b.nameOffset = node.identifier.offset; |
| 808 b.annotations = serializeAnnotations(node.metadata); | 808 b.annotations = serializeAnnotations(node.metadata); |
| 809 b.codeRange = serializeCodeRange(node); | 809 b.codeRange = serializeCodeRange(node); |
| 810 b.isExplicitlyCovariant = node.covariantKeyword != null; | 810 b.isExplicitlyCovariant = node.covariantKeyword != null; |
| 811 b.isFinal = node.isFinal; |
| 811 if (_parametersMayInheritCovariance) { | 812 if (_parametersMayInheritCovariance) { |
| 812 b.inheritsCovariantSlot = assignSlot(); | 813 b.inheritsCovariantSlot = assignSlot(); |
| 813 } | 814 } |
| 814 switch (node.kind) { | 815 switch (node.kind) { |
| 815 case ParameterKind.REQUIRED: | 816 case ParameterKind.REQUIRED: |
| 816 b.kind = UnlinkedParamKind.required; | 817 b.kind = UnlinkedParamKind.required; |
| 817 break; | 818 break; |
| 818 case ParameterKind.POSITIONAL: | 819 case ParameterKind.POSITIONAL: |
| 819 b.kind = UnlinkedParamKind.positional; | 820 b.kind = UnlinkedParamKind.positional; |
| 820 break; | 821 break; |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1419 /** | 1420 /** |
| 1420 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1421 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
| 1421 */ | 1422 */ |
| 1422 class _TypeParameterScope extends _Scope { | 1423 class _TypeParameterScope extends _Scope { |
| 1423 /** | 1424 /** |
| 1424 * Get the number of [_ScopedTypeParameter]s defined in this | 1425 * Get the number of [_ScopedTypeParameter]s defined in this |
| 1425 * [_TypeParameterScope]. | 1426 * [_TypeParameterScope]. |
| 1426 */ | 1427 */ |
| 1427 int get length => _definedNames.length; | 1428 int get length => _definedNames.length; |
| 1428 } | 1429 } |
| OLD | NEW |