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

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

Issue 1842533002: Don't serialize Label in NamedExpression as a label declaration. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 b.isDeferred = node.deferredKeyword != null; 1132 b.isDeferred = node.deferredKeyword != null;
1133 b.uri = node.uri.stringValue; 1133 b.uri = node.uri.stringValue;
1134 b.uriOffset = node.uri.offset; 1134 b.uriOffset = node.uri.offset;
1135 b.uriEnd = node.uri.end; 1135 b.uriEnd = node.uri.end;
1136 unlinkedImports.add(b); 1136 unlinkedImports.add(b);
1137 } 1137 }
1138 1138
1139 @override 1139 @override
1140 void visitLabel(Label node) { 1140 void visitLabel(Label node) {
1141 AstNode parent = node.parent; 1141 AstNode parent = node.parent;
1142 labels.add(new UnlinkedLabelBuilder( 1142 if (parent is! NamedExpression) {
1143 name: node.label.name, 1143 labels.add(new UnlinkedLabelBuilder(
1144 nameOffset: node.offset, 1144 name: node.label.name,
1145 isOnSwitchMember: parent is SwitchMember, 1145 nameOffset: node.offset,
1146 isOnSwitchStatement: 1146 isOnSwitchMember: parent is SwitchMember,
1147 parent is LabeledStatement && parent.statement is SwitchStatement)); 1147 isOnSwitchStatement: parent is LabeledStatement &&
1148 parent.statement is SwitchStatement));
1149 }
1148 } 1150 }
1149 1151
1150 @override 1152 @override
1151 void visitLibraryDirective(LibraryDirective node) { 1153 void visitLibraryDirective(LibraryDirective node) {
1152 libraryName = 1154 libraryName =
1153 node.name.components.map((SimpleIdentifier id) => id.name).join('.'); 1155 node.name.components.map((SimpleIdentifier id) => id.name).join('.');
1154 libraryNameOffset = node.name.offset; 1156 libraryNameOffset = node.name.offset;
1155 libraryNameLength = node.name.length; 1157 libraryNameLength = node.name.length;
1156 isCoreLibrary = libraryName == 'dart.core'; 1158 isCoreLibrary = libraryName == 'dart.core';
1157 libraryDocumentationComment = 1159 libraryDocumentationComment =
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 /** 1237 /**
1236 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. 1238 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s.
1237 */ 1239 */
1238 class _TypeParameterScope extends _Scope { 1240 class _TypeParameterScope extends _Scope {
1239 /** 1241 /**
1240 * Get the number of [_ScopedTypeParameter]s defined in this 1242 * Get the number of [_ScopedTypeParameter]s defined in this
1241 * [_TypeParameterScope]. 1243 * [_TypeParameterScope].
1242 */ 1244 */
1243 int get length => _definedNames.length; 1245 int get length => _definedNames.length;
1244 } 1246 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698