| 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 serializeFunctionBody(b, node.body); | 880 serializeFunctionBody(b, node.body); |
| 881 executables.add(b); | 881 executables.add(b); |
| 882 } | 882 } |
| 883 | 883 |
| 884 @override | 884 @override |
| 885 UnlinkedParamBuilder visitDefaultFormalParameter( | 885 UnlinkedParamBuilder visitDefaultFormalParameter( |
| 886 DefaultFormalParameter node) { | 886 DefaultFormalParameter node) { |
| 887 UnlinkedParamBuilder b = node.parameter.accept(this); | 887 UnlinkedParamBuilder b = node.parameter.accept(this); |
| 888 if (node.defaultValue != null) { | 888 if (node.defaultValue != null) { |
| 889 b.defaultValue = serializeConstExpr(node.defaultValue); | 889 b.defaultValue = serializeConstExpr(node.defaultValue); |
| 890 b.defaultValueCode = node.defaultValue.toSource(); |
| 890 } | 891 } |
| 891 b.initializer = serializeInitializerFunction(node.defaultValue); | 892 b.initializer = serializeInitializerFunction(node.defaultValue); |
| 892 return b; | 893 return b; |
| 893 } | 894 } |
| 894 | 895 |
| 895 @override | 896 @override |
| 896 void visitEnumDeclaration(EnumDeclaration node) { | 897 void visitEnumDeclaration(EnumDeclaration node) { |
| 897 UnlinkedEnumBuilder b = new UnlinkedEnumBuilder(); | 898 UnlinkedEnumBuilder b = new UnlinkedEnumBuilder(); |
| 898 b.name = node.name.name; | 899 b.name = node.name.name; |
| 899 b.nameOffset = node.name.offset; | 900 b.nameOffset = node.name.offset; |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 /** | 1123 /** |
| 1123 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1124 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
| 1124 */ | 1125 */ |
| 1125 class _TypeParameterScope extends _Scope { | 1126 class _TypeParameterScope extends _Scope { |
| 1126 /** | 1127 /** |
| 1127 * Get the number of [_ScopedTypeParameter]s defined in this | 1128 * Get the number of [_ScopedTypeParameter]s defined in this |
| 1128 * [_TypeParameterScope]. | 1129 * [_TypeParameterScope]. |
| 1129 */ | 1130 */ |
| 1130 int get length => _definedNames.length; | 1131 int get length => _definedNames.length; |
| 1131 } | 1132 } |
| OLD | NEW |