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

Side by Side Diff: dart/frog/leg/tree/unparser.dart

Issue 8497011: Parse formal parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased, frogsh, type warning Created 9 years, 1 month 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 | « dart/frog/leg/tree/nodes.dart ('k') | dart/frog/leg/typechecker.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class DebugUnparser implements Visitor { 5 class DebugUnparser implements Visitor {
6 String separator; 6 String separator;
7 StringBuffer sb; 7 StringBuffer sb;
8 8
9 String unparse(Node node) { 9 String unparse(Node node) {
10 separator = ''; 10 separator = '';
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 visit(element); 82 visit(element);
83 } 83 }
84 } 84 }
85 if (node.endToken !== null) sb.add(node.endToken); 85 if (node.endToken !== null) sb.add(node.endToken);
86 } 86 }
87 87
88 visitOperator(Operator node) { 88 visitOperator(Operator node) {
89 visitIdentifier(node); 89 visitIdentifier(node);
90 } 90 }
91 91
92 visitParameter(Parameter node) {
93 if (node.typeAnnotation !== null) {
94 visit(node.typeAnnotation);
95 sb.add(' ');
96 }
97 visit(node.name);
98 }
99
100 visitReturn(Return node) { 92 visitReturn(Return node) {
101 node.beginToken.value.printOn(sb); 93 node.beginToken.value.printOn(sb);
102 if (node.hasExpression) { 94 if (node.hasExpression) {
103 sb.add(' '); 95 sb.add(' ');
104 visit(node.expression); 96 visit(node.expression);
105 } 97 }
106 node.endToken.value.printOn(sb); 98 node.endToken.value.printOn(sb);
107 } 99 }
108 100
109 visitSend(Send node) { 101 visitSend(Send node) {
(...skipping 22 matching lines...) Expand all
132 visitVariableDefinitions(VariableDefinitions node) { 124 visitVariableDefinitions(VariableDefinitions node) {
133 if (node.type !== null) { 125 if (node.type !== null) {
134 visit(node.type); 126 visit(node.type);
135 sb.add(' '); 127 sb.add(' ');
136 } 128 }
137 // TODO(karlklose): print modifiers. 129 // TODO(karlklose): print modifiers.
138 visit(node.definitions, ', '); 130 visit(node.definitions, ', ');
139 sb.add('; '); 131 sb.add('; ');
140 } 132 }
141 } 133 }
OLDNEW
« no previous file with comments | « dart/frog/leg/tree/nodes.dart ('k') | dart/frog/leg/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698