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

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

Issue 155703004: Support parameter metadata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 352
353 visitTypeVariable(TypeVariable node) { 353 visitTypeVariable(TypeVariable node) {
354 visit(node.name); 354 visit(node.name);
355 if (node.bound != null) { 355 if (node.bound != null) {
356 sb.write(' extends '); 356 sb.write(' extends ');
357 visit(node.bound); 357 visit(node.bound);
358 } 358 }
359 } 359 }
360 360
361 visitVariableDefinitions(VariableDefinitions node) { 361 visitVariableDefinitions(VariableDefinitions node) {
362 if (node.metadata != null) {
363 visit(node.metadata);
364 sb.write(' ');
365 }
362 visit(node.modifiers); 366 visit(node.modifiers);
363 if (!node.modifiers.nodes.isEmpty) { 367 if (!node.modifiers.nodes.isEmpty) {
364 sb.write(' '); 368 sb.write(' ');
365 } 369 }
366 if (node.type != null) { 370 if (node.type != null) {
367 visit(node.type); 371 visit(node.type);
368 sb.write(' '); 372 sb.write(' ');
369 } 373 }
370 visit(node.definitions); 374 visit(node.definitions);
371 } 375 }
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 addToken(node.ofKeyword); 570 addToken(node.ofKeyword);
567 visit(node.name); 571 visit(node.name);
568 add(node.getEndToken().value); 572 add(node.getEndToken().value);
569 } 573 }
570 574
571 visitCombinator(Combinator node) { 575 visitCombinator(Combinator node) {
572 addToken(node.keywordToken); 576 addToken(node.keywordToken);
573 visit(node.identifiers); 577 visit(node.identifiers);
574 } 578 }
575 579
580 visitMetadata(Metadata node) {
581 addToken(node.token);
582 visit(node.expression);
583 }
584
576 visitNode(Node node) { 585 visitNode(Node node) {
577 throw 'internal error'; // Should not be called. 586 throw 'internal error'; // Should not be called.
578 } 587 }
579 588
580 visitExpression(Expression node) { 589 visitExpression(Expression node) {
581 throw 'internal error'; // Should not be called. 590 throw 'internal error'; // Should not be called.
582 } 591 }
583 592
584 visitLibraryTag(LibraryTag node) { 593 visitLibraryTag(LibraryTag node) {
585 throw 'internal error'; // Should not be called. 594 throw 'internal error'; // Should not be called.
(...skipping 20 matching lines...) Expand all
606 } 615 }
607 616
608 visitStatement(Statement node) { 617 visitStatement(Statement node) {
609 throw 'internal error'; // Should not be called. 618 throw 'internal error'; // Should not be called.
610 } 619 }
611 620
612 visitStringNode(StringNode node) { 621 visitStringNode(StringNode node) {
613 throw 'internal error'; // Should not be called. 622 throw 'internal error'; // Should not be called.
614 } 623 }
615 } 624 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698