private function lessc::value in Less CSS Preprocessor 6
Same name and namespace in other branches
- 6.3 lessphp/lessc.inc.php \lessc::value()
2 calls to lessc::value()
File
- ./
lessc.inc.php, line 550
Class
Code
private function value(&$val) {
try {
return $this
->unit($val);
} catch (exception $ex) {
/* $this->undo(); */
}
// look for accessor
// must be done before color
try {
$save = $this->count;
// todo: replace with counter stack
$this
->accessor($a);
$tmp = $this
->get($a[0]);
// get env
$val = end($tmp[$a[1]]);
// get latest var
return $this;
} catch (exception $ex) {
$this->count = $save;
/* $this->undo(); */
}
try {
return $this
->color($val);
} catch (exception $ex) {
/* $this->undo(); */
}
try {
$save = $this->count;
$this
->func($f);
$val = array(
'string',
$f,
);
return $this;
} catch (exception $ex) {
$this->count = $save;
}
// a string
try {
$save = $this->count;
$this
->string($tmp, $d);
$val = array(
'string',
$d . $tmp . $d,
);
return $this;
} catch (exception $ex) {
$this->count = $save;
}
try {
$this
->keyword($k);
$val = array(
'keyword',
$k,
);
return $this;
} catch (exception $ex) {
/* $this->undo(); */
}
// try to get a variable
try {
$this
->variable($name);
$val = array(
'variable',
'@' . $name,
);
return $this;
} catch (exception $ex) {
/* $this->undo(); */
}
throw new exception('parse error: failed to find value');
}