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

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

Issue 282453004: Dart2js enum parsing. Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Allow trailing comma. Created 6 years, 7 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 | « sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart ('k') | no next file » | 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 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 sb.write(' '); 66 sb.write(' ');
67 visit(node.interfaces); 67 visit(node.interfaces);
68 } 68 }
69 sb.write('{'); 69 sb.write('{');
70 for (final member in members) { 70 for (final member in members) {
71 visit(member); 71 visit(member);
72 } 72 }
73 sb.write('}'); 73 sb.write('}');
74 } 74 }
75 75
76 visitEnum(Enum node) {
77 sb.write('enum ');
78 visit(node.name);
79 sb.write(' ');
floitsch 2014/11/04 14:06:51 why don't you need to write the "{" and "}"?
Lasse Reichstein Nielsen 2014/11/06 13:24:51 The NodeList knows about delimiters, '{', '}' and
80 visit(node.names);
81 }
82
76 visitClassNode(ClassNode node) { 83 visitClassNode(ClassNode node) {
77 unparseClassWithBody(node, node.body.nodes); 84 unparseClassWithBody(node, node.body.nodes);
78 } 85 }
79 86
80 visitMixinApplication(MixinApplication node) { 87 visitMixinApplication(MixinApplication node) {
81 visit(node.superclass); 88 visit(node.superclass);
82 sb.write(' with '); 89 sb.write(' with ');
83 visit(node.mixins); 90 visit(node.mixins);
84 } 91 }
85 92
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 } 631 }
625 632
626 visitStatement(Statement node) { 633 visitStatement(Statement node) {
627 throw 'internal error'; // Should not be called. 634 throw 'internal error'; // Should not be called.
628 } 635 }
629 636
630 visitStringNode(StringNode node) { 637 visitStringNode(StringNode node) {
631 throw 'internal error'; // Should not be called. 638 throw 'internal error'; // Should not be called.
632 } 639 }
633 } 640 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698