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

Side by Side Diff: utils/template/codegen.dart

Issue 10964030: A variety of cleanups to bring our samples up-to-date. (Closed) Base URL: http://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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/css/tree.dart ('k') | no next file » | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class CGBlock { 5 class CGBlock {
6 int _blockType; // Code type of this block 6 int _blockType; // Code type of this block
7 int _indent; // Number of spaces to prefix for each statement 7 int _indent; // Number of spaces to prefix for each statement
8 bool _inEach; // This block or any currently active blocks is a 8 bool _inEach; // This block or any currently active blocks is a
9 // #each. If so then any element marked with a 9 // #each. If so then any element marked with a
10 // var attribute is repeated therefore the var 10 // var attribute is repeated therefore the var
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 dartNames.add(dartName.toString()); 343 dartNames.add(dartName.toString());
344 } 344 }
345 } 345 }
346 346
347 StringBuffer buff = new StringBuffer(); 347 StringBuffer buff = new StringBuffer();
348 if (classes.length > 0) { 348 if (classes.length > 0) {
349 assert(classes.length == dartNames.length); 349 assert(classes.length == dartNames.length);
350 buff.add("\n // CSS class selectors for this template.\n"); 350 buff.add("\n // CSS class selectors for this template.\n");
351 for (int i = 0; i < classes.length; i++) { 351 for (int i = 0; i < classes.length; i++) {
352 buff.add( 352 buff.add(
353 " static String get ${dartNames[i]}() => \"${classes[i]}\";\n"); 353 " static String get ${dartNames[i]} => \"${classes[i]}\";\n");
354 } 354 }
355 } 355 }
356 356
357 return buff.toString(); 357 return buff.toString();
358 } 358 }
359 359
360 static String _emitClass(String className, 360 static String _emitClass(String className,
361 List<Map<Identifier, Identifier>> params, 361 List<Map<Identifier, Identifier>> params,
362 TemplateContent content, 362 TemplateContent content,
363 String addStylesheetFuncName) { 363 String addStylesheetFuncName) {
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 for (String name in names) { 1004 for (String name in names) {
1005 buff.add(" var ${name} = _scopes[\"${name}\"];\n"); 1005 buff.add(" var ${name} = _scopes[\"${name}\"];\n");
1006 } 1006 }
1007 buff.add("\n"); 1007 buff.add("\n");
1008 } 1008 }
1009 1009
1010 return buff.toString(); 1010 return buff.toString();
1011 } 1011 }
1012 1012
1013 } 1013 }
OLDNEW
« no previous file with comments | « utils/css/tree.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698