Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1267)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/tree/unparser.dart

Issue 422483002: Mix in [TreeElementMixin] only on nodes that need it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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, {minify: true}) { 7 String unparse(Node node, {minify: true}) {
8 Unparser unparser = new Unparser(minify: minify); 8 Unparser unparser = new Unparser(minify: minify);
9 unparser.unparse(node); 9 unparser.unparse(node);
10 return unparser.result; 10 return unparser.result;
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 359 }
360 360
361 visitNodeList(NodeList node) { 361 visitNodeList(NodeList node) {
362 unparseNodeList(node); 362 unparseNodeList(node);
363 } 363 }
364 364
365 visitOperator(Operator node) { 365 visitOperator(Operator node) {
366 visitIdentifier(node); 366 visitIdentifier(node);
367 } 367 }
368 368
369 visitRedirectingFactoryBody(RedirectingFactoryBody node) {
370 space();
371 write(node.beginToken.value);
372 space();
373 visit(node.constructorReference);
374 write(node.endToken.value);
375 }
376
369 visitRethrow(Rethrow node) { 377 visitRethrow(Rethrow node) {
370 write('rethrow;'); 378 write('rethrow;');
371 } 379 }
372 380
373 visitReturn(Return node) { 381 visitReturn(Return node) {
374 if (node.isRedirectingFactoryBody) {
375 write(' ');
376 }
377 write(node.beginToken.value); 382 write(node.beginToken.value);
378 if (node.hasExpression && node.beginToken.stringValue != '=>') { 383 if (node.hasExpression && node.beginToken.stringValue != '=>') {
379 write(' '); 384 write(' ');
380 } 385 }
381 if (node.beginToken.stringValue == '=>') space(); 386 if (node.beginToken.stringValue == '=>') space();
382 visit(node.expression); 387 visit(node.expression);
383 if (node.endToken != null) write(node.endToken.value); 388 if (node.endToken != null) write(node.endToken.value);
384 } 389 }
385 390
386 unparseSendReceiver(Send node, {bool spacesNeeded: false}) { 391 unparseSendReceiver(Send node, {bool spacesNeeded: false}) {
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 } 794 }
790 795
791 visitStatement(Statement node) { 796 visitStatement(Statement node) {
792 throw 'internal error'; // Should not be called. 797 throw 'internal error'; // Should not be called.
793 } 798 }
794 799
795 visitStringNode(StringNode node) { 800 visitStringNode(StringNode node) {
796 throw 'internal error'; // Should not be called. 801 throw 'internal error'; // Should not be called.
797 } 802 }
798 } 803 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698