| 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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 token(node.keyword); | 939 token(node.keyword); |
| 940 space(); | 940 space(); |
| 941 visitCommaSeparatedNodes(node.interfaces); | 941 visitCommaSeparatedNodes(node.interfaces); |
| 942 } | 942 } |
| 943 | 943 |
| 944 visitImportDirective(ImportDirective node) { | 944 visitImportDirective(ImportDirective node) { |
| 945 visitDirectiveMetadata(node.metadata); | 945 visitDirectiveMetadata(node.metadata); |
| 946 token(node.keyword); | 946 token(node.keyword); |
| 947 nonBreakingSpace(); | 947 nonBreakingSpace(); |
| 948 visit(node.uri); | 948 visit(node.uri); |
| 949 token(node.deferredToken, precededBy: space); |
| 949 token(node.asToken, precededBy: space, followedBy: space); | 950 token(node.asToken, precededBy: space, followedBy: space); |
| 950 allowContinuedLines((){ | 951 allowContinuedLines((){ |
| 951 visit(node.prefix); | 952 visit(node.prefix); |
| 952 visitNodes(node.combinators, precededBy: space, separatedBy: space); | 953 visitNodes(node.combinators, precededBy: space, separatedBy: space); |
| 953 }); | 954 }); |
| 954 token(node.semicolon); | 955 token(node.semicolon); |
| 955 } | 956 } |
| 956 | 957 |
| 957 visitIndexExpression(IndexExpression node) { | 958 visitIndexExpression(IndexExpression node) { |
| 958 if (node.isCascaded) { | 959 if (node.isCascaded) { |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1772 var lastLine = | 1773 var lastLine = |
| 1773 lineInfo.getLocation(lastOffset).lineNumber; | 1774 lineInfo.getLocation(lastOffset).lineNumber; |
| 1774 var currentLine = | 1775 var currentLine = |
| 1775 lineInfo.getLocation(currentOffset).lineNumber; | 1776 lineInfo.getLocation(currentOffset).lineNumber; |
| 1776 return currentLine - lastLine; | 1777 return currentLine - lastLine; |
| 1777 } | 1778 } |
| 1778 | 1779 |
| 1779 String toString() => writer.toString(); | 1780 String toString() => writer.toString(); |
| 1780 | 1781 |
| 1781 } | 1782 } |
| OLD | NEW |