| 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 | 4 |
| 5 /// Helper for debug Kernel nodes. | 5 /// Helper for debug Kernel nodes. |
| 6 | 6 |
| 7 library kernel.debug; | 7 library kernel.debug; |
| 8 | 8 |
| 9 import 'package:kernel/kernel.dart'; | 9 import 'package:kernel/kernel.dart'; |
| 10 import 'package:kernel/visitor.dart'; | 10 import 'package:kernel/visitor.dart'; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 void visitVariableDeclaration(VariableDeclaration node) { | 46 void visitVariableDeclaration(VariableDeclaration node) { |
| 47 openNode(node, '${node.runtimeType}', { | 47 openNode(node, '${node.runtimeType}', { |
| 48 'name': '${node.name}', | 48 'name': '${node.name}', |
| 49 'isFinal': '${node.isFinal}', | 49 'isFinal': '${node.isFinal}', |
| 50 'isConst': '${node.isConst}' | 50 'isConst': '${node.isConst}' |
| 51 }); | 51 }); |
| 52 node.visitChildren(this); | 52 node.visitChildren(this); |
| 53 closeNode(); | 53 closeNode(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 @override |
| 57 void visitInterfaceType(InterfaceType node) { |
| 58 openNode(node, '${node.runtimeType}', { |
| 59 'name': '${node.classNode.name}', |
| 60 }); |
| 61 node.visitChildren(this); |
| 62 closeNode(); |
| 63 } |
| 64 |
| 56 /// Pretty-prints given node tree into string. | 65 /// Pretty-prints given node tree into string. |
| 57 static String prettyPrint(Node node) { | 66 static String prettyPrint(Node node) { |
| 58 var p = new DebugPrinter(); | 67 var p = new DebugPrinter(); |
| 59 node.accept(p); | 68 node.accept(p); |
| 60 return p.sb.toString(); | 69 return p.sb.toString(); |
| 61 } | 70 } |
| 62 } | 71 } |
| OLD | NEW |