Jade\Compiler::handleString PHP Method

handleString() public method

public handleString ( $input ) : array
$input
return array
    public function handleString($input)
    {
        $result = array();
        $resultsString = array();
        $separators = preg_split('/[+](?!\\()/', $input, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_OFFSET_CAPTURE | PREG_SPLIT_DELIM_CAPTURE);
        foreach ($separators as $part) {
            // $sep[0] - the separator string due to PREG_SPLIT_OFFSET_CAPTURE flag
            // $sep[1] - the offset due to PREG_SPLIT_OFFSET_CAPTURE
            // @todo: = find original usage of this
            //$sep = substr(
            //    $input,
            //    strlen($part[0]) + $part[1] + 1,
            //    isset($separators[$i+1]) ? $separators[$i+1][1] : strlen($input)
            //);
            // @todo: handleCode() in concat
            $part[0] = trim($part[0]);
            if (preg_match('/^("(?:\\\\.|[^"\\\\])*"|\'(?:\\\\.|[^\'\\\\])*\')(.*)$/', $part[0], $match)) {
                if (strlen(trim($match[2]))) {
                    throw new \ErrorException('Unexpected value: ' . $match[2], 8);
                }
                array_push($resultsString, $match[1]);
                continue;
            }
            $code = $this->handleCode($part[0]);
            $result = array_merge($result, array_slice($code, 0, -1));
            array_push($resultsString, array_pop($code));
        }
        array_push($result, implode(' . ', $resultsString));
        return $result;
    }