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

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

Issue 11027023: Parse/unparse library combinators. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
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
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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 511
512 visitImport(Import node) { 512 visitImport(Import node) {
513 addToken(node.importKeyword); 513 addToken(node.importKeyword);
514 visit(node.uri); 514 visit(node.uri);
515 if (node.prefix != null) { 515 if (node.prefix != null) {
516 sb.add(' '); 516 sb.add(' ');
517 addToken(node.asKeyword); 517 addToken(node.asKeyword);
518 visit(node.prefix); 518 visit(node.prefix);
519 } 519 }
520 if (node.combinators != null) { 520 if (node.combinators != null) {
521 sb.add(' ');
521 visit(node.combinators); 522 visit(node.combinators);
522 } 523 }
523 add(node.getEndToken().value); 524 add(node.getEndToken().value);
524 } 525 }
525 526
526 visitExport(Export node) { 527 visitExport(Export node) {
527 addToken(node.exportKeyword); 528 addToken(node.exportKeyword);
528 visit(node.uri); 529 visit(node.uri);
529 if (node.combinators != null) { 530 if (node.combinators != null) {
531 sb.add(' ');
530 visit(node.combinators); 532 visit(node.combinators);
531 } 533 }
532 add(node.getEndToken().value); 534 add(node.getEndToken().value);
533 } 535 }
534 536
535 visitPart(Part node) { 537 visitPart(Part node) {
536 addToken(node.partKeyword); 538 addToken(node.partKeyword);
537 visit(node.uri); 539 visit(node.uri);
538 add(node.getEndToken().value); 540 add(node.getEndToken().value);
539 } 541 }
540 542
541 visitPartOf(PartOf node) { 543 visitPartOf(PartOf node) {
542 addToken(node.partKeyword); 544 addToken(node.partKeyword);
543 addToken(node.ofKeyword); 545 addToken(node.ofKeyword);
544 visit(node.name); 546 visit(node.name);
545 add(node.getEndToken().value); 547 add(node.getEndToken().value);
546 } 548 }
549
550 visitCombinator(Combinator node) {
551 addToken(node.keywordToken);
552 visit(node.identifiers);
553 }
547 } 554 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/tree/nodes.dart ('k') | dart/tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698