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

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

Issue 10831328: Support new try/catch syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « no previous file | tests/language/language.status » ('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) 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 // Returns null if no need to rename a node. 5 // Returns null if no need to rename a node.
6 typedef String Renamer(Node node); 6 typedef String Renamer(Node node);
7 7
8 class Unparser implements Visitor { 8 class Unparser implements Visitor {
9 Renamer rename; 9 Renamer rename;
10 StringBuffer sb; 10 StringBuffer sb;
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 } 463 }
464 464
465 visitCaseMatch(CaseMatch node) { 465 visitCaseMatch(CaseMatch node) {
466 add(node.caseKeyword.value); 466 add(node.caseKeyword.value);
467 sb.add(" "); 467 sb.add(" ");
468 visit(node.expression); 468 visit(node.expression);
469 add(node.colonToken.value); 469 add(node.colonToken.value);
470 } 470 }
471 471
472 visitCatchBlock(CatchBlock node) { 472 visitCatchBlock(CatchBlock node) {
473 addToken(node.onKeyword);
474 visit(node.type);
475 sb.add(' ');
473 addToken(node.catchKeyword); 476 addToken(node.catchKeyword);
474 visit(node.formals); 477 visit(node.formals);
475 sb.add(' '); 478 sb.add(' ');
476 visit(node.block); 479 visit(node.block);
477 } 480 }
478 481
479 visitTypedef(Typedef node) { 482 visitTypedef(Typedef node) {
480 addToken(node.typedefKeyword); 483 addToken(node.typedefKeyword);
481 if (node.returnType !== null) { 484 if (node.returnType !== null) {
482 visit(node.returnType); 485 visit(node.returnType);
483 sb.add(' '); 486 sb.add(' ');
484 } 487 }
485 visit(node.name); 488 visit(node.name);
486 if (node.typeParameters !== null) { 489 if (node.typeParameters !== null) {
487 visit(node.typeParameters); 490 visit(node.typeParameters);
488 } 491 }
489 visit(node.formals); 492 visit(node.formals);
490 add(node.endToken.value); 493 add(node.endToken.value);
491 } 494 }
492 } 495 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698