| 1 |
<?php |
| 2 |
/** |
| 3 |
* @private |
| 4 |
* @see less-2.5.3.js#Assignment.prototype |
| 5 |
*/ |
| 6 |
class Less_Tree_Assignment extends Less_Tree implements Less_Tree_HasValueProperty { |
| 7 |
/** @var string */ |
| 8 |
public $key; |
| 9 |
/** @var Less_Tree */ |
| 10 |
public $value; |
| 11 |
|
| 12 |
public function __construct( string $key, Less_Tree $val ) { |
| 13 |
$this->key = $key; |
| 14 |
$this->value = $val; |
| 15 |
} |
| 16 |
|
| 17 |
public function accept( $visitor ) { |
| 18 |
$this->value = $visitor->visitObj( $this->value ); |
| 19 |
} |
| 20 |
|
| 21 |
public function compile( $env ) { |
| 22 |
// NOTE: Less.js has a conditional for $this->value, |
| 23 |
// but this appears unreachable ($val is not optional). |
| 24 |
return new self( $this->key, $this->value->compile( $env ) ); |
| 25 |
} |
| 26 |
|
| 27 |
public function genCSS( $output ) { |
| 28 |
$output->add( $this->key . '=' ); |
| 29 |
$this->value->genCSS( $output ); |
| 30 |
} |
| 31 |
} |