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/Condition.php | 72 ----------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 lib/less.php/Tree/Condition.php (limited to 'lib/less.php/Tree/Condition.php') diff --git a/lib/less.php/Tree/Condition.php b/lib/less.php/Tree/Condition.php deleted file mode 100644 index 929d33b..0000000 --- a/lib/less.php/Tree/Condition.php +++ /dev/null @@ -1,72 +0,0 @@ -op = trim($op); - $this->lvalue = $l; - $this->rvalue = $r; - $this->index = $i; - $this->negate = $negate; - } - - public function accept($visitor){ - $this->lvalue = $visitor->visitObj( $this->lvalue ); - $this->rvalue = $visitor->visitObj( $this->rvalue ); - } - - public function compile($env) { - $a = $this->lvalue->compile($env); - $b = $this->rvalue->compile($env); - - switch( $this->op ){ - case 'and': - $result = $a && $b; - break; - - case 'or': - $result = $a || $b; - break; - - default: - if( Less_Parser::is_method($a, 'compare') ){ - $result = $a->compare($b); - }elseif( Less_Parser::is_method($b, 'compare') ){ - $result = $b->compare($a); - }else{ - throw new Less_Exception_Compiler('Unable to perform comparison', null, $this->index); - } - - switch ($result) { - case -1: - $result = $this->op === '<' || $this->op === '=<' || $this->op === '<='; - break; - - case 0: - $result = $this->op === '=' || $this->op === '>=' || $this->op === '=<' || $this->op === '<='; - break; - - case 1: - $result = $this->op === '>' || $this->op === '>='; - break; - } - break; - } - - return $this->negate ? !$result : $result; - } - -} -- cgit v1.2.3