| OLD | NEW |
| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 visitOperator(Operator node) { | 145 visitOperator(Operator node) { |
| 146 visitIdentifier(node); | 146 visitIdentifier(node); |
| 147 } | 147 } |
| 148 | 148 |
| 149 visitReturn(Return node) { | 149 visitReturn(Return node) { |
| 150 add(node.beginToken.value); | 150 add(node.beginToken.value); |
| 151 if (node.hasExpression) { | 151 if (node.hasExpression) { |
| 152 sb.add(' '); | 152 sb.add(' '); |
| 153 visit(node.expression); | 153 visit(node.expression); |
| 154 } | 154 } |
| 155 add(node.endToken.value); | 155 if (node.endToken !== null) add(node.endToken.value); |
| 156 } | 156 } |
| 157 | 157 |
| 158 | 158 |
| 159 unparseSendPart(Send node) { | 159 unparseSendPart(Send node) { |
| 160 if (node.isPrefix) { | 160 if (node.isPrefix) { |
| 161 visit(node.selector); | 161 visit(node.selector); |
| 162 } | 162 } |
| 163 if (node.receiver !== null) { | 163 if (node.receiver !== null) { |
| 164 visit(node.receiver); | 164 visit(node.receiver); |
| 165 if (node.selector is !Operator) sb.add('.'); | 165 if (node.selector is !Operator) sb.add('.'); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 sb.add(' '); | 352 sb.add(' '); |
| 353 } | 353 } |
| 354 visit(node.name); | 354 visit(node.name); |
| 355 if (node.typeParameters !== null) { | 355 if (node.typeParameters !== null) { |
| 356 visit(node.typeParameters); | 356 visit(node.typeParameters); |
| 357 } | 357 } |
| 358 visit(node.formals); | 358 visit(node.formals); |
| 359 add(node.endToken.value); | 359 add(node.endToken.value); |
| 360 } | 360 } |
| 361 } | 361 } |
| OLD | NEW |