| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 csslib.parser; | 5 part of csslib.parser; |
| 6 | 6 |
| 7 | 7 |
| 8 // TODO(terry): Add optimizing phase to remove duplicated selectors in the same | 8 // TODO(terry): Add optimizing phase to remove duplicated selectors in the same |
| 9 // selector group (e.g., .btn, .btn { color: red; }). Also, look | 9 // selector group (e.g., .btn, .btn { color: red; }). Also, look |
| 10 // at simplifying selectors expressions too (much harder). | 10 // at simplifying selectors expressions too (much harder). |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 visitMixinRulesetDirective(mixinDef); | 588 visitMixinRulesetDirective(mixinDef); |
| 589 } else { | 589 } else { |
| 590 visitMixinDeclarationDirective(mixinDef); | 590 visitMixinDeclarationDirective(mixinDef); |
| 591 } | 591 } |
| 592 } | 592 } |
| 593 | 593 |
| 594 /** | 594 /** |
| 595 * Given a mixin's defined arguments return a cloned mixin defintion that has | 595 * Given a mixin's defined arguments return a cloned mixin defintion that has |
| 596 * replaced all defined arguments with user's supplied VarUsages. | 596 * replaced all defined arguments with user's supplied VarUsages. |
| 597 */ | 597 */ |
| 598 MixinDefinition transform(List<TreeNode> callArgs) { | 598 MixinDefinition transform(List callArgs) { |
| 599 // TODO(terry): Handle default arguments and varArgs. | 599 // TODO(terry): Handle default arguments and varArgs. |
| 600 // Transform mixin with callArgs. | 600 // Transform mixin with callArgs. |
| 601 var index = 0; | 601 var index = 0; |
| 602 for (var index = 0; index < _definedArgs.length; index++) { | 602 for (var index = 0; index < _definedArgs.length; index++) { |
| 603 var definedArg = _definedArgs[index]; | 603 var definedArg = _definedArgs[index]; |
| 604 VarDefinition varDef; | 604 VarDefinition varDef; |
| 605 if (definedArg is VarDefinition) { | 605 if (definedArg is VarDefinition) { |
| 606 varDef = definedArg; | 606 varDef = definedArg; |
| 607 } else if (definedArg is VarDefinitionDirective) { | 607 } else if (definedArg is VarDefinitionDirective) { |
| 608 VarDefinitionDirective varDirective = definedArg; | 608 VarDefinitionDirective varDirective = definedArg; |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 isLastNone = false; | 1008 isLastNone = false; |
| 1009 } | 1009 } |
| 1010 } else { | 1010 } else { |
| 1011 isLastNone = simpleSeq.isCombinatorNone; | 1011 isLastNone = simpleSeq.isCombinatorNone; |
| 1012 } | 1012 } |
| 1013 } | 1013 } |
| 1014 } | 1014 } |
| 1015 super.visitSelectorGroup(node); | 1015 super.visitSelectorGroup(node); |
| 1016 } | 1016 } |
| 1017 } | 1017 } |
| OLD | NEW |