Automattic\WooCommerce\Vendor\Sabberworm\CSS\Parsing

ParserState::consumeWhiteSpacepublicWC 1.0

Method of the class: ParserState{}

No Hooks.

Returns

Array. Comment>|void

Usage

$ParserState = new ParserState();
$ParserState->consumeWhiteSpace();

ParserState::consumeWhiteSpace() code WC 10.5.0

public function consumeWhiteSpace()
{
    $aComments = [];
    do {
        while (preg_match('/\\s/isSu', $this->peek()) === 1) {
            $this->consume(1);
        }
        if ($this->oParserSettings->bLenientParsing) {
            try {
                $oComment = $this->consumeComment();
            } catch (UnexpectedEOFException $e) {
                $this->iCurrentPosition = $this->iLength;
                return $aComments;
            }
        } else {
            $oComment = $this->consumeComment();
        }
        if ($oComment !== false) {
            $aComments[] = $oComment;
        }
    } while ($oComment !== false);
    return $aComments;
}