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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 buff.add('\'\'\';\n'); | 494 buff.add('\'\'\';\n'); |
495 buff.add(' }\n\n'); | 495 buff.add(' }\n\n'); |
496 } | 496 } |
497 | 497 |
498 return buff.toString(); | 498 return buff.toString(); |
499 } | 499 } |
500 } | 500 } |
501 | 501 |
502 class ElemCG { | 502 class ElemCG { |
503 // List of identifiers and quoted strings (single and double quoted). | 503 // List of identifiers and quoted strings (single and double quoted). |
504 var identRe = new RegExp( | 504 var identRe = const RegExp( |
505 "\s*('\"\\'\\\"[^'\"\\'\\\"]+'\"\\'\\\"|[_A-Za-z][_A-Za-z0-9]*)"); | 505 "\s*('\"\\'\\\"[^'\"\\'\\\"]+'\"\\'\\\"|[_A-Za-z][_A-Za-z0-9]*)"); |
506 | 506 |
507 List<CGBlock> _cgBlocks; | 507 List<CGBlock> _cgBlocks; |
508 StringBuffer _globalDecls; // Global var declarations for all blocks. | 508 StringBuffer _globalDecls; // Global var declarations for all blocks. |
509 StringBuffer _globalInits; // Global List var initializtion for all | 509 StringBuffer _globalInits; // Global List var initializtion for all |
510 // blocks in a #each. | 510 // blocks in a #each. |
511 String funcCall; // Func call after element creation? | 511 String funcCall; // Func call after element creation? |
512 List<String> expressions; // List of injection function declarations. | 512 List<String> expressions; // List of injection function declarations. |
513 List<String> eachs; // List of each function declarations. | 513 List<String> eachs; // List of each function declarations. |
514 List<String> withs; // List of with function declarations. | 514 List<String> withs; // List of with function declarations. |
(...skipping 489 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 |