| OLD | NEW |
| 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 String unparse(Node node) { | 8 String unparse(Node node) { |
| 9 Unparser unparser = new Unparser(); | 9 Unparser unparser = new Unparser(); |
| 10 unparser.unparse(node); | 10 unparser.unparse(node); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 sb.add(')'); | 117 sb.add(')'); |
| 118 visit(node.body); | 118 visit(node.body); |
| 119 } | 119 } |
| 120 | 120 |
| 121 visitFunctionDeclaration(FunctionDeclaration node) { | 121 visitFunctionDeclaration(FunctionDeclaration node) { |
| 122 visit(node.function); | 122 visit(node.function); |
| 123 } | 123 } |
| 124 | 124 |
| 125 visitFunctionExpression(FunctionExpression node) { | 125 visitFunctionExpression(FunctionExpression node) { |
| 126 // Check length to not print unnecessary whitespace. | 126 // Check length to not print unnecessary whitespace. |
| 127 if (node.modifiers !== null && node.modifiers.nodes.length() > 0) { | 127 if (node.modifiers.nodes.length() > 0) { |
| 128 visit(node.modifiers); | 128 visit(node.modifiers); |
| 129 sb.add(' '); | 129 sb.add(' '); |
| 130 } | 130 } |
| 131 if (node.returnType !== null) { | 131 if (node.returnType !== null) { |
| 132 visit(node.returnType); | 132 visit(node.returnType); |
| 133 sb.add(' '); | 133 sb.add(' '); |
| 134 } | 134 } |
| 135 if (node.getOrSet !== null) { | 135 if (node.getOrSet !== null) { |
| 136 add(node.getOrSet.value); | 136 add(node.getOrSet.value); |
| 137 sb.add(' '); | 137 sb.add(' '); |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 sb.add(' '); | 509 sb.add(' '); |
| 510 } | 510 } |
| 511 visit(node.name); | 511 visit(node.name); |
| 512 if (node.typeParameters !== null) { | 512 if (node.typeParameters !== null) { |
| 513 visit(node.typeParameters); | 513 visit(node.typeParameters); |
| 514 } | 514 } |
| 515 visit(node.formals); | 515 visit(node.formals); |
| 516 add(node.endToken.value); | 516 add(node.endToken.value); |
| 517 } | 517 } |
| 518 } | 518 } |
| OLD | NEW |