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

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

Issue 1715723002: Fix node replacer to handle comments on variable declaration lists (issue 25818) (Closed) Base URL: https://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
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/utilities_test.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/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 4932 matching lines...) Expand 10 before | Expand all | Expand 10 after
4943 } 4943 }
4944 4944
4945 @override 4945 @override
4946 bool visitVariableDeclarationList(VariableDeclarationList node) { 4946 bool visitVariableDeclarationList(VariableDeclarationList node) {
4947 if (identical(node.type, _oldNode)) { 4947 if (identical(node.type, _oldNode)) {
4948 node.type = _newNode as TypeName; 4948 node.type = _newNode as TypeName;
4949 return true; 4949 return true;
4950 } else if (_replaceInList(node.variables)) { 4950 } else if (_replaceInList(node.variables)) {
4951 return true; 4951 return true;
4952 } 4952 }
4953 return visitNode(node); 4953 return visitAnnotatedNode(node);
4954 } 4954 }
4955 4955
4956 @override 4956 @override
4957 bool visitVariableDeclarationStatement(VariableDeclarationStatement node) { 4957 bool visitVariableDeclarationStatement(VariableDeclarationStatement node) {
4958 if (identical(node.variables, _oldNode)) { 4958 if (identical(node.variables, _oldNode)) {
4959 node.variables = _newNode as VariableDeclarationList; 4959 node.variables = _newNode as VariableDeclarationList;
4960 return true; 4960 return true;
4961 } 4961 }
4962 return visitNode(node); 4962 return visitNode(node);
4963 } 4963 }
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
6347 * Safely visit the given [token], printing the [suffix] after the token if it 6347 * Safely visit the given [token], printing the [suffix] after the token if it
6348 * is non-`null`. 6348 * is non-`null`.
6349 */ 6349 */
6350 void _visitTokenWithSuffix(Token token, String suffix) { 6350 void _visitTokenWithSuffix(Token token, String suffix) {
6351 if (token != null) { 6351 if (token != null) {
6352 _writer.print(token.lexeme); 6352 _writer.print(token.lexeme);
6353 _writer.print(suffix); 6353 _writer.print(suffix);
6354 } 6354 }
6355 } 6355 }
6356 } 6356 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/utilities_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698