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

Side by Side Diff: dart/frog/leg/tree/unparser.dart

Issue 8660004: Parse parenthesized expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: frogsh Created 9 years 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 | « dart/frog/leg/tree/nodes.dart ('k') | dart/frog/leg/tree/visitors.dart » ('j') | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 add(node.endToken.value); 177 add(node.endToken.value);
178 } 178 }
179 } 179 }
180 180
181 visitDoWhile(DoWhile node) { 181 visitDoWhile(DoWhile node) {
182 add(node.doKeyword.value); 182 add(node.doKeyword.value);
183 sb.add(' '); 183 sb.add(' ');
184 visit(node.body); 184 visit(node.body);
185 sb.add(' '); 185 sb.add(' ');
186 add(node.whileKeyword.value); 186 add(node.whileKeyword.value);
187 sb.add(' ('); 187 sb.add(' ');
188 visit(node.condition); 188 visit(node.condition);
189 sb.add(')');
190 sb.add(node.endToken.value); 189 sb.add(node.endToken.value);
191 } 190 }
192 191
193 visitWhile(While node) { 192 visitWhile(While node) {
194 add(node.whileKeyword.value); 193 add(node.whileKeyword.value);
195 sb.add(' ('); 194 sb.add(' ');
196 visit(node.condition); 195 visit(node.condition);
197 sb.add(')');
198 sb.add(' '); 196 sb.add(' ');
199 visit(node.body); 197 visit(node.body);
200 } 198 }
199
200 visitParenthesizedExpression(ParenthesizedExpression node) {
201 add(node.getBeginToken().value);
202 visit(node.expression);
203 add(node.getEndToken().value);
204 }
201 } 205 }
OLDNEW
« no previous file with comments | « dart/frog/leg/tree/nodes.dart ('k') | dart/frog/leg/tree/visitors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698