| Index: lib/compiler/implementation/tree/unparser.dart
|
| diff --git a/lib/compiler/implementation/tree/unparser.dart b/lib/compiler/implementation/tree/unparser.dart
|
| index 1e551faaf03ea6e41558011395d0ac20ac840383..6c199d83c51c92e24b926ef2515d20a8a7aebd3c 100644
|
| --- a/lib/compiler/implementation/tree/unparser.dart
|
| +++ b/lib/compiler/implementation/tree/unparser.dart
|
| @@ -66,34 +66,47 @@ class Unparser implements Visitor {
|
| visit(node.expression);
|
| }
|
|
|
| - visitClassNode(ClassNode node) {
|
| + unparseClassWithBody(ClassNode node, void classBodyEmitter()) {
|
| addToken(node.beginToken);
|
| + if (node.beginToken.stringValue == 'abstract') {
|
| + addToken(node.beginToken.next);
|
| + }
|
| visit(node.name);
|
| if (node.typeParameters !== null) {
|
| visit(node.typeParameters);
|
| }
|
| - sb.add(' ');
|
| if (node.extendsKeyword !== null) {
|
| + sb.add(' ');
|
| addToken(node.extendsKeyword);
|
| visit(node.superclass);
|
| + }
|
| + if (!node.interfaces.isEmpty()) {
|
| sb.add(' ');
|
| + visit(node.interfaces);
|
| }
|
| - visit(node.interfaces);
|
| if (node.defaultClause !== null) {
|
| + sb.add(' default ');
|
| visit(node.defaultClause);
|
| - sb.add(' ');
|
| }
|
| - sb.add('{\n');
|
| - NodeList body = node.body;
|
| - if (body !== null) {
|
| - Link nodes = body.nodes;
|
| - if (!nodes.isEmpty()) {
|
| - sb.add(' ');
|
| - nodes.printOn(sb, '\n ');
|
| + sb.add('{');
|
| + classBodyEmitter();
|
| + sb.add('}');
|
| + }
|
| +
|
| + visitClassNode(ClassNode node) {
|
| + unparseClassWithBody(node, () {
|
| + NodeList body = node.body;
|
| + if (body !== null) {
|
| sb.add('\n');
|
| + Link nodes = body.nodes;
|
| + if (!nodes.isEmpty()) {
|
| + sb.add(' ');
|
| + nodes.printOn(sb, '\n ');
|
| + sb.add('\n');
|
| + }
|
| }
|
| - }
|
| - sb.add('}\n');
|
| + });
|
| + sb.add('\n');
|
| }
|
|
|
| visitConditional(Conditional node) {
|
|
|