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

Unified Diff: pkg/js_ast/lib/src/template.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: Created 5 years, 7 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
« pkg/js_ast/lib/src/printer.dart ('K') | « pkg/js_ast/lib/src/printer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/js_ast/lib/src/template.dart
diff --git a/pkg/js_ast/lib/src/template.dart b/pkg/js_ast/lib/src/template.dart
index e7aa86349138ef90b14c60f729f5dfb6da4d4d33..7bd1885c159b8d47d0a82edcd69af68865ebee21 100644
--- a/pkg/js_ast/lib/src/template.dart
+++ b/pkg/js_ast/lib/src/template.dart
@@ -654,6 +654,15 @@ class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> {
};
}
+ Instantiator visitTokenExpression(TokenExpression node) =>
sra1 2015/05/27 19:38:51 => same;
herhut 2015/06/01 12:09:43 Neat!
+ (arguments) => node;
+
+ Instantiator visitTokenNumber(TokenNumber node) =>
sra1 2015/05/27 19:38:51 ditto
herhut 2015/06/01 12:09:43 Done.
+ (arguments) => node;
+
+ Instantiator visitTokenString(TokenString node) =>
+ (arguments) => node;
+
Instantiator visitLiteralBool(LiteralBool node) =>
(arguments) => new LiteralBool(node.value);
@@ -666,6 +675,18 @@ class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> {
Instantiator visitLiteralNull(LiteralNull node) =>
(arguments) => new LiteralNull();
+ Instantiator visitStringConcatenation(StringConcatenation node) {
+ List<Instantiator> partMakers = node.parts
+ .map(visit)
+ .toList(growable: false);
+ return (arguments) {
+ List<Literal> parts = partMakers
+ .map((Instantiator instantiator) => instantiator(arguments))
+ .toList(growable: false);
+ return new StringConcatenation(parts);
+ };
+ }
+
Instantiator visitArrayInitializer(ArrayInitializer node) {
// TODO(sra): Implement splicing?
List<Instantiator> elementMakers = node.elements
« pkg/js_ast/lib/src/printer.dart ('K') | « pkg/js_ast/lib/src/printer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698