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

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

Issue 11783089: Fix VariableDefinitions.endToken for formal parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Handle for-in. Created 7 years, 10 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) { 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 visitExpressionStatement(ExpressionStatement node) { 117 visitExpressionStatement(ExpressionStatement node) {
118 visit(node.expression); 118 visit(node.expression);
119 add(node.endToken.value); 119 add(node.endToken.value);
120 } 120 }
121 121
122 visitFor(For node) { 122 visitFor(For node) {
123 add(node.forToken.value); 123 add(node.forToken.value);
124 sb.add('('); 124 sb.add('(');
125 visit(node.initializer); 125 visit(node.initializer);
126 if (node.initializer is !Statement) sb.add(';'); 126 sb.add(';');
127 visit(node.conditionStatement); 127 visit(node.conditionStatement);
128 visit(node.update); 128 visit(node.update);
129 sb.add(')'); 129 sb.add(')');
130 visit(node.body); 130 visit(node.body);
131 } 131 }
132 132
133 visitFunctionDeclaration(FunctionDeclaration node) { 133 visitFunctionDeclaration(FunctionDeclaration node) {
134 visit(node.function); 134 visit(node.function);
135 } 135 }
136 136
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 visitVariableDefinitions(VariableDefinitions node) { 359 visitVariableDefinitions(VariableDefinitions node) {
360 visit(node.modifiers); 360 visit(node.modifiers);
361 if (!node.modifiers.nodes.isEmpty) { 361 if (!node.modifiers.nodes.isEmpty) {
362 sb.add(' '); 362 sb.add(' ');
363 } 363 }
364 if (node.type != null) { 364 if (node.type != null) {
365 visit(node.type); 365 visit(node.type);
366 sb.add(' '); 366 sb.add(' ');
367 } 367 }
368 visit(node.definitions); 368 visit(node.definitions);
369 if (node.endToken.value == const SourceString(';')) {
370 add(node.endToken.value);
371 }
372 } 369 }
373 370
374 visitDoWhile(DoWhile node) { 371 visitDoWhile(DoWhile node) {
375 add(node.doKeyword.value); 372 add(node.doKeyword.value);
376 if (node.body is !Block) sb.add(' '); 373 if (node.body is !Block) sb.add(' ');
377 visit(node.body); 374 visit(node.body);
378 add(node.whileKeyword.value); 375 add(node.whileKeyword.value);
379 visit(node.condition); 376 visit(node.condition);
380 sb.add(node.endToken.value); 377 sb.add(node.endToken.value);
381 } 378 }
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 } 618 }
622 619
623 visitStatement(Statement node) { 620 visitStatement(Statement node) {
624 throw 'internal error'; // Should not be called. 621 throw 'internal error'; // Should not be called.
625 } 622 }
626 623
627 visitStringNode(StringNode node) { 624 visitStringNode(StringNode node) {
628 throw 'internal error'; // Should not be called. 625 throw 'internal error'; // Should not be called.
629 } 626 }
630 } 627 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698