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

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

Issue 11033003: Unparse new library syntax. (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 // 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 String unparse(Node node) { 8 String unparse(Node node) {
9 Unparser unparser = new Unparser(); 9 Unparser unparser = new Unparser();
10 unparser.unparse(node); 10 unparser.unparse(node);
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 visit(node.returnType); 508 visit(node.returnType);
509 sb.add(' '); 509 sb.add(' ');
510 } 510 }
511 visit(node.name); 511 visit(node.name);
512 if (node.typeParameters !== null) { 512 if (node.typeParameters !== null) {
513 visit(node.typeParameters); 513 visit(node.typeParameters);
514 } 514 }
515 visit(node.formals); 515 visit(node.formals);
516 add(node.endToken.value); 516 add(node.endToken.value);
517 } 517 }
518
519 visitLibraryName(LibraryName node) {
520 addToken(node.libraryKeyword);
521 node.visitChildren(this);
522 add(node.getEndToken().value);
523 }
524
525 visitImport(Import node) {
526 addToken(node.importKeyword);
527 visit(node.uri);
528 if (node.prefix != null) {
529 sb.add(' ');
530 addToken(node.asKeyword);
531 visit(node.prefix);
532 }
533 if (node.combinators != null) {
534 visit(node.combinators);
535 }
536 add(node.getEndToken().value);
537 }
538
539 visitExport(Export node) {
540 addToken(node.exportKeyword);
541 visit(node.uri);
542 if (node.combinators != null) {
543 visit(node.combinators);
544 }
545 add(node.getEndToken().value);
546 }
547
548 visitPart(Part node) {
549 addToken(node.partKeyword);
550 visit(node.uri);
551 add(node.getEndToken().value);
552 }
553
554 visitPartOf(PartOf node) {
555 addToken(node.partKeyword);
556 addToken(node.ofKeyword);
557 visit(node.name);
558 add(node.getEndToken().value);
559 }
518 } 560 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/tree/nodes.dart ('k') | dart/tests/compiler/dart2js/parser_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698