| 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 class Unparser implements Visitor { | 5 class Unparser implements Visitor { |
| 6 final Renamer renamer; | 6 final Renamer renamer; |
| 7 StringBuffer sb; | 7 StringBuffer sb; |
| 8 | 8 |
| 9 Unparser([this.renamer = const Renamer()]); | 9 Unparser([this.renamer = const Renamer()]); |
| 10 | 10 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 116 } |
| 117 if (node.name is Send) { | 117 if (node.name is Send) { |
| 118 Send send = node.name; | 118 Send send = node.name; |
| 119 assert(send is !SendSet); | 119 assert(send is !SendSet); |
| 120 if (!send.isOperator) { | 120 if (!send.isOperator) { |
| 121 // Looks like a factory method. | 121 // Looks like a factory method. |
| 122 emitName(send.receiver); | 122 emitName(send.receiver); |
| 123 sb.add('.'); | 123 sb.add('.'); |
| 124 } else { | 124 } else { |
| 125 visit(send.receiver); | 125 visit(send.receiver); |
| 126 if (send.selector.token.kind === KEYWORD_TOKEN) sb.add(' '); |
| 126 } | 127 } |
| 127 visit(send.selector); | 128 visit(send.selector); |
| 128 } else { | 129 } else { |
| 129 if (node.name !== null) emitName(node.name); | 130 if (node.name !== null) emitName(node.name); |
| 130 } | 131 } |
| 131 visit(node.parameters); | 132 visit(node.parameters); |
| 132 visit(node.initializers); | 133 visit(node.initializers); |
| 133 visit(node.body); | 134 visit(node.body); |
| 134 } | 135 } |
| 135 | 136 |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 sb.add(' '); | 510 sb.add(' '); |
| 510 } | 511 } |
| 511 visit(node.name); | 512 visit(node.name); |
| 512 if (node.typeParameters !== null) { | 513 if (node.typeParameters !== null) { |
| 513 visit(node.typeParameters); | 514 visit(node.typeParameters); |
| 514 } | 515 } |
| 515 visit(node.formals); | 516 visit(node.formals); |
| 516 add(node.endToken.value); | 517 add(node.endToken.value); |
| 517 } | 518 } |
| 518 } | 519 } |
| OLD | NEW |