Sabberworm\CSS\Parser::parseStringValue PHP Метод

parseStringValue() приватный Метод

private parseStringValue ( )
    private function parseStringValue()
    {
        $sBegin = $this->peek();
        $sQuote = null;
        if ($sBegin === "'") {
            $sQuote = "'";
        } else {
            if ($sBegin === '"') {
                $sQuote = '"';
            }
        }
        if ($sQuote !== null) {
            $this->consume($sQuote);
        }
        $sResult = "";
        $sContent = null;
        if ($sQuote === null) {
            //Unquoted strings end in whitespace or with braces, brackets, parentheses
            while (!preg_match('/[\\s{}()<>\\[\\]]/isu', $this->peek())) {
                $sResult .= $this->parseCharacter(false);
            }
        } else {
            while (!$this->comes($sQuote)) {
                $sContent = $this->parseCharacter(false);
                if ($sContent === null) {
                    throw new \Exception("Non-well-formed quoted string {$this->peek(3)}");
                }
                $sResult .= $sContent;
            }
            $this->consume($sQuote);
        }
        return new CSSString($sResult);
    }