Automattic\WooCommerce\Vendor\Sabberworm\CSS\Parsing

ParserState::parseIdentifierpublicWC 1.0

Method of the class: ParserState{}

No Hooks.

Returns

String.

Usage

$ParserState = new ParserState();
$ParserState->parseIdentifier( $bIgnoreCase );
$bIgnoreCase(true|false)
.
Default: true

ParserState::parseIdentifier() code WC 10.8.1

public function parseIdentifier($bIgnoreCase = true)
{
    if ($this->isEnd()) {
        throw new UnexpectedEOFException('', '', 'identifier', $this->iLineNo);
    }
    $sResult = $this->parseCharacter(true);
    if ($sResult === null) {
        throw new UnexpectedTokenException($sResult, $this->peek(5), 'identifier', $this->iLineNo);
    }
    $sCharacter = null;
    while (!$this->isEnd() && ($sCharacter = $this->parseCharacter(true)) !== null) {
        if (preg_match('/[a-zA-Z0-9\x{00A0}-\x{FFFF}_-]/Sux', $sCharacter)) {
            $sResult .= $sCharacter;
        } else {
            $sResult .= '\\' . $sCharacter;
        }
    }
    if ($bIgnoreCase) {
        $sResult = $this->strtolower($sResult);
    }
    return $sResult;
}