public function getContentUntil(AbstractToken $token)
    {
        if ($this === $token) {
            return '';
        }

        $content = $this->getContent();
        $next = $this->nextToken;

        while ($next && $next !== $token) {
            $content .= $next->getContent();
            $next = $next->nextToken;
        }

        if (null === $next) {
            throw new \RuntimeException(sprintf('Could not find token "%s".', $token));
        }

        return $content;
    }