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

Unified Diff: lib/compiler/implementation/dart_backend/backend.dart

Issue 10913064: Migrate to new Unparse API for AST emission. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/backend.dart
diff --git a/lib/compiler/implementation/dart_backend/backend.dart b/lib/compiler/implementation/dart_backend/backend.dart
index ea578332a95f4f846bb285e274f4678cf3f21589..8e8d216ca2cb6a4b69203f1e4dfe3fe2c1699567 100644
--- a/lib/compiler/implementation/dart_backend/backend.dart
+++ b/lib/compiler/implementation/dart_backend/backend.dart
@@ -217,11 +217,8 @@ class DartBackend extends Backend {
if (outputAst) {
// TODO(antonm): Ideally XML should be a separate backend.
// TODO(antonm): obey renames and minification, at least as an option.
- StringBuffer sb = new StringBuffer();
- sb.add('<Program>\n');
- outputElement(element) {
- sb.add(element.parseNode(compiler).toDebugString());
- }
+ final unparser = new Unparser();
+ outputElement(element) { unparser.unparse(element.parseNode(compiler)); }
// Emit XML for AST instead of the program.
for (final topLevel in sortedTopLevels) {
@@ -232,8 +229,7 @@ class DartBackend extends Backend {
outputElement(topLevel);
}
}
- sb.add('</Program>\n');
- compiler.assembledCode = sb.toString();
+ compiler.assembledCode = '<Program>\n${unparser.result}</Program>\n';
return;
}
« 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