Leafo\ScssPhp\Parser::to PHP Method

to() protected method

Deprecation: {@internal advance counter to next occurrence of $what $until - don't include $what in advance $allowNewline, if string, will be used as valid char set}}
protected to ( $what, &$out, $until = false, $allowNewline = false )
    protected function to($what, &$out, $until = false, $allowNewline = false)
    {
        if (is_string($allowNewline)) {
            $validChars = $allowNewline;
        } else {
            $validChars = $allowNewline ? '.' : "[^\n]";
        }
        if (!$this->match('(' . $validChars . '*?)' . $this->pregQuote($what), $m, !$until)) {
            return false;
        }
        if ($until) {
            $this->count -= strlen($what);
            // give back $what
        }
        $out = $m[1];
        return true;
    }