[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/lessphp/Tree/ -> Negative.php (source)

   1  <?php
   2  
   3  /**
   4   * Negative
   5   *
   6   * @package Less
   7   * @subpackage tree
   8   */
   9  class Less_Tree_Negative extends Less_Tree{
  10  
  11      public $value;
  12      public $type = 'Negative';
  13  
  14      public function __construct($node){
  15          $this->value = $node;
  16      }
  17  
  18      //function accept($visitor) {
  19      //    $this->value = $visitor->visit($this->value);
  20      //}
  21  
  22      /**
  23       * @see Less_Tree::genCSS
  24       */
  25      public function genCSS( $output ){
  26          $output->add( '-' );
  27          $this->value->genCSS( $output );
  28      }
  29  
  30      public function compile($env) {
  31          if( Less_Environment::isMathOn() ){
  32              $ret = new Less_Tree_Operation('*', array( new Less_Tree_Dimension(-1), $this->value ) );
  33              return $ret->compile($env);
  34          }
  35          return new Less_Tree_Negative( $this->value->compile($env) );
  36      }
  37  }


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1