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

Side by Side Diff: pkg/analyzer/lib/src/dart/ast/utilities.dart

Issue 2725013003: Support accessing the parameter element when there is no name (Closed)
Patch Set: Created 3 years, 9 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 | « pkg/analyzer/lib/src/dart/ast/ast.dart ('k') | pkg/analyzer/lib/src/dart/element/builder.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.src.dart.ast.utilities; 5 library analyzer.src.dart.ast.utilities;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; 10 import 'package:analyzer/dart/ast/standard_ast_factory.dart';
(...skipping 6410 matching lines...) Expand 10 before | Expand all | Expand 10 after
6421 @override 6421 @override
6422 bool visitShowCombinator(ShowCombinator node) { 6422 bool visitShowCombinator(ShowCombinator node) {
6423 ShowCombinator toNode = this._toNode as ShowCombinator; 6423 ShowCombinator toNode = this._toNode as ShowCombinator;
6424 return _and(_isEqualTokens(node.keyword, toNode.keyword), 6424 return _and(_isEqualTokens(node.keyword, toNode.keyword),
6425 _isEqualNodeLists(node.shownNames, toNode.shownNames)); 6425 _isEqualNodeLists(node.shownNames, toNode.shownNames));
6426 } 6426 }
6427 6427
6428 @override 6428 @override
6429 bool visitSimpleFormalParameter(SimpleFormalParameter node) { 6429 bool visitSimpleFormalParameter(SimpleFormalParameter node) {
6430 SimpleFormalParameter toNode = this._toNode as SimpleFormalParameter; 6430 SimpleFormalParameter toNode = this._toNode as SimpleFormalParameter;
6431 return _and( 6431 if (_and(
6432 _isEqualNodes(node.documentationComment, toNode.documentationComment), 6432 _isEqualNodes(node.documentationComment, toNode.documentationComment),
6433 _isEqualNodeLists(node.metadata, toNode.metadata), 6433 _isEqualNodeLists(node.metadata, toNode.metadata),
6434 _isEqualTokens(node.keyword, toNode.keyword), 6434 _isEqualTokens(node.keyword, toNode.keyword),
6435 _isEqualNodes(node.type, toNode.type), 6435 _isEqualNodes(node.type, toNode.type),
6436 _isEqualNodes(node.identifier, toNode.identifier)); 6436 _isEqualNodes(node.identifier, toNode.identifier))) {
6437 (toNode as SimpleFormalParameterImpl).element = node.element;
6438 return true;
6439 }
6440 return false;
6437 } 6441 }
6438 6442
6439 @override 6443 @override
6440 bool visitSimpleIdentifier(SimpleIdentifier node) { 6444 bool visitSimpleIdentifier(SimpleIdentifier node) {
6441 SimpleIdentifier toNode = this._toNode as SimpleIdentifier; 6445 SimpleIdentifier toNode = this._toNode as SimpleIdentifier;
6442 if (_isEqualTokens(node.token, toNode.token)) { 6446 if (_isEqualTokens(node.token, toNode.token)) {
6443 toNode.staticElement = node.staticElement; 6447 toNode.staticElement = node.staticElement;
6444 toNode.staticType = node.staticType; 6448 toNode.staticType = node.staticType;
6445 toNode.propagatedElement = node.propagatedElement; 6449 toNode.propagatedElement = node.propagatedElement;
6446 toNode.propagatedType = node.propagatedType; 6450 toNode.propagatedType = node.propagatedType;
(...skipping 2924 matching lines...) Expand 10 before | Expand all | Expand 10 after
9371 if (node.star != null) { 9375 if (node.star != null) {
9372 sink.write("yield* "); 9376 sink.write("yield* ");
9373 } else { 9377 } else {
9374 sink.write("yield "); 9378 sink.write("yield ");
9375 } 9379 }
9376 safelyVisitNode(node.expression); 9380 safelyVisitNode(node.expression);
9377 sink.write(";"); 9381 sink.write(";");
9378 return null; 9382 return null;
9379 } 9383 }
9380 } 9384 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/ast.dart ('k') | pkg/analyzer/lib/src/dart/element/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698