9 class Less_Tree_Extend
extends Less_Tree
{
14 public $selfSelectors = array();
17 public $firstExtendOnThisSelectorPath;
18 public $type = 'Extend';
23 public $parent_ids = array();
26 * @param integer $index
28 function __construct($selector, $option, $index){
30 $this->selector
= $selector;
31 $this->option
= $option;
32 $this->index
= $index;
36 $this->allowBefore
= true;
37 $this->allowAfter
= true;
40 $this->allowBefore
= false;
41 $this->allowAfter
= false;
45 $this->object_id
= $i++
;
46 $this->parent_ids
= array($this->object_id
);
49 function accept( $visitor ){
50 $this->selector
= $visitor->visitObj( $this->selector
);
53 function compile( $env ){
54 Less_Parser
::$has_extends = true;
55 $this->selector
= $this->selector
->compile($env);
57 //return new Less_Tree_Extend( $this->selector->compile($env), $this->option, $this->index);
60 function findSelfSelectors( $selectors ){
61 $selfElements = array();
64 for( $i = 0, $selectors_len = count($selectors); $i < $selectors_len; $i++
){
65 $selectorElements = $selectors[$i]->elements
;
66 // duplicate the logic in genCSS function inside the selector node.
67 // future TODO - move both logics into the selector joiner visitor
68 if( $i && $selectorElements && $selectorElements[0]->combinator
=== "") {
69 $selectorElements[0]->combinator
= ' ';
71 $selfElements = array_merge( $selfElements, $selectors[$i]->elements
);
74 $this->selfSelectors
= array(new Less_Tree_Selector($selfElements));