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

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

Issue 10880026: Record literal list type arguments and report errors when there are too many. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated dart2dart status Created 8 years, 3 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 | « dart/lib/compiler/implementation/tree/nodes.dart ('k') | dart/tests/language/language.status » ('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) 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 class Unparser implements Visitor { 8 class Unparser implements Visitor {
9 Renamer rename; 9 Renamer rename;
10 StringBuffer sb; 10 StringBuffer sb;
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 add(node.token.value); 199 add(node.token.value);
200 } 200 }
201 201
202 visitNewExpression(NewExpression node) { 202 visitNewExpression(NewExpression node) {
203 addToken(node.newToken); 203 addToken(node.newToken);
204 visit(node.send); 204 visit(node.send);
205 } 205 }
206 206
207 visitLiteralList(LiteralList node) { 207 visitLiteralList(LiteralList node) {
208 addToken(node.constKeyword); 208 addToken(node.constKeyword);
209 if (node.type !== null) { 209 visit(node.typeArguments);
210 sb.add('<');
211 visit(node.type);
212 sb.add('>');
213 }
214 visit(node.elements); 210 visit(node.elements);
215 } 211 }
216 212
217 visitModifiers(Modifiers node) => node.visitChildren(this); 213 visitModifiers(Modifiers node) => node.visitChildren(this);
218 214
219 /** 215 /**
220 * Unparses given NodeList starting from specific node. 216 * Unparses given NodeList starting from specific node.
221 */ 217 */
222 unparseNodeListFrom(NodeList node, Link<Node> from) { 218 unparseNodeListFrom(NodeList node, Link<Node> from) {
223 if (from.isEmpty()) return; 219 if (from.isEmpty()) return;
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 sb.add(' '); 496 sb.add(' ');
501 } 497 }
502 visit(node.name); 498 visit(node.name);
503 if (node.typeParameters !== null) { 499 if (node.typeParameters !== null) {
504 visit(node.typeParameters); 500 visit(node.typeParameters);
505 } 501 }
506 visit(node.formals); 502 visit(node.formals);
507 add(node.endToken.value); 503 add(node.endToken.value);
508 } 504 }
509 } 505 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/tree/nodes.dart ('k') | dart/tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698