Ejemplo n.º 1
0
 /**
  * @see ILess_Node
  */
 public function compile(ILess_Environment $env, $arguments = null, $important = null)
 {
     $media = new ILess_Node_Media(array(), array(), $this->index, $this->currentFileInfo);
     if ($this->debugInfo) {
         $this->rules[0]->debugInfo = $this->debugInfo;
         $media->debugInfo = $this->debugInfo;
     }
     $strictMathBypass = false;
     if (!$env->strictMath) {
         $strictMathBypass = true;
         $env->strictMath = true;
     }
     try {
         $media->features = $this->features->compile($env);
     } catch (Exception $e) {
         // empty on purpose
     }
     if ($strictMathBypass) {
         $env->strictMath = false;
     }
     $env->mediaPath[] = $media;
     $env->mediaBlocks[] = $media;
     array_unshift($env->frames, $this->rules[0]);
     $media->rules = array($this->rules[0]->compile($env));
     array_shift($env->frames);
     array_pop($env->mediaPath);
     return count($env->mediaPath) == 0 ? $media->compileTop($env) : $media->compileNested($env);
 }