| 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 19 matching lines...) Expand all Loading... |
| 30 ++i; | 30 ++i; |
| 31 } | 31 } |
| 32 return '$proposedName$i'; | 32 return '$proposedName$i'; |
| 33 }); | 33 }); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 NameSystem globalDebuggingNames = new NameSystem(); | 37 NameSystem globalDebuggingNames = new NameSystem(); |
| 38 | 38 |
| 39 String debugLibraryName(Library node) { | 39 String debugLibraryName(Library node) { |
| 40 return node.name ?? globalDebuggingNames.nameLibrary(node); | 40 return node == null |
| 41 ? 'null' |
| 42 : node.name ?? globalDebuggingNames.nameLibrary(node); |
| 41 } | 43 } |
| 42 | 44 |
| 43 String debugClassName(Class node) { | 45 String debugClassName(Class node) { |
| 44 return node.name ?? globalDebuggingNames.nameClass(node); | 46 return node == null |
| 47 ? 'null' |
| 48 : node.name ?? globalDebuggingNames.nameClass(node); |
| 45 } | 49 } |
| 46 | 50 |
| 47 String debugQualifiedClassName(Class node) { | 51 String debugQualifiedClassName(Class node) { |
| 48 return debugLibraryName(node.enclosingLibrary) + '::' + debugClassName(node); | 52 return debugLibraryName(node.enclosingLibrary) + '::' + debugClassName(node); |
| 49 } | 53 } |
| 50 | 54 |
| 51 String debugMemberName(Member node) { | 55 String debugMemberName(Member node) { |
| 52 return node.name?.name ?? globalDebuggingNames.nameMember(node); | 56 return node.name?.name ?? globalDebuggingNames.nameMember(node); |
| 53 } | 57 } |
| 54 | 58 |
| (...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1587 } | 1591 } |
| 1588 throw 'illegal ProcedureKind: $kind'; | 1592 throw 'illegal ProcedureKind: $kind'; |
| 1589 } | 1593 } |
| 1590 | 1594 |
| 1591 class ExpressionPrinter { | 1595 class ExpressionPrinter { |
| 1592 final Printer writeer; | 1596 final Printer writeer; |
| 1593 final int minimumPrecedence; | 1597 final int minimumPrecedence; |
| 1594 | 1598 |
| 1595 ExpressionPrinter(this.writeer, this.minimumPrecedence); | 1599 ExpressionPrinter(this.writeer, this.minimumPrecedence); |
| 1596 } | 1600 } |
| OLD | NEW |