Chromium Code Reviews| 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 part of tree; | 5 part of tree; |
| 6 | 6 |
| 7 String unparse(Node node) { | 7 String unparse(Node node) { |
| 8 Unparser unparser = new Unparser(); | 8 Unparser unparser = new Unparser(); |
| 9 unparser.unparse(node); | 9 unparser.unparse(node); |
| 10 return unparser.result; | 10 return unparser.result; |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 355 visitVariableDefinitions(VariableDefinitions node) { | 355 visitVariableDefinitions(VariableDefinitions node) { |
| 356 visit(node.modifiers); | 356 visit(node.modifiers); |
| 357 if (!node.modifiers.nodes.isEmpty) { | 357 if (!node.modifiers.nodes.isEmpty) { |
| 358 sb.add(' '); | 358 sb.add(' '); |
| 359 } | 359 } |
| 360 if (node.type != null) { | 360 if (node.type != null) { |
| 361 visit(node.type); | 361 visit(node.type); |
| 362 sb.add(' '); | 362 sb.add(' '); |
| 363 } | 363 } |
| 364 visit(node.definitions); | 364 visit(node.definitions); |
| 365 if (node.endToken.value == const SourceString(';')) { | 365 |
| 366 if (node.endToken != null && | |
| 367 node.endToken.value == const SourceString(';')) { | |
|
ahe
2013/01/23 11:26:36
I think you only need to test for "node.endToken !
Johnni Winther
2013/01/28 12:23:24
We can remove endToken completely since node.defin
| |
| 366 add(node.endToken.value); | 368 add(node.endToken.value); |
| 367 } | 369 } |
| 368 } | 370 } |
| 369 | 371 |
| 370 visitDoWhile(DoWhile node) { | 372 visitDoWhile(DoWhile node) { |
| 371 add(node.doKeyword.value); | 373 add(node.doKeyword.value); |
| 372 if (node.body is !Block) sb.add(' '); | 374 if (node.body is !Block) sb.add(' '); |
| 373 visit(node.body); | 375 visit(node.body); |
| 374 add(node.whileKeyword.value); | 376 add(node.whileKeyword.value); |
| 375 visit(node.condition); | 377 visit(node.condition); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 617 } | 619 } |
| 618 | 620 |
| 619 visitStatement(Statement node) { | 621 visitStatement(Statement node) { |
| 620 throw 'internal error'; // Should not be called. | 622 throw 'internal error'; // Should not be called. |
| 621 } | 623 } |
| 622 | 624 |
| 623 visitStringNode(StringNode node) { | 625 visitStringNode(StringNode node) { |
| 624 throw 'internal error'; // Should not be called. | 626 throw 'internal error'; // Should not be called. |
| 625 } | 627 } |
| 626 } | 628 } |
| OLD | NEW |