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

Side by Side Diff: lib/src/js/template.dart

Issue 963063003: DDC fixes on DDC (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « lib/src/js/printer.dart ('k') | lib/src/options.dart » ('j') | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 part of js_ast; 5 part of js_ast;
6 6
7 class TemplateManager { 7 class TemplateManager {
8 Map<String, Template> expressionTemplates = new Map<String, Template>(); 8 Map<String, Template> expressionTemplates = new Map<String, Template>();
9 Map<String, Template> statementTemplates = new Map<String, Template>(); 9 Map<String, Template> statementTemplates = new Map<String, Template>();
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 return instantiator(arguments); 119 return instantiator(arguments);
120 } 120 }
121 } 121 }
122 122
123 /** 123 /**
124 * An Instantiator is a Function that generates a JS AST tree or List of 124 * An Instantiator is a Function that generates a JS AST tree or List of
125 * trees. [arguments] is a List for positional templates, or Map for 125 * trees. [arguments] is a List for positional templates, or Map for
126 * named templates. 126 * named templates.
127 */ 127 */
128 typedef Node Instantiator(var arguments); 128 typedef Instantiator(var arguments);
129 129
130 130
131 /** 131 /**
132 * InstantiatorGeneratorVisitor compiles a template. This class compiles a tree 132 * InstantiatorGeneratorVisitor compiles a template. This class compiles a tree
133 * containing [InterpolatedNode]s into a function that will create a copy of the 133 * containing [InterpolatedNode]s into a function that will create a copy of the
134 * tree with the interpolated nodes substituted with provided values. 134 * tree with the interpolated nodes substituted with provided values.
135 */ 135 */
136 class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> { 136 class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> {
137 137
138 final bool forceCopy; 138 final bool forceCopy;
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 if (count != before) containsInterpolatedNode.add(node); 859 if (count != before) containsInterpolatedNode.add(node);
860 return null; 860 return null;
861 } 861 }
862 862
863 visitInterpolatedNode(InterpolatedNode node) { 863 visitInterpolatedNode(InterpolatedNode node) {
864 containsInterpolatedNode.add(node); 864 containsInterpolatedNode.add(node);
865 if (node.isNamed) holeNames.add(node.nameOrPosition); 865 if (node.isNamed) holeNames.add(node.nameOrPosition);
866 ++count; 866 ++count;
867 } 867 }
868 } 868 }
OLDNEW
« no previous file with comments | « lib/src/js/printer.dart ('k') | lib/src/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698