| 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 String unparse(Node node) { | 5 String unparse(Node node) { |
| 6 Unparser unparser = new Unparser(); | 6 Unparser unparser = new Unparser(); |
| 7 unparser.unparse(node); | 7 unparser.unparse(node); |
| 8 return unparser.result; | 8 return unparser.result; |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 | 436 |
| 437 visitSwitchCase(SwitchCase node) { | 437 visitSwitchCase(SwitchCase node) { |
| 438 visit(node.labelsAndCases); | 438 visit(node.labelsAndCases); |
| 439 if (node.isDefaultCase) { | 439 if (node.isDefaultCase) { |
| 440 sb.add('default:'); | 440 sb.add('default:'); |
| 441 } | 441 } |
| 442 visit(node.statements); | 442 visit(node.statements); |
| 443 } | 443 } |
| 444 | 444 |
| 445 unparseImportTag(String uri, [String prefix]) { | 445 unparseImportTag(String uri, [String prefix]) { |
| 446 final suffix = prefix === null ? '' : ',prefix:"$prefix"'; | 446 final suffix = prefix === null ? '' : ' as $prefix'; |
| 447 sb.add('#import("$uri"$suffix);'); | 447 sb.add('import "$uri"$suffix;'); |
| 448 } | 448 } |
| 449 | 449 |
| 450 visitScriptTag(ScriptTag node) { | 450 visitScriptTag(ScriptTag node) { |
| 451 add(node.beginToken.value); | 451 add(node.beginToken.value); |
| 452 visit(node.tag); | 452 visit(node.tag); |
| 453 sb.add('('); | 453 sb.add('('); |
| 454 visit(node.argument); | 454 visit(node.argument); |
| 455 if (node.prefixIdentifier !== null) { | 455 if (node.prefixIdentifier !== null) { |
| 456 visit(node.prefixIdentifier); | 456 visit(node.prefixIdentifier); |
| 457 sb.add(':'); | 457 sb.add(':'); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 add(node.getEndToken().value); | 538 add(node.getEndToken().value); |
| 539 } | 539 } |
| 540 | 540 |
| 541 visitPartOf(PartOf node) { | 541 visitPartOf(PartOf node) { |
| 542 addToken(node.partKeyword); | 542 addToken(node.partKeyword); |
| 543 addToken(node.ofKeyword); | 543 addToken(node.ofKeyword); |
| 544 visit(node.name); | 544 visit(node.name); |
| 545 add(node.getEndToken().value); | 545 add(node.getEndToken().value); |
| 546 } | 546 } |
| 547 } | 547 } |
| OLD | NEW |