protected function value(&$value)
{
$s = $this->seek();
// speed shortcut
if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] == "-") {
// negation
if ($this->literal("-", false) && ($this->variable($inner) && ($inner = array("variable", $inner)) || $this->unit($inner) || $this->parenValue($inner))) {
$value = array("unary", "-", $inner);
return true;
} else {
$this->seek($s);
}
}
if ($this->parenValue($value)) {
return true;
}
if ($this->unit($value)) {
return true;
}
if ($this->color($value)) {
return true;
}
if ($this->func($value)) {
return true;
}
if ($this->string($value)) {
return true;
}
if ($this->keyword($word)) {
$value = array('keyword', $word);
return true;
}
// try a variable
if ($this->variable($var)) {
$value = array('variable', $var);
return true;
}
// unquote string (should this work on any type?
if ($this->literal("~") && $this->string($str)) {
$value = array("escape", $str);
return true;
} else {
$this->seek($s);
}
// css hack: \0
if ($this->literal('\\') && $this->match('([0-9]+)', $m)) {
$value = array('keyword', '\\' . $m[1]);
return true;
} else {
$this->seek($s);
}
return false;
}