Beispiel #1
0
 /**
  * Override default lessc method
  */
 public function injectVariables($args)
 {
     $this->pushEnv();
     $parser = new \lessc_parser($this, __METHOD__);
     foreach ($args as $name => $strValue) {
         if ($name[0] != '@') {
             $name = '@' . $name;
         }
         $parser->count = 0;
         $parser->buffer = (string) $strValue;
         if (!$parser->propertyValue($value)) {
             throw new \Exception("failed to parse passed in variable {$name}: {$strValue}");
         }
         $this->overrides[$name] = $value;
     }
 }
Beispiel #2
0
 public function __construct($lessc, $sourceName = null)
 {
     $this->eatWhiteDefault = true;
     // reference to less needed for vPrefix, mPrefix, and parentSelector
     $this->lessc = $lessc;
     $this->sourceName = $sourceName;
     // name used for error messages
     $this->writeComments = false;
     if (!self::$operatorString) {
         self::$operatorString = '(' . implode('|', array_map(array('lessc', 'preg_quote'), array_keys(self::$precedence))) . ')';
         $commentSingle = lessc::preg_quote(self::$commentSingle);
         $commentMultiLeft = lessc::preg_quote(self::$commentMultiLeft);
         $commentMultiRight = lessc::preg_quote(self::$commentMultiRight);
         self::$commentMulti = $commentMultiLeft . '.*?' . $commentMultiRight;
         self::$whitePattern = '/' . $commentSingle . '[^\\n]*\\s*|(' . self::$commentMulti . ')\\s*|\\s+/Ais';
     }
 }
Beispiel #3
0
 function __construct($lessc, $sourceName = null)
 {
     // reference to less needed for vPrefix, mPrefix, and parentSelector
     $this->lessc = $lessc;
     $this->sourceName = $sourceName;
     // name used for error messages
     if (!self::$operatorString) {
         self::$operatorString = '(' . implode('|', array_map(array('lessc', 'preg_quote'), array_keys(self::$precedence))) . ')';
     }
 }