Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: pkg/analyzer/lib/src/summary/summarize_ast.dart

Issue 1714113002: Add summary support for ParameterElement.defaultValueCode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/lib/src/summary/summarize_elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698