ORIENT/vendor/wikimedia/less.php/lib/Less/Tree/Keyword.php

36 lines
603 B
PHP
Raw Normal View History

2021-04-08 08:08:59 +00:00
<?php
/**
2023-02-27 04:39:19 +00:00
* @private
2021-04-08 08:08:59 +00:00
*/
2023-02-27 04:39:19 +00:00
class Less_Tree_Keyword extends Less_Tree {
2021-04-08 08:08:59 +00:00
public $value;
public $type = 'Keyword';
/**
* @param string $value
*/
2023-02-27 04:39:19 +00:00
public function __construct( $value ) {
2021-04-08 08:08:59 +00:00
$this->value = $value;
}
2023-02-27 04:39:19 +00:00
/**
* @see Less_Tree::genCSS
*/
public function genCSS( $output ) {
if ( $this->value === '%' ) {
throw new Less_Exception_Compiler( "Invalid % without number" );
2021-04-08 08:08:59 +00:00
}
$output->add( $this->value );
}
2023-02-27 04:39:19 +00:00
public function compare( $other ) {
if ( $other instanceof Less_Tree_Keyword ) {
2021-04-08 08:08:59 +00:00
return $other->value === $this->value ? 0 : 1;
} else {
return -1;
}
}
}