| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library kernel.ast_to_text; | 4 library kernel.ast_to_text; |
| 5 | 5 |
| 6 import '../ast.dart'; | 6 import '../ast.dart'; |
| 7 import '../import_table.dart'; | 7 import '../import_table.dart'; |
| 8 import '../type_propagation/type_propagation.dart'; | 8 import '../type_propagation/type_propagation.dart'; |
| 9 | 9 |
| 10 class Namer<T> { | 10 class Namer<T> { |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 if (state == WORD) { | 386 if (state == WORD) { |
| 387 writeSpace(); | 387 writeSpace(); |
| 388 } | 388 } |
| 389 } | 389 } |
| 390 | 390 |
| 391 void writeIndentation() { | 391 void writeIndentation() { |
| 392 writeSpace(' ' * indentation); | 392 writeSpace(' ' * indentation); |
| 393 } | 393 } |
| 394 | 394 |
| 395 void writeNode(Node node) { | 395 void writeNode(Node node) { |
| 396 node.accept(this); | 396 if (node == null) { |
| 397 writeSymbol("<Null>"); |
| 398 } else { |
| 399 node.accept(this); |
| 400 } |
| 397 } | 401 } |
| 398 | 402 |
| 399 void writeOptionalNode(Node node) { | 403 void writeOptionalNode(Node node) { |
| 400 if (node != null) { | 404 if (node != null) { |
| 401 node.accept(this); | 405 node.accept(this); |
| 402 } | 406 } |
| 403 } | 407 } |
| 404 | 408 |
| 405 void writeAnnotatedType(DartType type, String annotation) { | 409 void writeAnnotatedType(DartType type, String annotation) { |
| 406 writeType(type); | 410 writeType(type); |
| (...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1538 } | 1542 } |
| 1539 throw 'illegal ProcedureKind: $kind'; | 1543 throw 'illegal ProcedureKind: $kind'; |
| 1540 } | 1544 } |
| 1541 | 1545 |
| 1542 class ExpressionPrinter { | 1546 class ExpressionPrinter { |
| 1543 final Printer writeer; | 1547 final Printer writeer; |
| 1544 final int minimumPrecedence; | 1548 final int minimumPrecedence; |
| 1545 | 1549 |
| 1546 ExpressionPrinter(this.writeer, this.minimumPrecedence); | 1550 ExpressionPrinter(this.writeer, this.minimumPrecedence); |
| 1547 } | 1551 } |
| OLD | NEW |