public function CssScanner::getQuotedString in QueryPath 6
Same name and namespace in other branches
- 7.3 QueryPath/CssParser.php \CssScanner::getQuotedString()
- 7.2 QueryPath/CssParser.php \CssScanner::getQuotedString()
File
- QueryPath/
CssParser.php, line 680
Class
Code
public function getQuotedString() {
if ($this->token == CssToken::quote || $this->token == CssToken::squote || $this->token == CssToken::lparen) {
$end = $this->token == CssToken::lparen ? CssToken::rparen : $this->token;
$buf = '';
$escape = FALSE;
$this
->nextToken();
while ($this->token !== FALSE && $this->token > -1) {
if ($this->token == CssToken::bslash && !$escape) {
$escape = TRUE;
}
elseif ($escape) {
$buf .= $this->value;
$escape = FALSE;
}
elseif ($this->token === $end) {
$this
->nextToken();
break;
}
else {
$buf .= $this->value;
}
$this
->nextToken();
}
return $buf;
}
}