| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |