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

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

Issue 10545056: Fix unparsing else/elseif (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 final bool printDebugInfo; 7 final bool printDebugInfo;
8 8
9 Unparser([this.printDebugInfo = false]); 9 Unparser([this.printDebugInfo = false]);
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 visitIdentifier(Identifier node) { 100 visitIdentifier(Identifier node) {
101 add(node.token.value); 101 add(node.token.value);
102 } 102 }
103 103
104 visitIf(If node) { 104 visitIf(If node) {
105 add(node.ifToken.value); 105 add(node.ifToken.value);
106 visit(node.condition); 106 visit(node.condition);
107 visit(node.thenPart); 107 visit(node.thenPart);
108 if (node.hasElsePart) { 108 if (node.hasElsePart) {
109 add(node.elseToken.value); 109 add(node.elseToken.value);
110 sb.add(' ');
110 visit(node.elsePart); 111 visit(node.elsePart);
111 } 112 }
112 } 113 }
113 114
114 visitLiteralBool(LiteralBool node) { 115 visitLiteralBool(LiteralBool node) {
115 add(node.token.value); 116 add(node.token.value);
116 } 117 }
117 118
118 visitLiteralDouble(LiteralDouble node) { 119 visitLiteralDouble(LiteralDouble node) {
119 add(node.token.value); 120 add(node.token.value);
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 sb.add(' '); 436 sb.add(' ');
436 } 437 }
437 visit(node.name); 438 visit(node.name);
438 if (node.typeParameters !== null) { 439 if (node.typeParameters !== null) {
439 visit(node.typeParameters); 440 visit(node.typeParameters);
440 } 441 }
441 visit(node.formals); 442 visit(node.formals);
442 add(node.endToken.value); 443 add(node.endToken.value);
443 } 444 }
444 } 445 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698