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

Unified Diff: pkg/js_ast/lib/src/printer.dart

Issue 1153243003: dart2js: Use frequency of occurence to sort metadata indices. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Addressed sra's comments Created 5 years, 6 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 | « pkg/js_ast/lib/src/nodes.dart ('k') | pkg/js_ast/lib/src/template.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/js_ast/lib/src/printer.dart
diff --git a/pkg/js_ast/lib/src/printer.dart b/pkg/js_ast/lib/src/printer.dart
index 57b35cfae4ce9cf8ae1e9175ffbac7165d61a1f1..c2deb1eefc2d591c29d19d193ba37b8e1c87e7f8 100644
--- a/pkg/js_ast/lib/src/printer.dart
+++ b/pkg/js_ast/lib/src/printer.dart
@@ -952,7 +952,32 @@ class Printer implements NodeVisitor {
}
@override
- void visitLiteralBool(LiteralBool node) {
+ visitDeferredExpression(DeferredExpression node) {
+ // Continue printing with the expression value.
+ assert(node.precedenceLevel == node.value.precedenceLevel);
+ node.value.accept(this);
+ }
+
+ outputNumberWithRequiredWhitespace(String number) {
+ int charCode = number.codeUnitAt(0);
+ if (charCode == charCodes.$MINUS && lastCharCode == charCodes.$MINUS) {
+ out(" ", isWhitespace: true);
+ }
+ out(number);
+ }
+
+ @override
+ visitDeferredNumber(DeferredNumber node) {
+ outputNumberWithRequiredWhitespace("${node.value}");
+ }
+
+ @override
+ visitDeferredString(DeferredString node) {
+ out(node.value);
+ }
+
+ @override
+ visitLiteralBool(LiteralBool node) {
out(node.value ? "true" : "false");
}
@@ -962,12 +987,13 @@ class Printer implements NodeVisitor {
}
@override
- void visitLiteralNumber(LiteralNumber node) {
- int charCode = node.value.codeUnitAt(0);
- if (charCode == charCodes.$MINUS && lastCharCode == charCodes.$MINUS) {
- out(" ", isWhitespace: true);
- }
- out(node.value);
+ visitStringConcatenation(StringConcatenation node) {
+ node.visitChildren(this);
+ }
+
+ @override
+ visitLiteralNumber(LiteralNumber node) {
+ outputNumberWithRequiredWhitespace(node.value);
}
@override
@@ -1013,7 +1039,6 @@ class Printer implements NodeVisitor {
out("{");
indentMore();
for (int i = 0; i < properties.length; i++) {
- Expression value = properties[i].value;
if (i != 0) {
out(",");
if (node.isOneLiner) spaceOut();
« no previous file with comments | « pkg/js_ast/lib/src/nodes.dart ('k') | pkg/js_ast/lib/src/template.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698