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

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

Issue 322483002: Formatter: do not use a space when using < and > for a map literal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | pkg/analyzer/test/services/data/style_guide_tests.data » ('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/parser.dart'; 10 import 'package:analyzer/src/generated/parser.dart';
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 visit(node.typeArguments); 1023 visit(node.typeArguments);
1024 token(node.leftBracket); 1024 token(node.leftBracket);
1025 indent(); 1025 indent();
1026 visitCommaSeparatedNodes(node.elements /*, followedBy: breakableSpace*/); 1026 visitCommaSeparatedNodes(node.elements /*, followedBy: breakableSpace*/);
1027 optionalTrailingComma(node.rightBracket); 1027 optionalTrailingComma(node.rightBracket);
1028 token(node.rightBracket, precededBy: unindent); 1028 token(node.rightBracket, precededBy: unindent);
1029 } 1029 }
1030 1030
1031 visitMapLiteral(MapLiteral node) { 1031 visitMapLiteral(MapLiteral node) {
1032 modifier(node.constKeyword); 1032 modifier(node.constKeyword);
1033 visitNode(node.typeArguments, followedBy: space); 1033 visitNode(node.typeArguments);
1034 token(node.leftBracket); 1034 token(node.leftBracket);
1035 if (!node.entries.isEmpty) { 1035 if (!node.entries.isEmpty) {
1036 newlines(); 1036 newlines();
1037 indent(); 1037 indent();
1038 visitCommaSeparatedNodes(node.entries, followedBy: newlines); 1038 visitCommaSeparatedNodes(node.entries, followedBy: newlines);
1039 optionalTrailingComma(node.rightBracket); 1039 optionalTrailingComma(node.rightBracket);
1040 unindent(); 1040 unindent();
1041 newlines(); 1041 newlines();
1042 } 1042 }
1043 token(node.rightBracket); 1043 token(node.rightBracket);
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1768 var lastLine = 1768 var lastLine =
1769 lineInfo.getLocation(lastOffset).lineNumber; 1769 lineInfo.getLocation(lastOffset).lineNumber;
1770 var currentLine = 1770 var currentLine =
1771 lineInfo.getLocation(currentOffset).lineNumber; 1771 lineInfo.getLocation(currentOffset).lineNumber;
1772 return currentLine - lastLine; 1772 return currentLine - lastLine;
1773 } 1773 }
1774 1774
1775 String toString() => writer.toString(); 1775 String toString() => writer.toString();
1776 1776
1777 } 1777 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/services/data/style_guide_tests.data » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698