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

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

Issue 10905203: Allow catch part to be optional as in try {} on T [catch (x[,y])] {} (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 years, 3 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 | « lib/compiler/implementation/tree/nodes.dart ('k') | tests/co19/co19-dart2js.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 String unparse(Node node) { 8 String unparse(Node node) {
9 Unparser unparser = new Unparser(); 9 Unparser unparser = new Unparser();
10 unparser.unparse(node); 10 unparser.unparse(node);
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 if (node.prefixIdentifier !== null) { 466 if (node.prefixIdentifier !== null) {
467 visit(node.prefixIdentifier); 467 visit(node.prefixIdentifier);
468 sb.add(':'); 468 sb.add(':');
469 visit(node.prefix); 469 visit(node.prefix);
470 } 470 }
471 sb.add(')'); 471 sb.add(')');
472 add(node.endToken.value); 472 add(node.endToken.value);
473 } 473 }
474 474
475 visitTryStatement(TryStatement node) { 475 visitTryStatement(TryStatement node) {
476 add(node.tryKeyword.value); 476 addToken(node.tryKeyword);
477 visit(node.tryBlock); 477 visit(node.tryBlock);
478 visit(node.catchBlocks); 478 visit(node.catchBlocks);
479 if (node.finallyKeyword !== null) { 479 if (node.finallyKeyword !== null) {
480 addToken(node.finallyKeyword); 480 addToken(node.finallyKeyword);
481 visit(node.finallyBlock); 481 visit(node.finallyBlock);
482 } 482 }
483 } 483 }
484 484
485 visitCaseMatch(CaseMatch node) { 485 visitCaseMatch(CaseMatch node) {
486 add(node.caseKeyword.value); 486 add(node.caseKeyword.value);
487 sb.add(" "); 487 sb.add(" ");
488 visit(node.expression); 488 visit(node.expression);
489 add(node.colonToken.value); 489 add(node.colonToken.value);
490 } 490 }
491 491
492 visitCatchBlock(CatchBlock node) { 492 visitCatchBlock(CatchBlock node) {
493 addToken(node.onKeyword); 493 addToken(node.onKeyword);
494 if (node.type !== null) { 494 if (node.type !== null) {
495 visit(node.type); 495 visit(node.type);
496 sb.add(' '); 496 sb.add(' ');
497 } 497 }
498 add(node.catchKeyword.value); 498 addToken(node.catchKeyword);
499 visit(node.formals); 499 visit(node.formals);
500 visit(node.block); 500 visit(node.block);
501 } 501 }
502 502
503 visitTypedef(Typedef node) { 503 visitTypedef(Typedef node) {
504 addToken(node.typedefKeyword); 504 addToken(node.typedefKeyword);
505 if (node.returnType !== null) { 505 if (node.returnType !== null) {
506 visit(node.returnType); 506 visit(node.returnType);
507 sb.add(' '); 507 sb.add(' ');
508 } 508 }
509 visit(node.name); 509 visit(node.name);
510 if (node.typeParameters !== null) { 510 if (node.typeParameters !== null) {
511 visit(node.typeParameters); 511 visit(node.typeParameters);
512 } 512 }
513 visit(node.formals); 513 visit(node.formals);
514 add(node.endToken.value); 514 add(node.endToken.value);
515 } 515 }
516 } 516 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/tree/nodes.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698