From fd72b0f50a355006069c5a336441f08beb7d3c50 Mon Sep 17 00:00:00 2001 From: derchris Date: Mon, 4 Feb 2019 13:11:28 +0100 Subject: Revert "update less.php to PHP 7.x compatible fork" This reverts commit 7ad9f272a482802da2d43fe83841adbe9bcd8cb4. --- lib/less.php/Tree/Call.php | 121 --------------------------------------------- 1 file changed, 121 deletions(-) delete mode 100644 lib/less.php/Tree/Call.php (limited to 'lib/less.php/Tree/Call.php') diff --git a/lib/less.php/Tree/Call.php b/lib/less.php/Tree/Call.php deleted file mode 100644 index 3c3382d..0000000 --- a/lib/less.php/Tree/Call.php +++ /dev/null @@ -1,121 +0,0 @@ -name = $name; - $this->args = $args; - $this->index = $index; - $this->currentFileInfo = $currentFileInfo; - } - - public function accept( $visitor ){ - $this->args = $visitor->visitArray( $this->args ); - } - - // - // When evaluating a function call, - // we either find the function in `tree.functions` [1], - // in which case we call it, passing the evaluated arguments, - // or we simply print it out as it appeared originally [2]. - // - // The *functions.js* file contains the built-in functions. - // - // The reason why we evaluate the arguments, is in the case where - // we try to pass a variable to a function, like: `saturate(@color)`. - // The function should receive the value, not the variable. - // - public function compile($env=null){ - $args = array(); - foreach($this->args as $a){ - $args[] = $a->compile($env); - } - - $nameLC = strtolower($this->name); - switch($nameLC){ - case '%': - $nameLC = '_percent'; - break; - - case 'get-unit': - $nameLC = 'getunit'; - break; - - case 'data-uri': - $nameLC = 'datauri'; - break; - - case 'svg-gradient': - $nameLC = 'svggradient'; - break; - } - - $result = null; - if( $nameLC === 'default' ){ - $result = Less_Tree_DefaultFunc::compile(); - - }else{ - - if( method_exists('Less_Functions',$nameLC) ){ // 1. - try { - - $func = new Less_Functions($env, $this->currentFileInfo); - $result = call_user_func_array( array($func,$nameLC),$args); - - } catch (Exception $e) { - throw new Less_Exception_Compiler('error evaluating function `' . $this->name . '` '.$e->getMessage().' index: '. $this->index); - } - } elseif( isset( $env->functions[$nameLC] ) && is_callable( $env->functions[$nameLC] ) ) { - try { - $result = call_user_func_array( $env->functions[$nameLC], $args ); - } catch (Exception $e) { - throw new Less_Exception_Compiler('error evaluating function `' . $this->name . '` '.$e->getMessage().' index: '. $this->index); - } - } - } - - if( $result !== null ){ - return $result; - } - - - return new Less_Tree_Call( $this->name, $args, $this->index, $this->currentFileInfo ); - } - - /** - * @see Less_Tree::genCSS - */ - public function genCSS( $output ){ - - $output->add( $this->name . '(', $this->currentFileInfo, $this->index ); - $args_len = count($this->args); - for($i = 0; $i < $args_len; $i++ ){ - $this->args[$i]->genCSS( $output ); - if( $i + 1 < $args_len ){ - $output->add( ', ' ); - } - } - - $output->add( ')' ); - } - - - //public function toCSS(){ - // return $this->compile()->toCSS(); - //} - -} -- cgit v1.2.3