public function offsetSet($index, $newval)
    {
        $this->blockEndCache = [];

        if (!$this[$index] || !$this[$index]->equals($newval)) {
            $this->changed = true;

            if (isset($this[$index])) {
                $this->unregisterFoundToken($this[$index]);
            }

            $this->registerFoundToken($newval);
        }

        parent::offsetSet($index, $newval);
    }