Index: pkg/kernel/lib/text/ast_to_text.dart |
diff --git a/pkg/kernel/lib/text/ast_to_text.dart b/pkg/kernel/lib/text/ast_to_text.dart |
index 9e9a093bb2b206a8b5415e8bc8ccc4974eafb88d..18be9de8860b332563538e31d135145a2867ce16 100644 |
--- a/pkg/kernel/lib/text/ast_to_text.dart |
+++ b/pkg/kernel/lib/text/ast_to_text.dart |
@@ -92,6 +92,12 @@ String debugNodeToString(Node node) { |
return '$buffer'; |
} |
+String programToString(Program node) { |
+ StringBuffer buffer = new StringBuffer(); |
+ new Printer(buffer, syntheticNames: new NameSystem()).writeProgramFile(node); |
+ return '$buffer'; |
+} |
+ |
class NameSystem { |
final Namer<VariableDeclaration> variables = |
new Namer<VariableDeclaration>('#t'); |