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

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

Issue 1636113002: Serialize static constant field references. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/visitor.dart'; 8 import 'package:analyzer/dart/ast/visitor.dart';
9 import 'package:analyzer/src/generated/scanner.dart'; 9 import 'package:analyzer/src/generated/scanner.dart';
10 import 'package:analyzer/src/generated/utilities_dart.dart'; 10 import 'package:analyzer/src/generated/utilities_dart.dart';
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 b.reference = 49 b.reference =
50 visitor.serializeReference(prefix, identifier.identifier.name); 50 visitor.serializeReference(prefix, identifier.identifier.name);
51 } else { 51 } else {
52 throw new StateError( 52 throw new StateError(
53 'Unexpected identifier type: ${identifier.runtimeType}'); 53 'Unexpected identifier type: ${identifier.runtimeType}');
54 } 54 }
55 return b; 55 return b;
56 } 56 }
57 57
58 @override 58 @override
59 EntityRefBuilder serializePropertyAccess(PropertyAccess access) {
60 Expression target = access.target;
61 if (target is Identifier) {
62 EntityRefBuilder targetRef = serializeIdentifier(target);
63 return new EntityRefBuilder(
64 reference: visitor.serializeReference(
65 targetRef.reference, access.propertyName.name));
66 } else {
67 throw new StateError('Unexpected target type: ${target.runtimeType}');
Paul Berry 2016/01/26 20:52:49 Add a TODO comment here. We're going to need to b
scheglov 2016/01/26 21:02:29 Done.
68 }
69 }
70
71 @override
59 EntityRefBuilder serializeType(TypeName node) { 72 EntityRefBuilder serializeType(TypeName node) {
60 return visitor.serializeTypeName(node); 73 return visitor.serializeTypeName(node);
61 } 74 }
62 } 75 }
63 76
64 /** 77 /**
65 * An [_OtherScopedEntity] is a [_ScopedEntity] that does not refer to a type 78 * An [_OtherScopedEntity] is a [_ScopedEntity] that does not refer to a type
66 * parameter. Since we don't need to track any special information about these 79 * parameter. Since we don't need to track any special information about these
67 * types of scoped entities, it is a singleton class. 80 * types of scoped entities, it is a singleton class.
68 */ 81 */
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 /** 874 /**
862 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. 875 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s.
863 */ 876 */
864 class _TypeParameterScope extends _Scope { 877 class _TypeParameterScope extends _Scope {
865 /** 878 /**
866 * Get the number of [_ScopedTypeParameter]s defined in this 879 * Get the number of [_ScopedTypeParameter]s defined in this
867 * [_TypeParameterScope]. 880 * [_TypeParameterScope].
868 */ 881 */
869 int get length => _definedNames.length; 882 int get length => _definedNames.length;
870 } 883 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698