public function Reset($options = null) {
   $this->rules = array();
   self::$imports = array();
   self::$has_extends = false;
   self::$imports = array();
   self::$contentsMap = array();
   $this->env = new Less_Environment($options);
   $this->env->Init();
   if (is_array($options)) {
     $this->SetOptions(Less_Parser::$default_options);
     $this->SetOptions($options);
   }
 }
Пример #2
0
    /**
     * @param Environment|null $env
     */
    public function __construct( $env = null ){

		// Top parser on an import tree must be sure there is one "env"
		// which will then be passed around by reference.
		if( $env instanceof Less_Environment ){
			$this->env = $env;
		}else{
			$this->env = new Less_Environment( $env );
			self::$imports = array();
			self::$import_dirs = array();
		}

		$this->pos = 0;
    }
Пример #3
0
 /**
  * @param Less_Environment|array|null $env
  */
 public function __construct($env = null)
 {
     // Top parser on an import tree must be sure there is one "env"
     // which will then be passed around by reference.
     if ($env instanceof Less_Environment) {
         $this->env = $env;
     } else {
         //reset
         self::$imports = array();
         self::$has_extends = false;
         self::$imports = array();
         self::$contentsMap = array();
         $this->SetOptions(Less_Parser::$default_options);
         //set new options
         $this->env = new Less_Environment($env);
         $this->env->Init();
         if (is_array($env)) {
             $this->SetOptions($env);
         }
     }
     $this->pos = $this->farthest = 0;
 }