OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library kernel.ast_to_text; | 4 library kernel.ast_to_text; |
5 | 5 |
6 import '../ast.dart'; | 6 import '../ast.dart'; |
7 import '../import_table.dart'; | 7 import '../import_table.dart'; |
8 | 8 |
9 class Namer<T> { | 9 class Namer<T> { |
10 int index = 0; | 10 int index = 0; |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 writeWord("/* from ${node.fileUri} */"); | 726 writeWord("/* from ${node.fileUri} */"); |
727 } | 727 } |
728 writeFunction(node.function, name: getMemberName(node)); | 728 writeFunction(node.function, name: getMemberName(node)); |
729 } | 729 } |
730 | 730 |
731 visitConstructor(Constructor node) { | 731 visitConstructor(Constructor node) { |
732 writeAnnotationList(node.annotations); | 732 writeAnnotationList(node.annotations); |
733 writeIndentation(); | 733 writeIndentation(); |
734 writeModifier(node.isExternal, 'external'); | 734 writeModifier(node.isExternal, 'external'); |
735 writeModifier(node.isConst, 'const'); | 735 writeModifier(node.isConst, 'const'); |
| 736 writeModifier(node.isSyntheticDefault, 'default'); |
736 writeWord('constructor'); | 737 writeWord('constructor'); |
737 writeFunction(node.function, | 738 writeFunction(node.function, |
738 name: node.name, initializers: node.initializers); | 739 name: node.name, initializers: node.initializers); |
739 } | 740 } |
740 | 741 |
741 visitClass(Class node) { | 742 visitClass(Class node) { |
742 writeAnnotationList(node.annotations); | 743 writeAnnotationList(node.annotations); |
743 writeIndentation(); | 744 writeIndentation(); |
744 writeModifier(node.isAbstract, 'abstract'); | 745 writeModifier(node.isAbstract, 'abstract'); |
745 writeWord('class'); | 746 writeWord('class'); |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1643 } | 1644 } |
1644 throw 'illegal ProcedureKind: $kind'; | 1645 throw 'illegal ProcedureKind: $kind'; |
1645 } | 1646 } |
1646 | 1647 |
1647 class ExpressionPrinter { | 1648 class ExpressionPrinter { |
1648 final Printer writeer; | 1649 final Printer writeer; |
1649 final int minimumPrecedence; | 1650 final int minimumPrecedence; |
1650 | 1651 |
1651 ExpressionPrinter(this.writeer, this.minimumPrecedence); | 1652 ExpressionPrinter(this.writeer, this.minimumPrecedence); |
1652 } | 1653 } |
OLD | NEW |