| 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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |