FOF30\Less\Parser\Parser::openString PHP Метод

openString() защищенный Метод

An unbounded string stopped by $end
protected openString ( [type] $end, &$out, [type] $nestingOpen = null, [type] $rejectStrs = null ) : boolean
$end [type]
$nestingOpen [type]
$rejectStrs [type]
Результат boolean
    protected function openString($end, &$out, $nestingOpen = null, $rejectStrs = null)
    {
        $oldWhite = $this->eatWhiteDefault;
        $this->eatWhiteDefault = false;
        $stop = array("'", '"', "@{", $end);
        $stop = array_map(array("\\FOF30\\Less\\Less", "preg_quote"), $stop);
        // $stop[] = self::$commentMulti;
        if (!is_null($rejectStrs)) {
            $stop = array_merge($stop, $rejectStrs);
        }
        $patt = '(.*?)(' . implode("|", $stop) . ')';
        $nestingLevel = 0;
        $content = array();
        while ($this->match($patt, $m, false)) {
            if (!empty($m[1])) {
                $content[] = $m[1];
                if ($nestingOpen) {
                    $nestingLevel += substr_count($m[1], $nestingOpen);
                }
            }
            $tok = $m[2];
            $this->count -= strlen($tok);
            if ($tok == $end) {
                if ($nestingLevel == 0) {
                    break;
                } else {
                    $nestingLevel--;
                }
            }
            if (($tok == "'" || $tok == '"') && $this->string($str)) {
                $content[] = $str;
                continue;
            }
            if ($tok == "@{" && $this->interpolation($inter)) {
                $content[] = $inter;
                continue;
            }
            if (in_array($tok, $rejectStrs)) {
                $count = null;
                break;
            }
            $content[] = $tok;
            $this->count += strlen($tok);
        }
        $this->eatWhiteDefault = $oldWhite;
        if (count($content) == 0) {
            return false;
        }
        // Trim the end
        if (is_string(end($content))) {
            $content[count($content) - 1] = rtrim(end($content));
        }
        $out = array("string", "", $content);
        return true;
    }