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

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

Issue 10695171: dart2dart fix "get" appearing before type in typed getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix unparser instead Created 8 years, 5 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 class Unparser implements Visitor { 5 class Unparser implements Visitor {
6 StringBuffer sb; 6 StringBuffer sb;
7 7
8 Unparser(); 8 Unparser();
9 9
10 String unparse(Node node) { 10 String unparse(Node node) {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 visitFunctionDeclaration(FunctionDeclaration node) { 80 visitFunctionDeclaration(FunctionDeclaration node) {
81 visit(node.function); 81 visit(node.function);
82 } 82 }
83 83
84 visitFunctionExpression(FunctionExpression node) { 84 visitFunctionExpression(FunctionExpression node) {
85 if (node.returnType !== null) { 85 if (node.returnType !== null) {
86 visit(node.returnType); 86 visit(node.returnType);
87 sb.add(' '); 87 sb.add(' ');
88 } 88 }
89 if (node.getOrSet !== null) {
90 add(node.getOrSet.value);
91 sb.add(' ');
92 }
89 // TODO(antonm): that's a workaround as currently FunctionExpression 93 // TODO(antonm): that's a workaround as currently FunctionExpression
90 // names are modelled with Send and it emits operator[] as only 94 // names are modelled with Send and it emits operator[] as only
91 // operator, without [] which are expected to be emitted with 95 // operator, without [] which are expected to be emitted with
92 // arguments. 96 // arguments.
93 if (node.name is Send) { 97 if (node.name is Send) {
94 Send send = node.name; 98 Send send = node.name;
95 assert(send is !SendSet); 99 assert(send is !SendSet);
96 visit(send.receiver); 100 visit(send.receiver);
97 visit(send.selector); 101 visit(send.selector);
98 } else { 102 } else {
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 sb.add(' '); 462 sb.add(' ');
459 } 463 }
460 visit(node.name); 464 visit(node.name);
461 if (node.typeParameters !== null) { 465 if (node.typeParameters !== null) {
462 visit(node.typeParameters); 466 visit(node.typeParameters);
463 } 467 }
464 visit(node.formals); 468 visit(node.formals);
465 add(node.endToken.value); 469 add(node.endToken.value);
466 } 470 }
467 } 471 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/dart_backend/emitter.dart ('k') | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698