| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |