public function CssScanner::getQuotedString in QueryPath 7.3
Same name and namespace in other branches
- 6 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;
}
}