public static function forCompileError(array $error, $code, $limit = 25)
    {
        $code = explode("\n", $code);
        $start = $error['line'] - $limit;
        if ($start < 0) {
            $start = 0;
        }

        $code = array_splice($code, $start, $limit * 2);

        foreach ($code as $i => $line) {
            $code[$i] = (++$start) . ': ' . $line;
        }

        $message = sprintf(
            self::COMPILE_ERROR,
            $error['message'],
            $error['line'],
            implode("\n", $code)
        );

        return new static($message);
    }