| 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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 token(node.thisToken); | 747 token(node.thisToken); |
| 748 token(node.period); | 748 token(node.period); |
| 749 visit(node.identifier); | 749 visit(node.identifier); |
| 750 visit(node.parameters); | 750 visit(node.parameters); |
| 751 } | 751 } |
| 752 | 752 |
| 753 visitForEachStatement(ForEachStatement node) { | 753 visitForEachStatement(ForEachStatement node) { |
| 754 token(node.forKeyword); | 754 token(node.forKeyword); |
| 755 space(); | 755 space(); |
| 756 token(node.leftParenthesis); | 756 token(node.leftParenthesis); |
| 757 visit(node.loopVariable); | 757 if (node.loopVariable != null) { |
| 758 visit(node.loopVariable); |
| 759 } else { |
| 760 visit(node.identifier); |
| 761 } |
| 758 space(); | 762 space(); |
| 759 token(node.inKeyword); | 763 token(node.inKeyword); |
| 760 space(); | 764 space(); |
| 761 visit(node.iterator); | 765 visit(node.iterator); |
| 762 token(node.rightParenthesis); | 766 token(node.rightParenthesis); |
| 763 space(); | 767 space(); |
| 764 visit(node.body); | 768 visit(node.body); |
| 765 } | 769 } |
| 766 | 770 |
| 767 visitFormalParameterList(FormalParameterList node) { | 771 visitFormalParameterList(FormalParameterList node) { |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1668 var lastLine = | 1672 var lastLine = |
| 1669 lineInfo.getLocation(lastOffset).lineNumber; | 1673 lineInfo.getLocation(lastOffset).lineNumber; |
| 1670 var currentLine = | 1674 var currentLine = |
| 1671 lineInfo.getLocation(currentOffset).lineNumber; | 1675 lineInfo.getLocation(currentOffset).lineNumber; |
| 1672 return currentLine - lastLine; | 1676 return currentLine - lastLine; |
| 1673 } | 1677 } |
| 1674 | 1678 |
| 1675 String toString() => writer.toString(); | 1679 String toString() => writer.toString(); |
| 1676 | 1680 |
| 1677 } | 1681 } |
| OLD | NEW |