- Output for 7.1.25 - 7.1.33, 7.2.0 - 7.2.24, 7.3.0 - 7.3.11
- Parse error: syntax error, unexpected '=' in /in/8KhGB on line 14
Process exited with code 255.
<?php
/**
* Section 4.3.5. of the CSS syntax 3 specification
*
* Consumes a string token as defined per section 4.3.5 of the CSS specification
* @see https://www.w3.org/TR/css-syntax-3/#consume-string-token
*
* @param string|null $endingCodePoint
* @return TString|BadString
*/
function consumeString(?string $endingCodePoint = null): Token
{
$endingCodePoint ??= $this->inputStream->next();
$string = "";
again:
$codePoint = $this->inputStream->peek();
if ($codePoint === $endingCodePoint) {
// Consume ending code point
$this->inputStream->next();
return new TString($string);
}
if ($this->inputStream->isEndOfStream()) {
// TODO Parse error
return new TString($string);
}
if ($codePoint === Definitions::NEWLINE) {
// TODO Parse error
return new BadString($string);
}
if ($codePoint !== self::REVERSE_SOLIDUS) {
$string .= $this->inputStream->next();
goto again;
}
switch ($this->inputStream->peek(1)) {
case Definitions::NEWLINE:
// Consume the NEW LINE
$this->inputStream->next();
case '':
// Consume the REVERSE SOLIDUS
$this->inputStream->next();
goto again;
default:
$string .= $this->consumeEscapedCodePoint();
goto again;
}
}