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

Side by Side Diff: pkg/compiler/lib/src/tree/prettyprint.dart

Issue 2710973002: Revert "Add support for the new function-type syntax." (Closed)
Patch Set: Created 3 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
« no previous file with comments | « pkg/compiler/lib/src/tree/nodes.dart ('k') | pkg/compiler/lib/src/tree/unparser.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) 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 import 'package:front_end/src/fasta/scanner.dart' show Token; 5 import 'package:front_end/src/fasta/scanner.dart' show Token;
6 import '../util/util.dart'; 6 import '../util/util.dart';
7 import 'nodes.dart'; 7 import 'nodes.dart';
8 8
9 /** 9 /**
10 * Pretty-prints Node tree in XML-like format. 10 * Pretty-prints Node tree in XML-like format.
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 {"getOrSet": tokenToStringOrNull(node.getOrSet)}); 146 {"getOrSet": tokenToStringOrNull(node.getOrSet)});
147 visitChildNode(node.modifiers, "modifiers"); 147 visitChildNode(node.modifiers, "modifiers");
148 visitChildNode(node.returnType, "returnType"); 148 visitChildNode(node.returnType, "returnType");
149 visitChildNode(node.name, "name"); 149 visitChildNode(node.name, "name");
150 visitChildNode(node.parameters, "parameters"); 150 visitChildNode(node.parameters, "parameters");
151 visitChildNode(node.initializers, "initializers"); 151 visitChildNode(node.initializers, "initializers");
152 visitChildNode(node.body, "body"); 152 visitChildNode(node.body, "body");
153 closeNode(); 153 closeNode();
154 } 154 }
155 155
156 visitFunctionTypeAnnotation(FunctionTypeAnnotation node) {
157 openNode(node, "FunctionTypeAnnotation");
158 visitChildNode(node.returnType, "returnType");
159 visitChildNode(node.typeParameters, "typeParameters");
160 visitChildNode(node.formals, "formals");
161 closeNode();
162 }
163
164 visitIdentifier(Identifier node) { 156 visitIdentifier(Identifier node) {
165 openAndCloseNode(node, "Identifier", {"token": node.token}); 157 openAndCloseNode(node, "Identifier", {"token": node.token});
166 } 158 }
167 159
168 visitIf(If node) { 160 visitIf(If node) {
169 visitNodeWithChildren(node, "If"); 161 visitNodeWithChildren(node, "If");
170 } 162 }
171 163
172 visitLabel(Label node) { 164 visitLabel(Label node) {
173 visitNodeWithChildren(node, "Label"); 165 visitNodeWithChildren(node, "Label");
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 var params = {"delimiter": node.delimiter}; 237 var params = {"delimiter": node.delimiter};
246 if (node.isEmpty) { 238 if (node.isEmpty) {
247 openAndCloseNode(node, "NodeList", params); 239 openAndCloseNode(node, "NodeList", params);
248 } else { 240 } else {
249 openNode(node, "NodeList", params); 241 openNode(node, "NodeList", params);
250 node.visitChildren(this); 242 node.visitChildren(this);
251 closeNode(); 243 closeNode();
252 } 244 }
253 } 245 }
254 246
255 visitNominalTypeAnnotation(NominalTypeAnnotation node) {
256 openNode(node, "NominalTypeAnnotation");
257 visitChildNode(node.typeName, "typeName");
258 visitChildNode(node.typeArguments, "typeArguments");
259 closeNode();
260 }
261
262 visitOperator(Operator node) { 247 visitOperator(Operator node) {
263 openAndCloseNode(node, "Operator", {"value": node.token}); 248 openAndCloseNode(node, "Operator", {"value": node.token});
264 } 249 }
265 250
266 visitParenthesizedExpression(ParenthesizedExpression node) { 251 visitParenthesizedExpression(ParenthesizedExpression node) {
267 visitNodeWithChildren(node, "ParenthesizedExpression"); 252 visitNodeWithChildren(node, "ParenthesizedExpression");
268 } 253 }
269 254
270 visitRedirectingFactoryBody(RedirectingFactoryBody node) { 255 visitRedirectingFactoryBody(RedirectingFactoryBody node) {
271 openNode(node, "RedirectingFactoryBody"); 256 openNode(node, "RedirectingFactoryBody");
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } 338 }
354 339
355 visitAwait(Await node) { 340 visitAwait(Await node) {
356 visitNodeWithChildren(node, "Await"); 341 visitNodeWithChildren(node, "Await");
357 } 342 }
358 343
359 visitTryStatement(TryStatement node) { 344 visitTryStatement(TryStatement node) {
360 visitNodeWithChildren(node, "TryStatement"); 345 visitNodeWithChildren(node, "TryStatement");
361 } 346 }
362 347
348 visitTypeAnnotation(TypeAnnotation node) {
349 openNode(node, "TypeAnnotation");
350 visitChildNode(node.typeName, "typeName");
351 visitChildNode(node.typeArguments, "typeArguments");
352 closeNode();
353 }
354
363 visitTypedef(Typedef node) { 355 visitTypedef(Typedef node) {
364 visitNodeWithChildren(node, "Typedef"); 356 visitNodeWithChildren(node, "Typedef");
365 } 357 }
366 358
367 visitTypeVariable(TypeVariable node) { 359 visitTypeVariable(TypeVariable node) {
368 openNode(node, "TypeVariable"); 360 openNode(node, "TypeVariable");
369 visitChildNode(node.name, "name"); 361 visitChildNode(node.name, "name");
370 visitChildNode(node.bound, "bound"); 362 visitChildNode(node.bound, "bound");
371 closeNode(); 363 closeNode();
372 } 364 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 } 465 }
474 466
475 visitExpression(Expression node) { 467 visitExpression(Expression node) {
476 unimplemented('visitNode', node: node); 468 unimplemented('visitNode', node: node);
477 } 469 }
478 470
479 visitGotoStatement(GotoStatement node) { 471 visitGotoStatement(GotoStatement node) {
480 unimplemented('visitNode', node: node); 472 unimplemented('visitNode', node: node);
481 } 473 }
482 474
483 visitTypeAnnotation(TypeAnnotation node) {
484 unimplemented('visitNode', node: node);
485 }
486
487 unimplemented(String message, {Node node}) { 475 unimplemented(String message, {Node node}) {
488 throw message; 476 throw message;
489 } 477 }
490 } 478 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree/nodes.dart ('k') | pkg/compiler/lib/src/tree/unparser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698