Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: pkg/compiler/lib/src/kernel/kernel_debug.dart

Issue 2485093003: dart2js: depend directly on kernel/ast to avoid indirect dependency on dart:io (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ast.dart';
10 import 'package:kernel/visitor.dart'; 10 import 'package:kernel/visitor.dart';
11 11
12 import '../util/util.dart' show Indentation, Tagging; 12 import '../util/util.dart' show Indentation, Tagging;
13 13
14 class DebugPrinter extends Visitor with Indentation, Tagging<Node> { 14 class DebugPrinter extends Visitor with Indentation, Tagging<Node> {
15 StringBuffer sb = new StringBuffer(); 15 StringBuffer sb = new StringBuffer();
16 16
17 void visitNodeWithChildren(Node node, String type, [Map params]) { 17 void visitNodeWithChildren(Node node, String type, [Map params]) {
18 openNode(node, type, params); 18 openNode(node, type, params);
19 node.visitChildren(this); 19 node.visitChildren(this);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 closeNode(); 67 closeNode();
68 } 68 }
69 69
70 /// Pretty-prints given node tree into string. 70 /// Pretty-prints given node tree into string.
71 static String prettyPrint(Node node) { 71 static String prettyPrint(Node node) {
72 var p = new DebugPrinter(); 72 var p = new DebugPrinter();
73 node.accept(p); 73 node.accept(p);
74 return p.sb.toString(); 74 return p.sb.toString();
75 } 75 }
76 } 76 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698