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

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

Issue 9502002: Add FunctionDeclaration node. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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) 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 Unparser implements Visitor { 5 class Unparser implements Visitor {
6 StringBuffer sb; 6 StringBuffer sb;
7 final bool printDebugInfo; 7 final bool printDebugInfo;
8 8
9 Unparser([this.printDebugInfo = false]); 9 Unparser([this.printDebugInfo = false]);
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 visitFor(For node) { 68 visitFor(For node) {
69 add(node.forToken.value); 69 add(node.forToken.value);
70 sb.add('('); 70 sb.add('(');
71 visit(node.initializer); 71 visit(node.initializer);
72 visit(node.conditionStatement); 72 visit(node.conditionStatement);
73 visit(node.update); 73 visit(node.update);
74 sb.add(')'); 74 sb.add(')');
75 visit(node.body); 75 visit(node.body);
76 } 76 }
77 77
78 visitFunctionDeclaration(FunctionDeclaration node) {
79 visit(node.function);
80 }
81
78 visitFunctionExpression(FunctionExpression node) { 82 visitFunctionExpression(FunctionExpression node) {
79 if (node.returnType !== null) { 83 if (node.returnType !== null) {
80 visit(node.returnType); 84 visit(node.returnType);
81 sb.add(' '); 85 sb.add(' ');
82 } 86 }
83 visit(node.name); 87 visit(node.name);
84 visit(node.parameters); 88 visit(node.parameters);
85 visit(node.body); 89 visit(node.body);
86 } 90 }
87 91
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 sb.add(' '); 360 sb.add(' ');
357 } 361 }
358 visit(node.name); 362 visit(node.name);
359 if (node.typeParameters !== null) { 363 if (node.typeParameters !== null) {
360 visit(node.typeParameters); 364 visit(node.typeParameters);
361 } 365 }
362 visit(node.formals); 366 visit(node.formals);
363 add(node.endToken.value); 367 add(node.endToken.value);
364 } 368 }
365 } 369 }
OLDNEW
« no previous file with comments | « frog/leg/tree/nodes.dart ('k') | frog/leg/tree/visitors.dart » ('j') | frog/leg/typechecker.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698