| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |