OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of tree; | 5 part of tree; |
6 | 6 |
7 String unparse(Node node) { | 7 String unparse(Node node) { |
8 Unparser unparser = new Unparser(); | 8 Unparser unparser = new Unparser(); |
9 unparser.unparse(node); | 9 unparser.unparse(node); |
10 return unparser.result; | 10 return unparser.result; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 if (node.extendsKeyword != null) { | 60 if (node.extendsKeyword != null) { |
61 sb.write(' '); | 61 sb.write(' '); |
62 addToken(node.extendsKeyword); | 62 addToken(node.extendsKeyword); |
63 visit(node.superclass); | 63 visit(node.superclass); |
64 } | 64 } |
65 if (!node.interfaces.isEmpty) { | 65 if (!node.interfaces.isEmpty) { |
66 sb.write(' '); | 66 sb.write(' '); |
67 visit(node.interfaces); | 67 visit(node.interfaces); |
68 } | 68 } |
69 if (node.defaultClause != null) { | |
70 sb.write(' default '); | |
71 visit(node.defaultClause); | |
72 } | |
73 sb.write('{'); | 69 sb.write('{'); |
74 for (final member in members) { | 70 for (final member in members) { |
75 visit(member); | 71 visit(member); |
76 } | 72 } |
77 sb.write('}'); | 73 sb.write('}'); |
78 } | 74 } |
79 | 75 |
80 visitClassNode(ClassNode node) { | 76 visitClassNode(ClassNode node) { |
81 unparseClassWithBody(node, node.body.nodes); | 77 unparseClassWithBody(node, node.body.nodes); |
82 } | 78 } |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 } | 615 } |
620 | 616 |
621 visitStatement(Statement node) { | 617 visitStatement(Statement node) { |
622 throw 'internal error'; // Should not be called. | 618 throw 'internal error'; // Should not be called. |
623 } | 619 } |
624 | 620 |
625 visitStringNode(StringNode node) { | 621 visitStringNode(StringNode node) { |
626 throw 'internal error'; // Should not be called. | 622 throw 'internal error'; // Should not be called. |
627 } | 623 } |
628 } | 624 } |
OLD | NEW |