| 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 part of tree; | 5 part of tree; |
| 6 | 6 |
| 7 String unparse(Node node) { | 7 String unparse(Node node) { |
| 8 Unparser unparser = new Unparser(); | 8 Unparser unparser = new Unparser(); |
| 9 unparser.unparse(node); | 9 unparser.unparse(node); |
| 10 return unparser.result; | 10 return unparser.result; |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 sb.write('default:'); | 470 sb.write('default:'); |
| 471 } | 471 } |
| 472 visit(node.statements); | 472 visit(node.statements); |
| 473 } | 473 } |
| 474 | 474 |
| 475 unparseImportTag(String uri, [String prefix]) { | 475 unparseImportTag(String uri, [String prefix]) { |
| 476 final suffix = prefix == null ? '' : ' as $prefix'; | 476 final suffix = prefix == null ? '' : ' as $prefix'; |
| 477 sb.write('import "$uri"$suffix;'); | 477 sb.write('import "$uri"$suffix;'); |
| 478 } | 478 } |
| 479 | 479 |
| 480 visitScriptTag(ScriptTag node) { | |
| 481 add(node.beginToken.value); | |
| 482 visit(node.tag); | |
| 483 sb.write('('); | |
| 484 visit(node.argument); | |
| 485 if (node.prefixIdentifier != null) { | |
| 486 visit(node.prefixIdentifier); | |
| 487 sb.write(':'); | |
| 488 visit(node.prefix); | |
| 489 } | |
| 490 sb.write(')'); | |
| 491 add(node.endToken.value); | |
| 492 } | |
| 493 | |
| 494 visitTryStatement(TryStatement node) { | 480 visitTryStatement(TryStatement node) { |
| 495 addToken(node.tryKeyword); | 481 addToken(node.tryKeyword); |
| 496 visit(node.tryBlock); | 482 visit(node.tryBlock); |
| 497 visit(node.catchBlocks); | 483 visit(node.catchBlocks); |
| 498 if (node.finallyKeyword != null) { | 484 if (node.finallyKeyword != null) { |
| 499 addToken(node.finallyKeyword); | 485 addToken(node.finallyKeyword); |
| 500 visit(node.finallyBlock); | 486 visit(node.finallyBlock); |
| 501 } | 487 } |
| 502 } | 488 } |
| 503 | 489 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 } | 601 } |
| 616 | 602 |
| 617 visitStatement(Statement node) { | 603 visitStatement(Statement node) { |
| 618 throw 'internal error'; // Should not be called. | 604 throw 'internal error'; // Should not be called. |
| 619 } | 605 } |
| 620 | 606 |
| 621 visitStringNode(StringNode node) { | 607 visitStringNode(StringNode node) { |
| 622 throw 'internal error'; // Should not be called. | 608 throw 'internal error'; // Should not be called. |
| 623 } | 609 } |
| 624 } | 610 } |
| OLD | NEW |