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

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

Issue 100553004: Fix for extra space preceding the 'on' keyword in a catch clause (dartbug.com/15454). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 | pkg/analyzer/test/services/formatter_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) 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/analyzer.dart'; 9 import 'package:analyzer/analyzer.dart';
10 import 'package:analyzer/src/generated/java_core.dart' show CharSequence; 10 import 'package:analyzer/src/generated/java_core.dart' show CharSequence;
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 459
460 visitCascadeExpression(CascadeExpression node) { 460 visitCascadeExpression(CascadeExpression node) {
461 visit(node.target); 461 visit(node.target);
462 indent(2); 462 indent(2);
463 visitNodes(node.cascadeSections); 463 visitNodes(node.cascadeSections);
464 unindent(2); 464 unindent(2);
465 } 465 }
466 466
467 visitCatchClause(CatchClause node) { 467 visitCatchClause(CatchClause node) {
468 468
469 token(node.onKeyword, precededBy: space, followedBy: space); 469 token(node.onKeyword, followedBy: space);
470 visit(node.exceptionType); 470 visit(node.exceptionType);
471 471
472 if (node.catchKeyword != null) { 472 if (node.catchKeyword != null) {
473 if (node.exceptionType != null) { 473 if (node.exceptionType != null) {
474 space(); 474 space();
475 } 475 }
476 token(node.catchKeyword); 476 token(node.catchKeyword);
477 space(); 477 space();
478 token(node.leftParenthesis); 478 token(node.leftParenthesis);
479 visit(node.exceptionParameter); 479 visit(node.exceptionParameter);
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
1565 var lastLine = 1565 var lastLine =
1566 lineInfo.getLocation(lastOffset).lineNumber; 1566 lineInfo.getLocation(lastOffset).lineNumber;
1567 var currentLine = 1567 var currentLine =
1568 lineInfo.getLocation(currentOffset).lineNumber; 1568 lineInfo.getLocation(currentOffset).lineNumber;
1569 return currentLine - lastLine; 1569 return currentLine - lastLine;
1570 } 1570 }
1571 1571
1572 String toString() => writer.toString(); 1572 String toString() => writer.toString();
1573 1573
1574 } 1574 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/services/formatter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698