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

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

Issue 11044010: Support new import syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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/compiler/dart2js/dart_backend_test.dart » ('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 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/dart_backend_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698