| 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 } | 673 } |
| 674 | 674 |
| 675 visitPrefixedBody(space, body); | 675 visitPrefixedBody(space, body); |
| 676 } | 676 } |
| 677 | 677 |
| 678 visitConstructorInitializers(ConstructorDeclaration node) { | 678 visitConstructorInitializers(ConstructorDeclaration node) { |
| 679 if (node.initializers.length > 1) { | 679 if (node.initializers.length > 1) { |
| 680 newlines(); | 680 newlines(); |
| 681 } else { | 681 } else { |
| 682 preserveLeadingNewlines(); | 682 preserveLeadingNewlines(); |
| 683 space(); | 683 levelSpace(lastSpaceWeight++); |
| 684 } | 684 } |
| 685 indent(2); | 685 indent(2); |
| 686 token(node.separator /* : */); | 686 token(node.separator /* : */); |
| 687 space(); | 687 space(); |
| 688 for (var i = 0; i < node.initializers.length; i++) { | 688 for (var i = 0; i < node.initializers.length; i++) { |
| 689 if (i > 0) { | 689 if (i > 0) { |
| 690 // preceding comma | 690 // preceding comma |
| 691 token(node.initializers[i].beginToken.previous); | 691 token(node.initializers[i].beginToken.previous); |
| 692 newlines(); | 692 newlines(); |
| 693 space(n: 2, allowLineLeading: true); | 693 space(n: 2, allowLineLeading: true); |
| (...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1852 @override | 1852 @override |
| 1853 visitEnumConstantDeclaration(EnumConstantDeclaration node) { | 1853 visitEnumConstantDeclaration(EnumConstantDeclaration node) { |
| 1854 // TODO: implement visitEnumConstantDeclaration | 1854 // TODO: implement visitEnumConstantDeclaration |
| 1855 } | 1855 } |
| 1856 | 1856 |
| 1857 @override | 1857 @override |
| 1858 visitEnumDeclaration(EnumDeclaration node) { | 1858 visitEnumDeclaration(EnumDeclaration node) { |
| 1859 // TODO: implement visitEnumDeclaration | 1859 // TODO: implement visitEnumDeclaration |
| 1860 } | 1860 } |
| 1861 } | 1861 } |
| OLD | NEW |