| 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/java_core.dart' show CharSequence; | 10 import 'package:analyzer/src/generated/java_core.dart' show CharSequence; |
| (...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 newlines(); | 1194 newlines(); |
| 1195 indent(); | 1195 indent(); |
| 1196 visitNodes(node.statements, separatedBy: newlines); | 1196 visitNodes(node.statements, separatedBy: newlines); |
| 1197 unindent(); | 1197 unindent(); |
| 1198 } | 1198 } |
| 1199 | 1199 |
| 1200 visitSwitchDefault(SwitchDefault node) { | 1200 visitSwitchDefault(SwitchDefault node) { |
| 1201 visitNodes(node.labels, separatedBy: space, followedBy: space); | 1201 visitNodes(node.labels, separatedBy: space, followedBy: space); |
| 1202 token(node.keyword); | 1202 token(node.keyword); |
| 1203 token(node.colon); | 1203 token(node.colon); |
| 1204 space(); | 1204 newlines(); |
| 1205 visitNodes(node.statements, separatedBy: space); | 1205 indent(); |
| 1206 visitNodes(node.statements, separatedBy: newlines); |
| 1207 unindent(); |
| 1206 } | 1208 } |
| 1207 | 1209 |
| 1208 visitSwitchStatement(SwitchStatement node) { | 1210 visitSwitchStatement(SwitchStatement node) { |
| 1209 token(node.keyword); | 1211 token(node.keyword); |
| 1210 space(); | 1212 space(); |
| 1211 token(node.leftParenthesis); | 1213 token(node.leftParenthesis); |
| 1212 visit(node.expression); | 1214 visit(node.expression); |
| 1213 token(node.rightParenthesis); | 1215 token(node.rightParenthesis); |
| 1214 space(); | 1216 space(); |
| 1215 token(node.leftBracket); | 1217 token(node.leftBracket); |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1686 var lastLine = | 1688 var lastLine = |
| 1687 lineInfo.getLocation(lastOffset).lineNumber; | 1689 lineInfo.getLocation(lastOffset).lineNumber; |
| 1688 var currentLine = | 1690 var currentLine = |
| 1689 lineInfo.getLocation(currentOffset).lineNumber; | 1691 lineInfo.getLocation(currentOffset).lineNumber; |
| 1690 return currentLine - lastLine; | 1692 return currentLine - lastLine; |
| 1691 } | 1693 } |
| 1692 | 1694 |
| 1693 String toString() => writer.toString(); | 1695 String toString() => writer.toString(); |
| 1694 | 1696 |
| 1695 } | 1697 } |
| OLD | NEW |