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

Side by Side Diff: pkg/analyzer_experimental/lib/src/services/formatter_impl.dart

Issue 25304002: Unwanted field shadowing fix. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 formatter_impl; 5 library formatter_impl;
6 6
7 import 'dart:math'; 7 import 'dart:math';
8 8
9 import 'package:analyzer_experimental/analyzer.dart'; 9 import 'package:analyzer_experimental/analyzer.dart';
10 import 'package:analyzer_experimental/src/generated/parser.dart'; 10 import 'package:analyzer_experimental/src/generated/parser.dart';
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 //Handle EOLs before newlines 1287 //Handle EOLs before newlines
1288 if (isAtEOL(comment)) { 1288 if (isAtEOL(comment)) {
1289 emitComment(comment, previousToken); 1289 emitComment(comment, previousToken);
1290 comment = comment.next; 1290 comment = comment.next;
1291 currentToken = comment != null ? comment : token; 1291 currentToken = comment != null ? comment : token;
1292 } 1292 }
1293 1293
1294 var lines = max(min, countNewlinesBetween(previousToken, currentToken)); 1294 var lines = max(min, countNewlinesBetween(previousToken, currentToken));
1295 writer.newlines(lines); 1295 writer.newlines(lines);
1296 1296
1297 var previousToken = currentToken.previous; 1297 previousToken = currentToken.previous;
1298 1298
1299 while (comment != null) { 1299 while (comment != null) {
1300 1300
1301 emitComment(comment, previousToken); 1301 emitComment(comment, previousToken);
1302 1302
1303 var nextToken = comment.next != null ? comment.next : token; 1303 var nextToken = comment.next != null ? comment.next : token;
1304 var newlines = calculateNewlinesBetweenComments(comment, nextToken); 1304 var newlines = calculateNewlinesBetweenComments(comment, nextToken);
1305 if (newlines > 0) { 1305 if (newlines > 0) {
1306 writer.newlines(newlines); 1306 writer.newlines(newlines);
1307 lines += newlines; 1307 lines += newlines;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 var lastLine = 1407 var lastLine =
1408 lineInfo.getLocation(lastOffset).lineNumber; 1408 lineInfo.getLocation(lastOffset).lineNumber;
1409 var currentLine = 1409 var currentLine =
1410 lineInfo.getLocation(currentOffset).lineNumber; 1410 lineInfo.getLocation(currentOffset).lineNumber;
1411 return currentLine - lastLine; 1411 return currentLine - lastLine;
1412 } 1412 }
1413 1413
1414 String toString() => writer.toString(); 1414 String toString() => writer.toString();
1415 1415
1416 } 1416 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698