9 class Less_Tree_Element extends Less_Tree{
11 public $combinator = '';
14 public $currentFileInfo;
15 public $type = 'Element';
17 public $value_is_object = false;
19 public function __construct($combinator, $value, $index = null, $currentFileInfo = null ){
21 $this->value = $value;
22 $this->value_is_object = is_object($value);
25 $this->combinator = $combinator;
28 $this->index = $index;
29 $this->currentFileInfo = $currentFileInfo;
32 public function accept( $visitor ){
33 if( $this->value_is_object ){ //object or string
34 $this->value = $visitor->visitObj( $this->value );
38 public function compile($env){
40 if( Less_Environment::$mixin_stack ){
41 return new Less_Tree_Element($this->combinator, ($this->value_is_object ? $this->value->compile($env) : $this->value), $this->index, $this->currentFileInfo );
44 if( $this->value_is_object ){
45 $this->value = $this->value->compile($env);
52 * @see Less_Tree::genCSS
54 public function genCSS( $output ){
55 $output->add( $this->toCSS(), $this->currentFileInfo, $this->index );
58 public function toCSS(){
60 if( $this->value_is_object ){
61 $value = $this->value->toCSS();
63 $value = $this->value;
67 if( $value === '' && $this->combinator && $this->combinator === '&' ){
72 return Less_Environment::$_outputMap[$this->combinator] . $value;