public function loopScan($scanners, $required = false)
    {
        while ($this->reader->hasLength()) {
            $success = false;
            foreach ($this->scan($scanners) as $token) {
                $success = true;
                yield $token;
            }

            if (!$success) {
                break;
            }
        }

        if ($this->reader->hasLength() && $required) {
            $this->throwException(
                'Unexpected '.$this->reader->peek(20)
            );
        }
    }