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

Side by Side Diff: pkg/js_ast/lib/src/template.dart

Issue 2957593002: Spelling fixes e to i. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « pkg/js_ast/lib/src/nodes.dart ('k') | pkg/kernel/lib/ast.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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 Instantiator visitSplayable(Node node) { 174 Instantiator visitSplayable(Node node) {
175 // TODO(sra): Process immediate [InterpolatedNode]s, permitting splaying. 175 // TODO(sra): Process immediate [InterpolatedNode]s, permitting splaying.
176 return visit(node); 176 return visit(node);
177 } 177 }
178 178
179 Instantiator visitNode(Node node) { 179 Instantiator visitNode(Node node) {
180 throw 'Unimplemented InstantiatorGeneratorVisitor for $node'; 180 throw 'Unimplemented InstantiatorGeneratorVisitor for $node';
181 } 181 }
182 182
183 static RegExp identiferRE = new RegExp(r'^[A-Za-z_$][A-Za-z_$0-9]*$'); 183 static RegExp identifierRE = new RegExp(r'^[A-Za-z_$][A-Za-z_$0-9]*$');
184 184
185 static Expression convertStringToVariableUse(String value) { 185 static Expression convertStringToVariableUse(String value) {
186 assert(identiferRE.hasMatch(value)); 186 assert(identifierRE.hasMatch(value));
187 return new VariableUse(value); 187 return new VariableUse(value);
188 } 188 }
189 189
190 static Expression convertStringToVariableDeclaration(String value) { 190 static Expression convertStringToVariableDeclaration(String value) {
191 assert(identiferRE.hasMatch(value)); 191 assert(identifierRE.hasMatch(value));
192 return new VariableDeclaration(value); 192 return new VariableDeclaration(value);
193 } 193 }
194 194
195 Instantiator visitInterpolatedExpression(InterpolatedExpression node) { 195 Instantiator visitInterpolatedExpression(InterpolatedExpression node) {
196 var nameOrPosition = node.nameOrPosition; 196 var nameOrPosition = node.nameOrPosition;
197 return (arguments) { 197 return (arguments) {
198 var value = arguments[nameOrPosition]; 198 var value = arguments[nameOrPosition];
199 if (value is Expression) return value; 199 if (value is Expression) return value;
200 if (value is String) return convertStringToVariableUse(value); 200 if (value is String) return convertStringToVariableUse(value);
201 error('Interpolated value #$nameOrPosition is not an Expression: $value'); 201 error('Interpolated value #$nameOrPosition is not an Expression: $value');
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 node.visitChildren(this); 763 node.visitChildren(this);
764 if (count != before) containsInterpolatedNode.add(node); 764 if (count != before) containsInterpolatedNode.add(node);
765 } 765 }
766 766
767 visitInterpolatedNode(InterpolatedNode node) { 767 visitInterpolatedNode(InterpolatedNode node) {
768 containsInterpolatedNode.add(node); 768 containsInterpolatedNode.add(node);
769 if (node.isNamed) holeNames.add(node.nameOrPosition); 769 if (node.isNamed) holeNames.add(node.nameOrPosition);
770 ++count; 770 ++count;
771 } 771 }
772 } 772 }
OLDNEW
« no previous file with comments | « pkg/js_ast/lib/src/nodes.dart ('k') | pkg/kernel/lib/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698