FOF30\Less\Parser\Parser::string PHP Method

string() protected method

[string description]
protected string ( &$out ) : boolean
return boolean
    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]*?)(@\\{|\\\\|' . Less::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]);
                    // Ignore it
                    $content[] = "@{";
                }
            } elseif ($m[2] == '\\') {
                $content[] = $m[2];
                if ($this->literal($delim, false)) {
                    $content[] = $delim;
                }
            } else {
                $this->count -= strlen($delim);
                // Delim
                break;
            }
        }
        $this->eatWhiteDefault = $oldWhite;
        if ($this->literal($delim)) {
            $out = array("string", $delim, $content);
            return true;
        }
        $this->seek($s);
        return false;
    }