本文整理汇总了PHP中lessc_parser类的典型用法代码示例。如果您正苦于以下问题:PHP lessc_parser类的具体用法?PHP lessc_parser怎么用?PHP lessc_parser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了lessc_parser类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: injectVariables
/**
* 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;
}
}
示例2: __construct
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';
}
}
示例3: implode
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))) . ')';
}
}