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

Side by Side Diff: pkg/analyzer/lib/src/services/writer.dart

Issue 709493002: Fix 'Unused local variable' hints in analyzer and analysis_server. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
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 source_writer; 5 library source_writer;
6 6
7 import 'dart:math' as math; 7 import 'dart:math' as math;
8 8
9 class Line { 9 class Line {
10 10
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 length = 0; 150 length = 0;
151 continue; 151 continue;
152 } 152 }
153 } 153 }
154 length += token.length; 154 length += token.length;
155 } 155 }
156 if (start < tokens.length) { 156 if (start < tokens.length) {
157 newChunks.add(chunk.subChunk(newIndent, start)); 157 newChunks.add(chunk.subChunk(newIndent, start));
158 } 158 }
159 } else { 159 } else {
160 List<LineToken> part = [];
161 int start = 0; 160 int start = 0;
162 for (int i = 0; i < tokens.length; i++) { 161 for (int i = 0; i < tokens.length; i++) {
163 LineToken token = tokens[i]; 162 LineToken token = tokens[i];
164 if (token is SpaceToken && token.breakWeight == weight) { 163 if (token is SpaceToken && token.breakWeight == weight) {
165 newChunks.add(chunk.subChunk(newIndent, start, i)); 164 newChunks.add(chunk.subChunk(newIndent, start, i));
166 newIndent = chunk.indent + 2; 165 newIndent = chunk.indent + 2;
167 start = i + 1; 166 start = i + 1;
168 } 167 }
169 } 168 }
170 if (start < tokens.length) { 169 if (start < tokens.length) {
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 508
510 String getTabs(int n) => n < TABS.length ? TABS[n] : repeat('\t', n); 509 String getTabs(int n) => n < TABS.length ? TABS[n] : repeat('\t', n);
511 510
512 String repeat(String ch, int times) { 511 String repeat(String ch, int times) {
513 var sb = new StringBuffer(); 512 var sb = new StringBuffer();
514 for (var i = 0; i < times; ++i) { 513 for (var i = 0; i < times; ++i) {
515 sb.write(ch); 514 sb.write(ch);
516 } 515 }
517 return sb.toString(); 516 return sb.toString();
518 } 517 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/services/formatter_impl.dart ('k') | pkg/analyzer/test/file_system/memory_file_system_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698