lessc_parser::string PHP Method

string() protected method

protected string ( &$out )
    protected function string(&$out)
    {
        $s = $this->seek();
        if ($this->literal('"', false)) {
            $delim = '"';
        } elseif ($this->literal("'", false)) {
            $delim = "'";
        } else {
            return false;
        }
        $content = array();
        // look for either ending delim , escape, or string interpolation
        $patt = '([^\\n]*?)(@\\{|\\\\|' . Beans_Lessc::preg_quote($delim) . ')';
        $oldWhite = $this->eatWhiteDefault;
        $this->eatWhiteDefault = false;
        while ($this->match($patt, $m, false)) {
            $content[] = $m[1];
            if ($m[2] == "@{") {
                $this->count -= strlen($m[2]);
                if ($this->interpolation($inter, false)) {
                    $content[] = $inter;
                } else {
                    $this->count += strlen($m[2]);
                    $content[] = "@{";
                    // ignore it
                }
            } elseif ($m[2] == '\\') {
                $content[] = $m[2];
                if ($this->literal($delim, false)) {
                    $content[] = $delim;
                }
            } else {
                $this->count -= strlen($delim);
                break;
                // delim
            }
        }
        $this->eatWhiteDefault = $oldWhite;
        if ($this->literal($delim)) {
            $out = array("string", $delim, $content);
            return true;
        }
        $this->seek($s);
        return false;
    }