| 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_experimental/analyzer.dart'; | 9 import 'package:analyzer_experimental/analyzer.dart'; |
| 10 import 'package:analyzer_experimental/src/generated/parser.dart'; | 10 import 'package:analyzer_experimental/src/generated/parser.dart'; |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 } | 446 } |
| 447 | 447 |
| 448 visitBreakStatement(BreakStatement node) { | 448 visitBreakStatement(BreakStatement node) { |
| 449 token(node.keyword); | 449 token(node.keyword); |
| 450 visitNode(node.label, precededBy: space); | 450 visitNode(node.label, precededBy: space); |
| 451 token(node.semicolon); | 451 token(node.semicolon); |
| 452 } | 452 } |
| 453 | 453 |
| 454 visitCascadeExpression(CascadeExpression node) { | 454 visitCascadeExpression(CascadeExpression node) { |
| 455 visit(node.target); | 455 visit(node.target); |
| 456 indent(2); |
| 456 visitNodes(node.cascadeSections); | 457 visitNodes(node.cascadeSections); |
| 458 unindent(2); |
| 457 } | 459 } |
| 458 | 460 |
| 459 visitCatchClause(CatchClause node) { | 461 visitCatchClause(CatchClause node) { |
| 460 | 462 |
| 461 token(node.onKeyword, precededBy: space, followedBy: space); | 463 token(node.onKeyword, precededBy: space, followedBy: space); |
| 462 visit(node.exceptionType); | 464 visit(node.exceptionType); |
| 463 | 465 |
| 464 if (node.catchKeyword != null) { | 466 if (node.catchKeyword != null) { |
| 465 if (node.exceptionType != null) { | 467 if (node.exceptionType != null) { |
| 466 space(); | 468 space(); |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1522 var lastLine = | 1524 var lastLine = |
| 1523 lineInfo.getLocation(lastOffset).lineNumber; | 1525 lineInfo.getLocation(lastOffset).lineNumber; |
| 1524 var currentLine = | 1526 var currentLine = |
| 1525 lineInfo.getLocation(currentOffset).lineNumber; | 1527 lineInfo.getLocation(currentOffset).lineNumber; |
| 1526 return currentLine - lastLine; | 1528 return currentLine - lastLine; |
| 1527 } | 1529 } |
| 1528 | 1530 |
| 1529 String toString() => writer.toString(); | 1531 String toString() => writer.toString(); |
| 1530 | 1532 |
| 1531 } | 1533 } |
| OLD | NEW |